Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qasm2python-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

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

Hashes for qasm2python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 91cda3e9ea7360bc7fa6ed8f7803fe4f07d7c4797273f9456607220d343a449b
MD5 6e0981834a2470710007053d39b1c58b
BLAKE2b-256 2c13b15445a7233ee3a71c379c993dbf31d9ca8b7d0f35659d7fcd283e22e2f8

See more details on using hashes here.

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

Hashes for qasm2python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a8d536a274649281e4a8fd846503f47679eb40781cefd00549b20735d78fe9b
MD5 1cbc471cd83673d92bf961971a9c0ca2
BLAKE2b-256 be502e4d454a2c37510bd373f7366b8635257f8055cfcab42771bd0934a1d208

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page