-
Notifications
You must be signed in to change notification settings - Fork 368
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
add qubits-truncate optimization #164
Conversation
* Adding noise transformation to the noise package * Unified interface for dict/list/string approximating operator input * Implementation of approximate_noise_model * Now generates noise approximation using unitaries if possible * Now when possible outputs error circuits instead of Kraus/Unitary * Now represent all named operators using circuits
@hhorii why did you move the optimization passes out of the controller? It makes the most sense to me there as they are roughly equivalent to transpilation passes in terra and should be able to be applied to circuits regardless of which state they will be executed on (though the state they are intended to be being executed on can obviously effect the optimizations). I think how you had it in your last PR was fine. With this PR I would say rather than check every op type for remapping you should only specify the op types that need a special case for remapping (like snapshots, multiplexer, multimatrix). For every other instruction all you need to do is remap their qubits parameters and as long as you don't change the relative order of the lists it will be consistent. Multiplexer and multimatrix are special cases becuase you also need to remap the |
OK. I used think that this optimization should be applied only to |
It will be useful to apply for any state type used in QasmSimulator (like extended stabilizer, stabilizer, and especially density matrix in the future). The point of it is that (except for snapshots) the QasmSimulator only uses the state type to simulate outcomes of measurements, and those measurement outcomes don't change by this remapping of qubits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @hhorii, thanks for getting this done quickly!
@hhorii The truncation of idle qubits works as expected if I use the
from the QasmSimulator with the overall status of
Do I have to somehow enable fusion explicitly (if truncation is part of it) in the |
Summary
This PR truncates qubits in statevector to resolve #147
Details and comments
If some qubits are not used, qasm simulator does not use them in its qubitvector with this change.