Convert OpenQASM 3 to Python Qiskit code dynamically.
Project description
qasm2python
Convert OpenQASM 3 to Python Qiskit code.
Install
pip install qasm2python
Usage
from qasm2python import convert_qasm
qasm = """
OPENQASM 3;
include "stdgates.inc";
qubit[2] q;
h q[0];
cx q[0], q[1];
"""
print(convert_qasm(qasm))
🔧 STEP 6 — Install Locally (Test Before Upload)
Inside project folder:
pip install build
python -m build
Then:
pip install dist/qasm2python-0.1.0-py3-none-any.whl
Test:
from qasm2python import convert_qasm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qasm2python-0.2.0.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qasm2python-0.2.0.tar.gz.
File metadata
- Download URL: qasm2python-0.2.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd30d3d1ef85a516e4820c1c426dd48ae45cf910aa36c88e51912a2c5cf90913
|
|
| MD5 |
f53731f350a7e3f0a3faf0c482d22bc4
|
|
| BLAKE2b-256 |
0802f8afd32cbc4e788dcf6cec05332bef913a1575aae32b284ff08f65d18308
|
File details
Details for the file qasm2python-0.2.0-py3-none-any.whl.
File metadata
- Download URL: qasm2python-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09575521047f7ec1fea6333aec7a974eee0da620cf86fc5f317f4591c88d541a
|
|
| MD5 |
0b83d5f3eab079ca06ce03969a36ef41
|
|
| BLAKE2b-256 |
9654cbcd0c7850ef45723459c5bec91044939536d477fb3029b8374a7d7762ca
|