Skip to content

cirq.Rx/Ry/Rz(pi) has confusing QASM output since these are not gates on their own.  #1800

@balopat

Description

@balopat

as cirq.Rx() is just an XPowGate instantiation, Rx(pi) becomes x. This is just true up to a global phase, but also might be surprising for users. Also Rx(0) is not id, so it is not consistent.

Recommendations:

  • cirq.Rx/Ry/Rx would become proper subclasses of XPowGate instead of just methods and override the _qasm_ to keep the rx(<angle>) q; QASM output form.
  • XPowGate._qasm_ should handle the identity case when _exponent == 0

Metadata

Metadata

Assignees

Labels

area/gatesarea/interoparea/qasmkind/bug-reportSomething doesn't seem to work.status/needs-agreed-designWe want to do this, but it needs an agreed upon design before implementationtriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions