-
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 fusion optimization for qasm simulator #136
Conversation
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.
Thanks @hhorii, overall it looks good! My comments are mostly suggestions for renaming things to make it a little easier for others to understand what's going on.
Some more general comments:
- Could you add the
apply_matrix_sequence
function to theunitary_state
since it can support it (though inheritance from QubitVector) - Could you add the basic_optimizations to the statevector_controller and unitary_controller since they would both benefit from the gate fusion too.
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.
LGTM! @atilag did you want to review as well or can we merge?
@hhorii looks like something changed with the tests. As soon as you can get them passing we can merge |
* add fusion * Set configuration to circuit optimization * add fusion options * disable fusion without configuration * add noise test cases and remove debug codes * delete statevector_gate_opt configuration * refactor fusion optimization for future optimization * qubitvector expands matrixes for fusion.
* add fusion * Set configuration to circuit optimization * add fusion options * disable fusion without configuration * add noise test cases and remove debug codes * delete statevector_gate_opt configuration * refactor fusion optimization for future optimization * qubitvector expands matrixes for fusion.
Summary
This PR introduces a basic optimization to aggregate gates in qasm simulator.
Details and comments
Some consecutive gates are aggregated with this optimization.
Available backend_options:
fusion_enable
: enable fusion optimization withTrue
(default:False
).fusion_max_qubit
: set maximum number of qubits for an aggregated operation.fusion_verbose
: output optimized circuitsfusion_threshold
: minimum number of qubits of circuits to enable this optimization.Will remain: supports fusion of large unitary