412 lines
21 KiB
Plaintext
412 lines
21 KiB
Plaintext
---
|
||
title: qasm3 (v1.2)
|
||
description: API reference for qiskit.qasm3 in qiskit v1.2
|
||
in_page_toc_min_heading_level: 2
|
||
python_api_type: module
|
||
python_api_name: qiskit.qasm3
|
||
---
|
||
|
||
<span id="module-qiskit.qasm3" />
|
||
|
||
<span id="qiskit-qasm3" />
|
||
|
||
<span id="openqasm-3-qiskit-qasm3" />
|
||
|
||
# OpenQASM 3
|
||
|
||
`qiskit.qasm3`
|
||
|
||
Qiskit provides some tools for converting between [OpenQASM 3](https://openqasm.com) representations of quantum programs, and the [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") class. These will continue to evolve as Qiskit’s support for the dynamic-circuit capabilities expressed by OpenQASM 3 increases.
|
||
|
||
## Exporting to OpenQASM 3
|
||
|
||
The high-level functions are simply [`dump()`](#qiskit.qasm3.dump "qiskit.qasm3.dump") and [`dumps()`](#qiskit.qasm3.dumps "qiskit.qasm3.dumps"), which respectively export to a file (given as a filename) and to a Python string.
|
||
|
||
### dump
|
||
|
||
<Function id="qiskit.qasm3.dump" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/__init__.py#L286-L296" signature="qiskit.qasm3.dump(circuit, stream, **kwargs)">
|
||
Serialize a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object as an OpenQASM 3 stream to file-like object.
|
||
|
||
**Parameters**
|
||
|
||
* **circuit** ([*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")) – Circuit to serialize.
|
||
* **stream** (*TextIOBase*) – stream-like object to dump the OpenQASM 3 serialization
|
||
* **\*\*kwargs** – Arguments for the [`Exporter`](#qiskit.qasm3.Exporter "qiskit.qasm3.Exporter") constructor.
|
||
</Function>
|
||
|
||
### dumps
|
||
|
||
<Function id="qiskit.qasm3.dumps" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/__init__.py#L273-L283" signature="qiskit.qasm3.dumps(circuit, **kwargs)">
|
||
Serialize a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object in an OpenQASM 3 string.
|
||
|
||
**Parameters**
|
||
|
||
* **circuit** ([*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")) – Circuit to serialize.
|
||
* **\*\*kwargs** – Arguments for the [`Exporter`](#qiskit.qasm3.Exporter "qiskit.qasm3.Exporter") constructor.
|
||
|
||
**Returns**
|
||
|
||
The OpenQASM 3 serialization
|
||
|
||
**Return type**
|
||
|
||
[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")
|
||
</Function>
|
||
|
||
Both of these exporter functions are single-use wrappers around the main [`Exporter`](#qiskit.qasm3.Exporter "qiskit.qasm3.Exporter") class. For more complex exporting needs, including dumping multiple circuits in a single session, it may be more convenient or faster to use the complete interface.
|
||
|
||
### Exporter
|
||
|
||
<Class id="qiskit.qasm3.Exporter" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/exporter.py#L128-L204" signature="qiskit.qasm3.Exporter(includes=('stdgates.inc', ), basis_gates=('U', ), disable_constants=False, alias_classical_registers=None, allow_aliasing=None, indent=' ', experimental=ExperimentalFeatures.None)" modifiers="class">
|
||
QASM3 exporter main class.
|
||
|
||
**Parameters**
|
||
|
||
* **includes** (*Sequence\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) –
|
||
|
||
the filenames that should be emitted as includes.
|
||
|
||
<Admonition title="Note" type="note">
|
||
At present, only the standard-library file `stdgates.inc` is properly understood by the exporter, in the sense that it knows the gates it defines. You can specify other includes, but you will need to pass the names of the gates they define in the `basis_gates` argument to avoid the exporter outputting a separate `gate` definition.
|
||
</Admonition>
|
||
|
||
* **basis\_gates** (*Sequence\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) – the basic defined gate set of the backend.
|
||
|
||
* **disable\_constants** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) – if `True`, always emit floating-point constants for numeric parameter values. If `False` (the default), then values close to multiples of OpenQASM 3 constants (`pi`, `euler`, and `tau`) will be emitted in terms of those constants instead, potentially improving accuracy in the output.
|
||
|
||
* **alias\_classical\_registers** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) –
|
||
|
||
If `True`, then bits may be contained in more than one register. If so, the registers will be emitted using “alias” definitions, which might not be well supported by consumers of OpenQASM 3.
|
||
|
||
<Admonition title="See also" type="note">
|
||
**Parameter `allow_aliasing`**
|
||
|
||
A value for `allow_aliasing` overrides any value given here, and supersedes this parameter.
|
||
</Admonition>
|
||
|
||
* **allow\_aliasing** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) –
|
||
|
||
If `True`, then bits may be contained in more than one register. If so, the registers will be emitted using “alias” definitions, which might not be well supported by consumers of OpenQASM 3. Defaults to `False` or the value of `alias_classical_registers`.
|
||
|
||
New in version 0.25.0.
|
||
|
||
* **indent** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – the indentation string to use for each level within an indented block. Can be set to the empty string to disable indentation.
|
||
|
||
* **experimental** ([*ExperimentalFeatures*](#qiskit.qasm3.ExperimentalFeatures "qiskit.qasm3.ExperimentalFeatures")) – any experimental features to enable during the export. See [`ExperimentalFeatures`](#qiskit.qasm3.ExperimentalFeatures "qiskit.qasm3.ExperimentalFeatures") for more details.
|
||
|
||
#### dump
|
||
|
||
<Function id="qiskit.qasm3.Exporter.dump" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/exporter.py#L192-L204" signature="dump(circuit, stream)">
|
||
Convert the circuit to OpenQASM 3, dumping the result to a file or text stream.
|
||
</Function>
|
||
|
||
#### dumps
|
||
|
||
<Function id="qiskit.qasm3.Exporter.dumps" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/exporter.py#L186-L190" signature="dumps(circuit)">
|
||
Convert the circuit to OpenQASM 3, returning the result as a string.
|
||
</Function>
|
||
</Class>
|
||
|
||
All of these interfaces will raise [`QASM3ExporterError`](#qiskit.qasm3.QASM3ExporterError "qiskit.qasm3.QASM3ExporterError") on failure.
|
||
|
||
### QASM3ExporterError
|
||
|
||
<Class id="qiskit.qasm3.QASM3ExporterError" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/exceptions.py#L22-L23" signature="qiskit.qasm3.QASM3ExporterError(*message)" modifiers="exception">
|
||
An error raised during running the OpenQASM 3 exporter.
|
||
|
||
Set the error message.
|
||
</Class>
|
||
|
||
### Experimental features
|
||
|
||
The OpenQASM 3 language is still evolving as hardware capabilities improve, so there is no final syntax that Qiskit can reliably target. In order to represent the evolving language, we will sometimes release features before formal standardization, which may need to change as the review process in the OpenQASM 3 design committees progresses. By default, the exporters will only support standardised features of the language. To enable these early-release features, use the `experimental` keyword argument of [`dump()`](#qiskit.qasm3.dump "qiskit.qasm3.dump") and [`dumps()`](#qiskit.qasm3.dumps "qiskit.qasm3.dumps"). The available feature flags are:
|
||
|
||
#### ExperimentalFeatures
|
||
|
||
<Class id="qiskit.qasm3.ExperimentalFeatures" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/experimental.py#L21-L70" signature="qiskit.qasm3.ExperimentalFeatures(value)" modifiers="class">
|
||
Flags for experimental features that the OpenQASM 3 exporter supports.
|
||
|
||
These are experimental and are more liable to change, because the OpenQASM 3 specification has not formally accepted them yet, so the syntax may not be finalized.
|
||
|
||
##### SWITCH\_CASE\_V1
|
||
|
||
<Attribute id="qiskit.qasm3.ExperimentalFeatures.SWITCH_CASE_V1" attributeValue="1">
|
||
Support exporting switch-case statements as proposed by [https://github.com/openqasm/openqasm/pull/463](https://github.com/openqasm/openqasm/pull/463) at [commit bfa787aa3078](https://github.com/openqasm/openqasm/pull/463/commits/bfa787aa3078).
|
||
|
||
These have the output format:
|
||
|
||
```python
|
||
switch (i) {
|
||
case 0:
|
||
case 1:
|
||
x $0;
|
||
break;
|
||
|
||
case 2: {
|
||
z $0;
|
||
}
|
||
break;
|
||
|
||
default: {
|
||
cx $0, $1;
|
||
}
|
||
break;
|
||
}
|
||
```
|
||
|
||
This differs from the syntax of the `switch` statement as stabilized. If this flag is not passed, then the parser will instead output using the stabilized syntax, which would render the same example above as:
|
||
|
||
```python
|
||
switch (i) {
|
||
case 0, 1 {
|
||
x $0;
|
||
}
|
||
case 2 {
|
||
z $0;
|
||
}
|
||
default {
|
||
cx $0, $1;
|
||
}
|
||
}
|
||
```
|
||
</Attribute>
|
||
</Class>
|
||
|
||
If you want to enable multiple experimental features, you should combine the flags using the `|` operator, such as `flag1 | flag2`.
|
||
|
||
For example, to perform an export using the early semantics of `switch` support:
|
||
|
||
```python
|
||
from qiskit import qasm3, QuantumCircuit, QuantumRegister, ClassicalRegister
|
||
|
||
# Build the circuit
|
||
qreg = QuantumRegister(3)
|
||
creg = ClassicalRegister(3)
|
||
qc = QuantumCircuit(qreg, creg)
|
||
with qc.switch(creg) as case:
|
||
with case(0):
|
||
qc.x(0)
|
||
with case(1, 2):
|
||
qc.x(1)
|
||
with case(case.DEFAULT):
|
||
qc.x(2)
|
||
|
||
# Export to an OpenQASM 3 string.
|
||
qasm_string = qasm3.dumps(qc, experimental=qasm3.ExperimentalFeatures.SWITCH_CASE_V1)
|
||
```
|
||
|
||
<Admonition title="Note" type="note">
|
||
All features enabled by the experimental flags are naturally transient. If it becomes necessary to remove flags, they will be subject to [the standard Qiskit deprecation policy](https://github.com/Qiskit/qiskit/blob/main/DEPRECATION.md). We will leave these experimental flags in place for as long as is reasonable.
|
||
|
||
However, we cannot guarantee any support windows for *consumers* of OpenQASM 3 code generated using these experimental flags, if the OpenQASM 3 language specification changes the proposal that the flag is based on. It is possible that any tool you are using to consume OpenQASM 3 code created using these flags may update or remove their support while Qiskit continues to offer the flag. You should not rely on the resultant experimental OpenQASM 3 code for long-term storage of programs.
|
||
</Admonition>
|
||
|
||
## Importing from OpenQASM 3
|
||
|
||
Currently only two high-level functions are offered, as Qiskit support for importing from OpenQASM 3 is in its infancy, and the implementation is expected to change significantly. The two functions are [`load()`](#qiskit.qasm3.load "qiskit.qasm3.load") and [`loads()`](#qiskit.qasm3.loads "qiskit.qasm3.loads"), which are direct counterparts of [`dump()`](#qiskit.qasm3.dump "qiskit.qasm3.dump") and [`dumps()`](#qiskit.qasm3.dumps "qiskit.qasm3.dumps"), respectively loading a program indirectly from a named file and directly from a given string.
|
||
|
||
<Admonition title="Note" type="note">
|
||
While we are still in the exploratory release period, to use either function, the package `qiskit_qasm3_import` must be installed. This can be done by installing Qiskit with the `qasm3-import` extra, such as by:
|
||
|
||
```text
|
||
pip install qiskit[qasm3-import]
|
||
```
|
||
|
||
We expect that this functionality will eventually be merged into Qiskit, and no longer require an optional import, but we do not yet have a timeline for this.
|
||
</Admonition>
|
||
|
||
### load
|
||
|
||
<Function id="qiskit.qasm3.load" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/__init__.py#L299-L321" signature="qiskit.qasm3.load(filename)">
|
||
Load an OpenQASM 3 program from the file `filename`.
|
||
|
||
**Parameters**
|
||
|
||
**filename** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – the filename to load the program from.
|
||
|
||
**Returns**
|
||
|
||
a circuit representation of the OpenQASM 3 program.
|
||
|
||
**Return type**
|
||
|
||
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
|
||
|
||
**Raises**
|
||
|
||
[**QASM3ImporterError**](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") – if the OpenQASM 3 file is invalid, or cannot be represented by a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
|
||
</Function>
|
||
|
||
### loads
|
||
|
||
<Function id="qiskit.qasm3.loads" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/__init__.py#L324-L344" signature="qiskit.qasm3.loads(program)">
|
||
Load an OpenQASM 3 program from the given string.
|
||
|
||
**Parameters**
|
||
|
||
**program** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – the OpenQASM 3 program.
|
||
|
||
**Returns**
|
||
|
||
a circuit representation of the OpenQASM 3 program.
|
||
|
||
**Return type**
|
||
|
||
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
|
||
|
||
**Raises**
|
||
|
||
[**QASM3ImporterError**](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") – if the OpenQASM 3 file is invalid, or cannot be represented by a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
|
||
</Function>
|
||
|
||
Both of these two functions raise [`QASM3ImporterError`](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") on failure.
|
||
|
||
### QASM3ImporterError
|
||
|
||
<Class id="qiskit.qasm3.QASM3ImporterError" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/qasm3/exceptions.py#L26-L27" signature="qiskit.qasm3.QASM3ImporterError(*message)" modifiers="exception">
|
||
An error raised during the OpenQASM 3 importer.
|
||
|
||
Set the error message.
|
||
</Class>
|
||
|
||
For example, we can define a quantum program using OpenQASM 3, and use [`loads()`](#qiskit.qasm3.loads "qiskit.qasm3.loads") to directly convert it into a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"):
|
||
|
||
```python
|
||
import qiskit.qasm3
|
||
|
||
program = """
|
||
OPENQASM 3.0;
|
||
include "stdgates.inc";
|
||
|
||
input float[64] a;
|
||
qubit[3] q;
|
||
bit[2] mid;
|
||
bit[3] out;
|
||
|
||
let aliased = q[0:1];
|
||
|
||
gate my_gate(a) c, t {
|
||
gphase(a / 2);
|
||
ry(a) c;
|
||
cx c, t;
|
||
}
|
||
gate my_phase(a) c {
|
||
ctrl @ inv @ gphase(a) c;
|
||
}
|
||
|
||
my_gate(a * 2) aliased[0], q[{1, 2}][0];
|
||
measure q[0] -> mid[0];
|
||
measure q[1] -> mid[1];
|
||
|
||
while (mid == "00") {
|
||
reset q[0];
|
||
reset q[1];
|
||
my_gate(a) q[0], q[1];
|
||
my_phase(a - pi/2) q[1];
|
||
mid[0] = measure q[0];
|
||
mid[1] = measure q[1];
|
||
}
|
||
|
||
if (mid[0]) {
|
||
let inner_alias = q[{0, 1}];
|
||
reset inner_alias;
|
||
}
|
||
|
||
out = measure q;
|
||
"""
|
||
circuit = qiskit.qasm3.loads(program)
|
||
circuit.draw("mpl")
|
||
```
|
||
|
||

|
||
|
||
### Experimental import interface
|
||
|
||
The import functions given above rely on the ANTLR-based reference parser from the OpenQASM project itself, which is more intended as a language reference than a performant parser. You need to have the extension `qiskit-qasm3-import` installed to use it.
|
||
|
||
Qiskit is developing a native parser, written in Rust, which is available as part of the core Qiskit package. This parser is still in its early experimental stages, so is missing features and its interface is changing and expanding, but it is typically orders of magnitude more performant for the subset of OpenQASM 3 it currently supports, and its internals produce better error diagnostics on parsing failures.
|
||
|
||
You can use the experimental interface immediately, with similar functions to the main interface above:
|
||
|
||
#### load\_experimental
|
||
|
||
<Function id="qiskit.qasm3.load_experimental" signature="qiskit.qasm3.load_experimental(pathlike_or_filelike, /, *, custom_gates=None, include_path=None)">
|
||
Load an OpenQASM 3 program from a source file into a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
|
||
|
||
<Admonition title="Warning" type="caution">
|
||
This native version of the OpenQASM 3 importer is currently experimental. It is typically much faster than [`load()`](#qiskit.qasm3.load "qiskit.qasm3.load"), but has a reduced supported feature set, which will expand over time.
|
||
</Admonition>
|
||
|
||
**Parameters**
|
||
|
||
* **pathlike\_or\_filelike** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") *|*[*os.PathLike*](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") *|*[*io.TextIOBase*](https://docs.python.org/3/library/io.html#io.TextIOBase "(in Python v3.13)")) – the program source. This can either be given as a filepath, or an open text stream object. If the stream is already opened it is consumed in Python space, whereas filenames are opened and consumed in Rust space; there might be slightly different performance characteristics, depending on your system and how the streams are buffered by default.
|
||
* **custom\_gates** (*Iterable\[*[*CustomGate*](#qiskit.qasm3.CustomGate "qiskit.qasm3.CustomGate")*]*) – Python constructors to use for particular named gates. If not supplied, Qiskit will use its own standard-library constructors for gates defined in the OpenQASM 3.0 standard-library file `stdgates.inc`.
|
||
* **include\_path** (*Iterable\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) – the path to search when resolving `include` statements. If not given, Qiskit will arrange for this to point to a location containing `stdgates.inc` only. Paths are tried in the sequence order.
|
||
|
||
**Returns**
|
||
|
||
the constructed circuit object.
|
||
|
||
**Return type**
|
||
|
||
[`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
|
||
|
||
**Raises**
|
||
|
||
**.QASM3ImporterError** – if an error occurred during parsing or semantic analysis. In the case of a parsing error, most of the error messages are printed to the terminal and formatted, for better legibility.
|
||
</Function>
|
||
|
||
#### loads\_experimental
|
||
|
||
<Function id="qiskit.qasm3.loads_experimental" signature="qiskit.qasm3.loads_experimental(source, /, *, custom_gates=None, include_path=None)">
|
||
Load an OpenQASM 3 program from a string into a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
|
||
|
||
<Admonition title="Warning" type="caution">
|
||
This native version of the OpenQASM 3 importer is currently experimental. It is typically much faster than [`loads()`](#qiskit.qasm3.loads "qiskit.qasm3.loads"), but has a reduced supported feature set, which will expand over time.
|
||
</Admonition>
|
||
|
||
**Parameters**
|
||
|
||
* **source** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) – the program source in a Python string.
|
||
* **custom\_gates** (*Iterable\[*[*CustomGate*](#qiskit.qasm3.CustomGate "qiskit.qasm3.CustomGate")*]*) – Python constructors to use for particular named gates. If not supplied, Qiskit will use its own standard-library constructors for gates defined in the OpenQASM 3.0 standard-library file `stdgates.inc`.
|
||
* **include\_path** (*Iterable\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")*]*) – the path to search when resolving `include` statements. If not given, Qiskit will arrange for this to point to a location containing `stdgates.inc` only. Paths are tried in the sequence order.
|
||
|
||
**Returns**
|
||
|
||
the constructed circuit object.
|
||
|
||
**Return type**
|
||
|
||
[`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
|
||
|
||
**Raises**
|
||
|
||
**.QASM3ImporterError** – if an error occurred during parsing or semantic analysis. In the case of a parsing error, most of the error messages are printed to the terminal and formatted, for better legibility.
|
||
</Function>
|
||
|
||
These two functions are both experimental, meaning they issue an [`ExperimentalWarning`](exceptions#qiskit.exceptions.ExperimentalWarning "qiskit.exceptions.ExperimentalWarning") on usage, and their interfaces may be subject to change within the Qiskit 1.x release series. In particular, the native parser may be promoted to be the default version of [`load()`](#qiskit.qasm3.load "qiskit.qasm3.load") and [`loads()`](#qiskit.qasm3.loads "qiskit.qasm3.loads"). If you are happy to accept the risk of using the experimental interface, you can disable the warning by doing:
|
||
|
||
```python
|
||
import warnings
|
||
from qiskit.exceptions import ExperimentalWarning
|
||
|
||
warnings.filterwarnings("ignore", category=ExperimentalWarning, module="qiskit.qasm3")
|
||
```
|
||
|
||
These two functions allow for specifying include paths as an iterable of paths, and for specifying custom Python constructors to use for particular gates. These custom constructors are specified by using the [`CustomGate`](#qiskit.qasm3.CustomGate "qiskit.qasm3.CustomGate") object:
|
||
|
||
#### CustomGate
|
||
|
||
<Class id="qiskit.qasm3.CustomGate" signature="qiskit.qasm3.CustomGate" modifiers="class">
|
||
Information received from Python space about how to construct a Python-space object to represent a given gate that might be declared.
|
||
</Class>
|
||
|
||
In `custom_gates` is not given, Qiskit will attempt to use its standard-library gate objects for the gates defined in OpenQASM 3 standard library file `stdgates.inc`. This sequence of gates is available on this module, if you wish to build on top of it:
|
||
|
||
#### qiskit.qasm3.STDGATES\_INC\_GATES
|
||
|
||
<Attribute id="qiskit.qasm3.STDGATES_INC_GATES">
|
||
A tuple of [`CustomGate`](#qiskit.qasm3.CustomGate "qiskit.qasm3.CustomGate") objects specifying the Qiskit constructors to use for the `stdgates.inc` include file.
|
||
</Attribute>
|
||
|