-
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
commutation_checker.py tries to create identity operator with size 2^(2^num_qubits) #9197
Comments
Thanks - your solution looks exactly correct to me. Would you like to try fixing it? If so, we have a general contributing-to-Qiskit guide and a supplement specific to Terra that have instructions on how to do it, and you can feel free to ask here as well. If not, no worries - just let us know here and we (or somebody else from the community) will take care of it. |
Great, thanks for your quick response! If it's not too complicated I would like to try, might be a good way to learn more about git. |
Sounds good to me - feel free to ask questions here if you need to, and either I or one of the community team will help out. Don't worry if you get things wrong or forget something - there's nothing you can do to actually damage things on this repo. |
I've assigned you to the issue so others know somebody's working on it, but don't worry if you need to drop out or anything - just let us know and I'll remove it again. There's no time pressure or anything, it's just a tracker. |
Thanks, I hope everything is fine so far! |
* Fix wrong argument supplied to _identity_op() #9197 * Add test case with large qubit gate This commit adds a test case to ensure we get the correct result with a large number of qubits. This also implicitly tests that we've fixed the excessive memory consumption because the memory requirements for an 8 qubit gate with the bug still present would not be runnable on most current systems. Co-authored-by: Jake Lishman <[email protected]> * Add release note --------- Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Fix wrong argument supplied to _identity_op() #9197 * Add test case with large qubit gate This commit adds a test case to ensure we get the correct result with a large number of qubits. This also implicitly tests that we've fixed the excessive memory consumption because the memory requirements for an 8 qubit gate with the bug still present would not be runnable on most current systems. Co-authored-by: Jake Lishman <[email protected]> * Add release note --------- Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 992d74f)
* Fix wrong argument supplied to _identity_op() #9197 * Add test case with large qubit gate This commit adds a test case to ensure we get the correct result with a large number of qubits. This also implicitly tests that we've fixed the excessive memory consumption because the memory requirements for an 8 qubit gate with the bug still present would not be runnable on most current systems. Co-authored-by: Jake Lishman <[email protected]> * Add release note --------- Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit 992d74f) Co-authored-by: M St <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Fix wrong argument supplied to _identity_op() Qiskit#9197 * Add test case with large qubit gate This commit adds a test case to ensure we get the correct result with a large number of qubits. This also implicitly tests that we've fixed the excessive memory consumption because the memory requirements for an 8 qubit gate with the bug still present would not be runnable on most current systems. Co-authored-by: Jake Lishman <[email protected]> * Add release note --------- Co-authored-by: Matthew Treinish <[email protected]> Co-authored-by: Jake Lishman <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Environment
What is happening?
I am trying to transpile a deep 10 qubit circuit with optimization_level=3. This results in
How can we reproduce the issue?
I broke my code down to this simple example:
This fails with
on my system with 16GiB of memory.
What should happen?
Transpilation should proceed without any issues.
Any suggestions?
Simple fix: _identity_op() in commutation_checker.py takes as argument num_qubits:
https://github.com/Qiskit/qiskit-terra/blob/e775b4d19ad62558f30f39814b3d923ce03c8654/qiskit/circuit/commutation_checker.py#L24-L28
but is called with 2**num_qubits instead:
https://github.com/Qiskit/qiskit-terra/blob/e775b4d19ad62558f30f39814b3d923ce03c8654/qiskit/circuit/commutation_checker.py#L145-L147
So we simply need to replace the argument in line 147 with
extra_qarg2
. I don't know how to fix an issue unfortunately.The text was updated successfully, but these errors were encountered: