-
Notifications
You must be signed in to change notification settings - Fork 989
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 Rx, Ry, Rz gates #3920
Add Rx, Ry, Rz gates #3920
Conversation
return protocols.CircuitDiagramInfo( | ||
wire_symbols=('X',), exponent=self._diagram_exponent(args) | ||
) | ||
|
||
def _qasm_(self, args: 'cirq.QasmArgs', qubits: Tuple['cirq.Qid', ...]) -> Optional[str]: | ||
args.validate_version('2.0') | ||
if self._exponent == 1: | ||
if self._exponent == 1 and self._global_shift != -0.5: |
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.
Why this change? The other case is ignoring global phase anyway, so it's not clear why we should be picky here.
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 is to fix (at least partially) #1800.
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.
Makes sense. Thanks.
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. Might be good to get another maintainer to look it over as well, since these are such important gates, but up to you.
@@ -58,6 +58,9 @@ | |||
CZPowGate, | |||
H, | |||
HPowGate, | |||
Rx, | |||
Ry, | |||
Rz, | |||
rx, |
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 we can deprecate these in favor for the R* constructors.
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.
Filed an issue to track this: #3929
Discussed in cirq sync: we should implement |
@maffoo Exponentiating R* gates work as expected because |
@balopat Do you want to take another look or should I merge? |
This breaks pytket which uses |
This PR creates separate
Rx
,Ry
,Rz
gates.