Skip to content

inv @ raises on sx, sxdg, p, u, prx, gpi and gpi2 #476

Open

Description

@ryanhill1

inv @ with no ctrl raises on several single-qubit standard gates. It raises on main too, so this isn't a regression from #459.

from pyqasm import loads
m = loads('OPENQASM 3.0;\ninclude "stdgates.inc";\nqubit[1] q;\ninv @ sx q[0];')
m.unroll()
# ValidationError: Unsupported / undeclared QASM operation: sx

Gates that raise: sx, sxdg, p, u, prx, gpi, gpi2. Gates that unroll: U, u2, id, s, t, rz.

inv @ ctrl(n) @ already handles all of these exactly through the U-form inverse, (e^{iγ}U(θ, φ, λ))† = e^{-iγ}U(-θ, -λ, -φ). One fix is to send plain inv @ on a gate with a U-form base down the same path.

Raised by @TheGupta2012 in the review of #459 (L1).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions