Cette page n'a pas encore été traduite. Vous voyez la version originale en anglais.
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 meaning of the complete "supported" mark depends on the column:
-
Qiskit SDK: The feature can be parsed by
qiskit.qasm3.loads(by using theqiskit-qasm3-importextension), represented in aQuantumCircuit, and exported to OpenQASM 3 byqiskit.qasm3.dumps. -
IBM Qiskit Runtime: A circuit containing the corresponding Qiskit feature can be successfully executed on hardware through IBM® Qiskit Runtime.
The meaning of "partial support" typically depends on the linked notes.
The most common method of submitting circuits to IBM Qiskit Runtime is to create the circuit in the Python-space interface to Qiskit SDK. Circuits constructed and submitted in this manner do not need to be loaded from OpenQASM 3 files into Qiskit SDK.
If you do not use OpenQASM 3 directly yourself, you can safely use features that are supported for representation in Qiskit SDK, export to OpenQASM 3, and submission to IBM Qiskit Runtime. This includes features that cannot be loaded by Qiskit SDK from OpenQASM 3.
| 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 | ✅ |