Summary
cs and csdg are in OpenQASM 3's stdgates.inc, but pyqasm rejects both at unroll with ValidationError: Unsupported / undeclared QASM operation: cs. The other controlled standard gates (ch, cy, cz, crx, …) unroll fine.
Repro (pyqasm 1.2.1)
import pyqasm
for g in ("cs", "csdg", "ch"):
m = pyqasm.loads(f'OPENQASM 3.0;\ninclude "stdgates.inc";\nqubit[2] q;\nbit[2] c;\n{g} q[0], q[1];\nc = measure q;\n')
m.unroll()
# cs -> ValidationError: Unsupported / undeclared QASM operation: cs
# csdg -> ValidationError: Unsupported / undeclared QASM operation: csdg
# ch -> OK
Impact
Seen in production through qbraid-qir (QASM->QIR conversion failed: Unsupported / undeclared QASM operation: csdg) on the qBraid simulators, 6 jobs from one user between 2026-09-23. Any Qiskit circuit containing CSGate/CSdgGate exported to OpenQASM 3 hits it.
Expected
Both decompose trivially: cs a, b = cp(pi/2) a, b; csdg a, b = cp(-pi/2) a, b.
Summary
csandcsdgare in OpenQASM 3'sstdgates.inc, but pyqasm rejects both at unroll withValidationError: Unsupported / undeclared QASM operation: cs. The other controlled standard gates (ch,cy,cz,crx, …) unroll fine.Repro (pyqasm 1.2.1)
Impact
Seen in production through qbraid-qir (
QASM->QIR conversion failed: Unsupported / undeclared QASM operation: csdg) on the qBraid simulators, 6 jobs from one user between 2026-09-23. Any Qiskit circuit containingCSGate/CSdgGateexported to OpenQASM 3 hits it.Expected
Both decompose trivially:
cs a, b=cp(pi/2) a, b;csdg a, b=cp(-pi/2) a, b.