Registry / ai-ml / qiskit-qasm3-import

qiskit-qasm3-import

JSON →
library0.6.0pypypiunverified

The `qiskit-qasm3-import` library provides functionality to parse OpenQASM 3 strings into Qiskit circuits, enabling interoperability between QASM 3 programs and the Qiskit ecosystem. It is currently at version 0.6.0 and releases new minor versions periodically, typically in conjunction with Qiskit's major releases or to add support for new QASM 3 features.

pip install qiskit-qasm3-import
INSTALL
IMPORT
SIG · QISKIT-QASM3-IMPOR
Q
qiskit-qasm3-import
ai-mlpythonv0.6.0
Install
9.2s avg
Import
Disk
276MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 9.2s · import 0.000s · 271MB
276MB installed
● package 276MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

loads
from qiskit_qasm3_import import loads
from qiskit_qasm3_import import loads
convert
from qiskit_qasm3_import import convert
parse
from qiskit_qasm3_import import parse

Parse an OpenQASM 3 string into a Qiskit `QuantumCircuit` object using the `loads` function.

from qiskit_qasm3_import import loads qasm3_str = """ OPENQASM 3.0; include "qelib1.inc"; qreg q[2]; creg c[2]; h q[0]; cx q[0], q[1]; measure q -> c; """ # Parse the QASM 3 string into a Qiskit QuantumCircuit circuit = loads(qasm3_str) # Print a summary of the resulting circuit print(circuit.draw('text', idle_wires=False))
Debug
Known issues
breakingVersion 0.6.0 of `qiskit-qasm3-import` introduced compatibility with Qiskit 1.0.0. If you are using an older version of `qiskit-qasm3-import` (e.g., <0.6.0) with Qiskit 1.0.0+, you may encounter errors related to API changes or an incompatible `QuantumCircuit` object structure.
fix
Upgrade to `qiskit-qasm3-import>=0.6.0` when using Qiskit 1.0.0 or later: `pip install --upgrade qiskit-qasm3-import`.
affects: <0.6.0
gotchaThe `qiskit-qasm3-import` library does not currently support all features defined by the OpenQASM 3 specification. Complex or less common QASM 3 constructs might lead to parsing errors or incomplete circuit representations.
fix
Refer to the official documentation and GitHub repository for the list of currently supported OpenQASM 3 features. For unsupported features, consider simplifying your QASM 3 code or reporting an issue to the project.
affects: All versions
gotchaThe `loads` function expects a string as input. Providing a file path or an object that is not a string will result in a `TypeError` or a parsing failure.
fix
Ensure that the input to `qiskit_qasm3_import.loads()` is a valid string containing the OpenQASM 3 code. To load from a file, read the file content into a string first (e.g., `with open('my_circuit.qasm', 'r') as f: qasm_str = f.read()`).
affects: All versions
Upgrade
Version history
0.6.0latest on PyPI · released Jun 10, 2025
Audit
Dependencies
qiskitrequiredThis library generates Qiskit circuits and is designed to integrate with the Qiskit ecosystem. Specific versions of `qiskit-qasm3-import` are tied to compatible Qiskit versions.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
qiskit-qasm3-import — pip install qiskit-qasm3-import · libregistry