-
Notifications
You must be signed in to change notification settings - Fork 10
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
QAOA Transpilation capabilities #34
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 Daniel! I think this is a good addition to the repo. I just added a few minor suggestions and notes for the future. I think there are some interesting improvements that could be added in the future, like making the code more performant, or playing with the idea of the pass manager permuting the cost operator in a way that makes the interaction with the estimator more streamlined (based on the unit test you added).
f"{init_state.num_qubits} != {num_qubits}" | ||
) | ||
|
||
cost_layer = dag_to_circuit(cost_layer_dag) |
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.
I am fine keeping this as a first implementation but noting that in the future it would be more performant not to convert to circuit here and instead, work with a dag end-to-end.
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.
Agreed. I left a comment to this effect. See here: 0ae273b
As for the failing tests in CI... I am not really sure what changed. The only recent-ish updates (5 months ago) I've seen on Sherbrooke are https://github.com/Qiskit/qiskit-ibm-runtime/pull/1710/files#diff-5b1aae933214467d4a9b6e02e2241cfe9552e4022933a3fca43d09f8fbe487b2, which adds missing control flow instructions but doesn't modify any other information. Given the limited time we have to work on this project, I can open an issue noting this discrepancy and change the test not to block progress. It is definitely a bit suspicious. |
Related issue: #35 |
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
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
Summary
This PR adds transpilation capabilities as functions and classes.
Details and comments
This PR introduces the method
qaoa_swap_strategy
which creates a pass manager that (i) applies the SWAP strategy toexp(-i γ H_c)
and (ii) builds the full QAOA ansatz after applying the SWAP strategy.The PR introduces the transformation pass
QAOAConstructionPass
which builds a full ansatz from the cost layer alone.