-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix behavior of n_local calling circuits for num_qubits=1 #13523
Conversation
Ethan Gordon seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
674511d
to
ea6fa73
Compare
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.
This approach looks good! I left some small comments, but you can do the same approach for the other functions (like real_amplitudes
, ...) 🙂
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
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! There's also pauli_two_design
which has the same issue 🙂
releasenotes/notes/fix-efficient-su2-numqubits-issue-2b2c91c1186f82ac.yaml
Outdated
Show resolved
Hide resolved
oh shoot did not catch that sorry! Will put in fix tonight! |
Thanks for the updates! The CI seems to be complaining the |
should be good to go! |
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 12366380330Details
💛 - Coveralls |
Co-authored-by: Julien Gacon <[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, thanks for the fix @trigpolynom!
* added fix for efficient_su2 * making fix for real_amplitudes and excitation_preserving * formatted * passing tests * added release notes * fixed pauli_two_design * fixed format * fixed pauli_two_design issue * fixed unused gate * Update qiskit/circuit/library/n_local/pauli_two_design.py Co-authored-by: Julien Gacon <[email protected]> * addressing change --------- Co-authored-by: Julien Gacon <[email protected]> (cherry picked from commit 82bbcaa)
…13575) * added fix for efficient_su2 * making fix for real_amplitudes and excitation_preserving * formatted * passing tests * added release notes * fixed pauli_two_design * fixed format * fixed pauli_two_design issue * fixed unused gate * Update qiskit/circuit/library/n_local/pauli_two_design.py Co-authored-by: Julien Gacon <[email protected]> * addressing change --------- Co-authored-by: Julien Gacon <[email protected]> (cherry picked from commit 82bbcaa) Co-authored-by: trigpolynom <[email protected]>
Summary
Fixes #13480.
When circuits that construct n_local were passed num_qubits = 1, an error would be thrown because the default entangling gate, "cx", requires at least 2. The fix involved just checking for num_qubits and setting to an empty array if num_qubits is not greater than 1.
Details and comments
The fix had to be applied to efficient_su2, excitation_preserving, and real_amplitudes. Test methods were added for each changed function.