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.1.1.tar.gz
(3.1 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.1.1.tar.gz.
File metadata
- Download URL: qasm2python-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91cda3e9ea7360bc7fa6ed8f7803fe4f07d7c4797273f9456607220d343a449b
|
|
| MD5 |
6e0981834a2470710007053d39b1c58b
|
|
| BLAKE2b-256 |
2c13b15445a7233ee3a71c379c993dbf31d9ca8b7d0f35659d7fcd283e22e2f8
|
File details
Details for the file qasm2python-0.1.1-py3-none-any.whl.
File metadata
- Download URL: qasm2python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 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 |
1a8d536a274649281e4a8fd846503f47679eb40781cefd00549b20735d78fe9b
|
|
| MD5 |
1cbc471cd83673d92bf961971a9c0ca2
|
|
| BLAKE2b-256 |
be502e4d454a2c37510bd373f7366b8635257f8055cfcab42771bd0934a1d208
|