Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shot branching optimization for multi-shots simulations #1606

Closed
wants to merge 1 commit into from

Conversation

doichanj
Copy link
Collaborator

Summary

I recreate this PR from PR #1596 because something is wrong to build Docs.
This PR is implementation of optimization for multi-shots simulations with operations with randomness (measure, reset, initialize, kraus or noise sampling)

Details and comments

Starting from 1 state, the simulation branches state into some states caused by randomness of the operation. Simulation time will be decreased when the number of the final branched states is smaller than number of shots.
To implement this optimization, I moved qreg and creg into Register class and most of the functions of State class takes reference to the Register so that each function can handle Register class independently to manage multiple branched states.

I implemented run_shots function in State class that simulates multiple shots with or without shot branching optimization and also batched execution for GPU.

Here is performance measurements of shot branching using QFT circuits with 1% of Kraus noise (1000 shots)
image
Since there are so many branches in noise simulation, the effect of this implementation is limited. Smaller noise ratio, larger qubits and larger number of shots will improve performance for this test case.
I think shot branching has more advantage in simulating circuits with intermediate measurements. (smaller number of branches)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant