80 lines
9.5 KiB
Plaintext
80 lines
9.5 KiB
Plaintext
---
|
||
title: OpenQASM 3 feature table
|
||
description: A table of the language features included in OpenQASM 3.
|
||
---
|
||
|
||
{/* cspell:ignore durationof */}
|
||
|
||
# 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](https://openqasm.com/) .
|
||
|
||
Key:
|
||
|
||
* ❌ Not supported
|
||
* 🟡 Partial support
|
||
* ✅ Supported
|
||
|
||
| Feature | Support | Comments |
|
||
| ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||
| comments | ✅ | |
|
||
| QASM version string | ✅ | |
|
||
| `include` | ✅ | |
|
||
| unicode names | ✅ | |
|
||
| `qubit` | 🟡 | Only supports physical qubits, and no arrays. |
|
||
| `bit` | ✅ | |
|
||
| `bool` | ✅ | |
|
||
| `int` | ✅ | Some support for comparisons against integers and casting. |
|
||
| `uint` | ❌ | |
|
||
| `float` | ❌ | |
|
||
| `angle` | ❌ | |
|
||
| `complex` | ❌ | |
|
||
| `const` | ❌ | |
|
||
| `pi`/`π`/`tau`/`τ`/`euler`/`ℇ` | ❌ | |
|
||
| Aliasing: let | ❌ | |
|
||
| register concatenation | ❌ | |
|
||
| casting | 🟡 | Casting between arrays of bits, int, and bool is supported |
|
||
| `duration` | ✅ | |
|
||
| `durationof` | ❌ | |
|
||
| `ns`/`µs`/`us`/`ms`/`s`/`dt` | ✅ | |
|
||
| `stretch` | ❌ | |
|
||
| `delay` | ✅ | |
|
||
| `barrier` | ✅ | |
|
||
| `box` | ❌ | |
|
||
| Built-in `U` | ✅ | |
|
||
| `gate` | ✅ | No support for non-basis gates |
|
||
| `gphase` | ❌ | |
|
||
| `ctrl @`/ `negctrl @` | ❌ | |
|
||
| `inv @` | ❌ | |
|
||
| `pow(k) @` | ❌ | |
|
||
| `reset` | ✅ | |
|
||
| `measure` | ✅ | |
|
||
| bit operations | ✅ | |
|
||
| boolean operations | ✅ | |
|
||
| arithmetic expressions | ❌ | |
|
||
| comparisons | ✅ | |
|
||
| `if` | ✅ | |
|
||
| `else` | ✅ | |
|
||
| `else if` | ❌ | |
|
||
| `for` loops | 🟡 | Discrete sets and negative stepping is not supported. |
|
||
| `while` loops | ❌ | |
|
||
| `continue` | ❌ | |
|
||
| `break` | ❌ | |
|
||
| `return` | ❌ | |
|
||
| `extern` | 🟡 | Only for certain extern subroutines exposed by systems. It is currently not possible for clients to submit these. |
|
||
| `def` subroutines (classical) | ❌ | |
|
||
| `def` subroutines (quantum) | ❌ | |
|
||
| `input` | ❌ | |
|
||
| `output` | ❌ | |
|
||
|
||
## Next steps
|
||
|
||
<Admonition type="tip" title="Recommendations">
|
||
- Learn how to generate OpenQASM code in the [Explore gates and circuits with the Quantum Composer](https://learning.quantum.ibm.com/tutorial/explore-gates-and-circuits-with-the-quantum-composer) tutorial.
|
||
- See the [OpenQASM 3 Qiskit API](/api/qiskit/qasm3) reference.
|
||
- See the [OpenQASM 2 Qiskit API](/api/qiskit/qasm2) reference.
|
||
- Review the [Verify your program](./debugging-tools) topic.
|
||
- Visit the [OpenQASM Live Specification](https://openqasm.com/).
|
||
</Admonition> |