-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement PauliStringPhasorGate #4696
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
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.
A first round of high level comments. My main question is that whether we can fix these inconsistencies at a higher level; i.e.
Q1: Can we make PauliString
a GateOperation
?
Q2: Can we make PauliStringGateOperation
a GateOperation
or deprecate it after this change?
I didn't notice that it wasn't (it has a
I think we should deprecate it. It doesn't appear to be a useful abstraction, it just provides some convenience functions that should probably be module-level, if anything. That said, we may want an interface |
@tanujkhattar Here's a slightly different approach where we don't break the inheritance from It's a little more redundant, since it has to do all the protocol forwarding. But safer since it doesn't break the hierarchy. I do see a couple places in the code where (Ideally we could make What do you think? Should we go with this alternate approach? |
Per cirq-sync notes it sounds like we'd prefer the breaking change. I'll revert to the previous implementation here, and then make sure everywhere our code has |
Reverted this to bring back the hard break from PauliStringGateOperation as we'd discussed in cirq-sync noted above. @tanujkhattar |
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.
Looking pretty good. Left a final round of comments.
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.
Final round of comments. Thanks for the iterations!
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.
LGTM
BREAKING CHANGE: PauliStringPhasor no longer inherits from PauliStringGateOperation. Implements PauliStringPhasor in terms of a GateOperation on a new class PauliStringPhasorGate. Mostly involved moving existing functions from the operation to the gate, and then having the operation call those methods under the hood. Closes quantumlib#1561, xref quantumlib#4683 @tanujkhattar
BREAKING CHANGE: PauliStringPhasor no longer inherits from PauliStringGateOperation. Implements PauliStringPhasor in terms of a GateOperation on a new class PauliStringPhasorGate. Mostly involved moving existing functions from the operation to the gate, and then having the operation call those methods under the hood. Closes quantumlib#1561, xref quantumlib#4683 @tanujkhattar
BREAKING CHANGE: PauliStringPhasor no longer inherits from PauliStringGateOperation. Implements PauliStringPhasor in terms of a GateOperation on a new class PauliStringPhasorGate. Mostly involved moving existing functions from the operation to the gate, and then having the operation call those methods under the hood. Closes quantumlib#1561, xref quantumlib#4683 @tanujkhattar
BREAKING CHANGE: PauliStringPhasor no longer inherits from PauliStringGateOperation.
Implements PauliStringPhasor in terms of a GateOperation on a new class PauliStringPhasorGate.
Mostly involved moving existing functions from the operation to the gate, and then having the operation call those methods under the hood.
Closes #1561, xref #4683
@tanujkhattar