OpenQASM 3 feature table
Below is a list of the OpenQASM 3
language features.
For more details on these capabilities, see the OpenQASM 3.X Live Specification.
Key:
- โ Not supported
- ๐ก Partial support
- โ Supported
The "supported" mark meaning depends on the column:
-
Qiskit SDK: The feature can be parsed by
qiskit.qasm3.loads
(by using theqiskit-qasm3-import
extension) and represented in aQuantumCircuit
.The feature can be exported to OpenQASM 3 by
qiskit.qasm3.dumps
. -
IBM Qiskit Runtime: A circuit containing the corresponding Qiskit feature can be successfully executed on hardware through IBMยฎ Qiskit Runtime.
OpenQASM 3 Feature | Qiskit SDK feature | Qiskit SDK | IBM Qiskit Runtime | Notes |
---|---|---|---|---|
comments | โ | โ | 1 | |
QASM vstring | โ | โ | 1 | |
include | ๐ก | โ | 1, 7 | |
unicode names | โ | โ | ||
qubit | Qubit and QuantumRegister | โ | ๐ก | 2 |
bit | Clbit and ClassicalRegister | โ | โ | 3 |
bool | expr.Var and classical expressions | ๐ก | โ | 4 |
int | โ | โ | 4 | |
uint | expr.Var and classical expressions | ๐ก | โ | 4 |
float | expr.Var and classical expressions | ๐ก | ๐ก | 4 |
angle | Implicit, as gate parameters | โ | ๐ก | 4 |
complex | โ | โ | 4 | |
const | โ | โ | 4 | |
pi /ฯ /tau /ฯ /euler /โ | Constant-folded into gate parameters | โ | โ | |
Aliasing: let | Quantum and classical registers | ๐ก | โ | 5 |
register concatenation | Quantum and classical registers | ๐ก | โ | 5 |
casting | expr.Cast classical expressions | ๐ก | ๐ก | 4 |
duration | โ | โ | ||
durationof | โ | โ | ||
ns /ยตs /us /ms /s /dt | Durations of delay and box | โ | โ | 6 |
stretch | expr.Stretch | ๐ก | ๐ก | 4, 6 |
delay | Delay /QuantumCircuit.delay | โ | โ | 6 |
barrier | Barrier /QuantumCircuit.barrier | โ | โ | |
box | BoxOp /QuantumCircuit.box | โ | โ | 6 |
Built-in U | UGate /QuantumCircuit.u | โ | โ | |
gate | ๐ก | ๐ก | 7 | |
gphase | QuantumCircuit.global_phase | ๐ก | โ | 7 |
ctrl @ / negctrl @ | AnnotatedOperation | ๐ก | โ | 7 |
inv @ | AnnotatedOperation | ๐ก | โ | 7 |
pow(k) @ | AnnotatedOperation | ๐ก | โ | 7 |
reset | Reset /QuantumCircuit.reset | โ | โ | |
measure | Measure /QuantumCircuit.measure | โ | โ | |
bit operations | โ | โ | 4 | |
boolean operations | โ | โ | 4 | |
arithmetic expressions | ๐ก | ๐ก | 4 | |
comparisons | โ | โ | 4 | |
if | QuantumCircuit.if_test | โ | โ | 8 |
else | QuantumCircuit.if_test | โ | โ | 8 |
else if | QuantumCircuit.if_test | โ | โ | 8 |
for loops | QuantumCircuit.for_loop | ๐ก | โ | 8 |
while loops | QuantumCircuit.while_loop | โ | โ | 8 |
continue | QuantumCircuit.continue_loop | ๐ก | โ | 8 |
break | QuantumCircuit.break_loop | ๐ก | โ | 8 |
return | โ | โ | ||
extern | โ | โ | ||
def subroutines (classical) | โ | โ | ||
def subroutines (quantum) | โ | โ | ||
input | QuantumCircuit.add_input | โ | ๐ก | 4, 9 |
output | โ | โ |
Notes
- These OpenQASM 3 program features have no impact on the execution and Qiskit strips them
out as part of parsing the files. Files that use them can be submitted but they will have
no effect. For
include
files,stdgates.inc
is currently supported as input to Qiskit, and backend execution always requires circuits to have been compiled to the backend Instruction Set Architecture (ISA), whereinclude
files are irrelevant.
- Qiskit SDK supports parsing and dumping OpenQASM 3 files with any
qubit
declarations. For execution on hardware, only circuits defined in terms of hardware qubits (for example,$0
) are valid. Qiskit SDK automatically outputs OpenQASM 3 in terms of the supported hardware-qubit identifiers if the circuit was transpiled for a backend with layout information.
bit
- andbit[n]
-typed variable declarations in Qiskit SDK correspond toClbit
andClassicalRegister
declarations.
- As of July 2025, Qiskit SDK (through
qiskit-qasm3-import
v0.6.0) does not support parsing OpenQASM 3 files that contain variable declarations, and has very limited support for parsing variable expressions.QuantumCircuit
, however, can represent local variables of a restricted set of types, can represent many different expressions on these types, and supports outputting them to OpenQASM 3. In general, most of what Qiskit can represent in its expression system can be executed on suitable dynamic circuits hardware. See the Qiskit documentation of theqiskit.circuit.classical
module for the most up-to-date information.
- Qiskit SDK can represent register aliasing for both quantum and classical registers, but it is
strongly discouraged to use aliasing of classical registers. Most expressions on classical
registers do not work with aliases, and aliased classical registers are not supported for
execution on hardware. The Qiskit OpenQASM 3 parser can resolve
let
alias statements that bind the result of register concantenation.
- Qiskit SDK supports explicit delays via
QuantumCircuit.delay
, and circuit boxes (QuantumCircuit.box
) can also have explicit durations. These durations can include classical expressions ofstretch
variables. Qiskit SDK (as of July 2025 throughqiskit-qasm3-import
v0.6.0) does not support parsing declarations of typeduration
or typestretch
from OpenQASM 3 files. Hardware has limited support for durations includingstretch
.
- Circuits must be transpiled to the backend ISA to run on IBM hardware. This precludes
custom
gate
definitions and higher-level constructs like gate modifiers (such asinv @
) from being valid for execution on hardware verbatim, but thetranspile
process resolves them into valid ISA circuits. Qiskit SDK (as of July 2025, throughqiskit-qasm3-import
v0.6.0) will eagerly evaluate gate modifiers during the parse, so these will not be evident in the resultingQuantumCircuit
, potentially at a runtime cost.
- Qiskit SDK can represent structured control flow and export this to OpenQASM 3. The
continue
andbreak
statements can technically be represented by Qiskit, but are not well supported even within Qiskit SDK.for
loops in Qiskit v2.1.0 are not well supported. Nested control flow (such as anif
inside anotherif
, or anelse if
statement) is not eligible for execution on hardware.
- Qiskit SDK supports declaring any supported classical type as an
input
variable on the circuit. Such variables are not currently eligible for execution on hardware, and cannot be loaded by the Qiskit OpenQASM 3 importer. UnboundParameter
objects present in theQuantumCircuit
are exported asinput float[64]
variables. Certain runtime configuration options can enable executing such circuits on some backends.
Next steps
Recommendations
- Learn how to generate OpenQASM code using IBM Quantum Composer.
- See the OpenQASM 3 Qiskit API reference.
- See the OpenQASM 2 Qiskit API reference.
- Review the Verify your program topic.
- Visit the OpenQASM Live Specification.