-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add equivalences from CR<Pauli>
to R<Paulis>
#9507
Conversation
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 the following people are requested to review this: |
It's not really related to this PR, as a standalone these equivalences are fine on their own. But one thing we are missing in the equivalence lib (it came up on slack) is targeting a |
Pull Request Test Coverage Report for Build 4066536314
💛 - 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.
(For posterity: the correctness of the standard equivalence library is tested automatically, without needing to modify the suite.)
# RXX to RZX | ||
# ┌─────────┐ ┌───┐┌─────────┐┌───┐ | ||
# q_0: ┤0 ├ q_0: ┤ H ├┤0 ├┤ H ├ | ||
# │ Rxx(ϴ) │ ≡ └───┘│ Rzx(ϴ) │└───┘ | ||
# q_1: ┤1 ├ q_1: ─────┤1 ├───── | ||
# └─────────┘ └─────────┘ | ||
theta = Parameter("theta") | ||
rxx_to_rzx = QuantumCircuit(2) | ||
rxx_to_rzx.h(0) | ||
rxx_to_rzx.rzx(theta, 0, 1) | ||
rxx_to_rzx.h(0) | ||
_sel.add_equivalence(RXXGate(theta), rxx_to_rzx) |
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.
If this is correct then I don't like our naming convention for RZXGate
- to me, that reads as a ZX
bitstring interaction, i.e. the Z
is on qubit 1. But whatever, even if it mattered what I thought, the ship's long since sailed.
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.
Tbh I never know which order it is and just end up trying until it fits 😅 but I agree that RZX
should implement e^{i theta * ZX}
and in our tensor order that would be Z
on q_1
..
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 think the argument is that it implements what our documentation calls
But anyway, the ship's sailed, and it's unrelated to this PR!
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.
Ah - Wikipedia explains:
the Kronecker product, sometimes denoted by
$\otimes$
as opposed to:
the tensor product
$V\otimes W$
I've never used \otimes
to refer to the Kronecker product, and wasn't aware that was something people did - to me, it's always meant the arbitrary tensor product, which isn't tied to any particular representation of linear algebra.
@mtreinish I opened an issue to keep track of these missing equivalences: #9511 |
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
Add equivalences from controlled Pauli rotations to 2-Pauli rotations. This is particularly interesting e.g. for QPD applications where cuts are usually defined for 2-Pauli rotations or for compiling to the RZX gate and using a pulse-efficient decomposition. This could e.g. be used to compile a
CRY
gate to an efficient pulse sequence instead of 2 CX gates.