-
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 UnitarySynthesis
for 3+ qubits when compiled for a backend
#13591
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 12650420997Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
releasenotes/notes/fix-unitary-synthesis-3q-2b2de5305bfd11ff.yaml
Outdated
Show resolved
Hide resolved
Thanks for the fix, @Cryoris! Looks good! (modulo some minor spell-checking nitpicks about the release notes)
Are you planning to add a test for that (like the one you have in the code snippet in the description)? |
Co-authored-by: Alexander Ivrii <[email protected]>
…terra into fix-unitary-synthesis-3q
@alexanderivrii more tests added in 583ec3d 🙂 |
) * Fix unitary synthesis for 3+ q * Update releasenotes/notes/fix-unitary-synthesis-3q-2b2de5305bfd11ff.yaml Co-authored-by: Alexander Ivrii <[email protected]> * add more tests * use == over equiv --------- Co-authored-by: Alexander Ivrii <[email protected]> (cherry picked from commit 86a5325)
) (#13619) * Fix unitary synthesis for 3+ q * Update releasenotes/notes/fix-unitary-synthesis-3q-2b2de5305bfd11ff.yaml Co-authored-by: Alexander Ivrii <[email protected]> * add more tests * use == over equiv --------- Co-authored-by: Alexander Ivrii <[email protected]> (cherry picked from commit 86a5325) Co-authored-by: Julien Gacon <[email protected]>
Summary
When encountering a 3+ qubit
UnitaryGate
,UnitarySynthesis
currently replaces the whole dag with the definition of the block instead of appending it, seeqiskit/crates/accelerate/src/unitary_synthesis.rs
Line 375 in 079f69f
Details and comments
This also leads to #13586 because the qubit/clbit interners are overwritten, but maybe more importantly this can lead to issues when multiple 3-qubit blocks are present in the circuit. E.g. running
produces an empty circuit, since the last block implements the identity.
Some additional tests, such as the precise case of #13586 and a series of 3q
UnitaryGate
s, should be added.