-
Notifications
You must be signed in to change notification settings - Fork 82
CZ #1116
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
CZ #1116
Conversation
|
I need to hook this up to the docs system, marking as draft |
|
|
||
|
|
||
| @frozen | ||
| class CZ(Bloq): |
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.
https://github.com/quantumlib/Qualtran/pull/1115/files adds a CYGate whereas this PR adds a CZ gate. Let's keep the CX / CY / CZ family's name consistent -- let's either add CPGate or CP where P is the pauli in question.
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.
My original motivation was to use CNOT and CZ for those two gates since those are very common names. I.e. folks would expect to find a CNOT bloq and a CZ bloq through tab completion or searching the docs site. CY just doesn't feel as common to me, although I take the point on the consistency angle. But I really don't want to change CNOT to be CX.
|
|
||
| @cached_property | ||
| def signature(self) -> 'Signature': | ||
| return Signature.build(q1=1, q2=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.
Should we just accept Signature([Register('q', QBit(), shape=2)]) instead of a q1 and q2 ? This will keep things consistent with rotation bloqs deriving from CirqGateAsBloqBase. We can also follow the same pattern for 3 qubit gates instead of q1, q2, q3 etc.
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'll make the change in the other pr's to be ctrl and target. Conceivably, that could be the case here as well; but CZ is symmetric.
Add the controlled-Z CZ gate