-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix construction of IQP circuits #14363
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
Conversation
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 15022677549Details
💛 - Coveralls |
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.
wtf -- nice catch! Just to be sure: the example in the docs page has an odd number on the diagonals? Otherwise the IQP circuit is not very interesting, since it only has Clifford gates 🙂
Fixed the construction of Instantaneous Quantum Polynomial time (IQP) circuits | ||
in :class:`~qiskit.circuit.library.IQP` and by :func:`~qiskit.circuit.library.iqp`: | ||
T-gate is equivalent to P(pi/4) and not to P(pi/8). |
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.
Maybe this is a little clearer for users to understand (who didn't know the bug was a wrong angle)? 🙂
Fixed the construction of Instantaneous Quantum Polynomial time (IQP) circuits | |
in :class:`~qiskit.circuit.library.IQP` and by :func:`~qiskit.circuit.library.iqp`: | |
T-gate is equivalent to P(pi/4) and not to P(pi/8). | |
Fixed the construction of Instantaneous Quantum Polynomial time (IQP) circuits | |
in :class:`~qiskit.circuit.library.IQP` and by :func:`~qiskit.circuit.library.iqp`: | |
which was using powers of :math:`\sqrt{T}` gates instead of powers | |
of :math:`T` gates as single qubit operations. |
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 makes sense, I have reworded the note following your suggestion. I got rid of "single qubit operations" since H-gates are also single-qubit operations present in the circuit.
perhaps you should also update the code of |
Yes, one of the 3 numbers on the diagonal is odd. There are also odd off-diagonal entries which correspond to
There is nothing left to be done for |
* Fix construction of IQP circuits * release notes * rewording release notes based on suggestion (cherry picked from commit 6ca3d22) # Conflicts: # crates/accelerate/src/circuit_library/iqp.rs
@Mergifyio backport stable/1.4 |
✅ Backports have been created
|
* Fix construction of IQP circuits * release notes * rewording release notes based on suggestion (cherry picked from commit 6ca3d22) # Conflicts: # crates/accelerate/src/circuit_library/iqp.rs
* Fix construction of IQP circuits (#14363) * Fix construction of IQP circuits * release notes * rewording release notes based on suggestion (cherry picked from commit 6ca3d22) # Conflicts: # crates/accelerate/src/circuit_library/iqp.rs * Fix merge conflicts --------- Co-authored-by: Alexander Ivrii <alexi@il.ibm.com> Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
* Fix construction of IQP circuits * release notes * rewording release notes based on suggestion
Summary
As documented in https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.iqp_function, an Instantaneous quantum polynomial time (IQP) circuit consists of Hadamard gates, powers of T-gate, powers of CS-gate, and more Hadamard gates. However, a T-gate is P($\pi$ /4), not P($\pi$ /8), see https://docs.quantum.ibm.com/api/qiskit/qiskit.circuit.library.PhaseGate. This PR fixes the construction as used both within
iqp_function
andIQP
.Trivia
The bug was introduced in the original commit #4266 and survived porting to Rust #13241. Incidentally, the original commit pertains to one of the questions from (the internal) Qiskit 2.0 quiz.