Parallelize sampling measurement in MPS #1911
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Hello, this PR is a parallelization over the measurement sampling algorithm implemented in #1377.
Details and comments
Measurement can be parallelized at shots level. A small critical part is necessary to ensure the random numbers are generated correctly. With this, performance is better than current implementation in almost every case.
For the PR and benchmarking, parallelism can be activated or deactivated using the environmental variable
PRL_PROB_MEAS=1
. If you are ok with the parallelization I will just remove the condition.Here are some results using Random Quantum Circuit (https://arxiv.org/pdf/2207.14280.pdf) for 30 qubits and different depths:
Server configuration
For Depth 1 and 3, the main "problem" is the overhead from the parallelization, execution time was already small.
And here the specific times (in seconds)
Or checking with a different number of qubits but same depth