Skip to content

DelayInstruction is not lowered: qasm3_to_qir raises "Unsupported statement of type DelayInstruction" #304

Description

@ryanhill1

Summary

qasm3_to_qir fails on any program containing a delay instruction:

qbraid_qir.qasm3.exceptions.Qasm3ConversionError: Unsupported statement of type <class 'openqasm3.ast.DelayInstruction'>

raised from qbraid_qir/qasm3/visitor.py:672. pyqasm 1.2.1 parses and unrolls the same program without complaint (delay[100ns] q[0]; survives unroll() unchanged), so the gap is in the QIR visitor, not the parser.

Repro (qbraid-qir 0.6.0, pyqasm 1.2.1)

from qbraid_qir import qasm3_to_qir
qasm3_to_qir('OPENQASM 3.0;\ninclude "stdgates.inc";\nqubit[1] q;\nbit[1] c;\nx q[0];\ndelay[100ns] q[0];\nc[0] = measure q[0];\n')

Impact

Seen in production on qbraid:qbraid:sim:qir-sv (2 jobs, 1 user, 2026-09-07): the job fails at submit with Failed to convert OpenQASM program to QIR: Unsupported statement of type <class 'openqasm3.ast.DelayInstruction'>.

Suggestion

For the simulators QIR targets a delay has no observable effect; dropping DelayInstruction (with a warning) would unblock these programs. If QIR consumers ever want timing, __quantum__qis__delay could be emitted instead, but nothing downstream reads it today.

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