Skip to main content

qirc for Python

Python bindings for qirc, a compiler and state vector simulator for QIR, the LLVM based intermediate representation used by Q#, PyQIR and other quantum toolchains.

pip install qirc
import qirc

source = open("bell.ll").read()

qasm = qirc.compile(source, emit="qasm3", opt=3, gates="rz-sx-cx", coupling="line:4")
counts = qirc.run(source, shots=1000, seed=7)
verdict = qirc.diff(source, opt=3, gates="rz-sx-cx", resynth=4)
report = qirc.cost(source, gates="rz-sx-cx")
energy = qirc.expectation(source, "Z0 Z1 + 0.5 X0")

compile returns the emitted text for any emit kind: qir, qasm3, qasm2, stim, json, ir, circuit, quantikz, svg, cost, check or run. run returns the measurement counts as a dictionary. diff compares the compiled program, or a second program, with the original at -O0 branch by branch and returns "equivalent", "different" or "inconclusive". cost returns the T count, two qubit gates, gates, depth and peak live qubits for every path and for the worst case. expectation returns the exact expectation value of a sum of Pauli strings on the final state, or with a calibration the noisy value averaged over shots when noisy=True, or the zero noise extrapolation when zne=True.

Every function takes the same compiler options as keywords: opt (0 to 3), gates, exclude, resynth, cost, coupling and calibration with the values the command line accepts, and relabel=True, reuse=True or noisy=True. A program that does not compile raises qirc.CompileError with the rendered diagnostics, and warnings are reported through the warnings module.

Metadata

Release files for qirc 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qirc 0.1.1
File Size Uploaded
qirc-0.1.1.tar.gz 209.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for qirc 0.1.1
File
qirc-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
qirc-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
qirc-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
qirc-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details

Total release size: 5.6 MB

Release files / qirc-0.1.1.tar.gz

Download URL qirc-0.1.1.tar.gz
Size 209.3 kB
Tags Source
SHA-256 checksum
How to use checksums
adccfc4193157d25c6764210938a0531f6fe22eee01adcc506b730fc10304d6b
BLAKE2b-256 checksum
How to use checksums
88c7d8f02be1771d7b66cb21bf2a1e202a352cbb8880769042d1877eb989df0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / qirc-0.1.1-cp39-abi3-win_amd64.whl

Download URL qirc-0.1.1-cp39-abi3-win_amd64.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
313ef1602d2965adba999a1faf667e2177a6243fc56a5a3c63d5b408f2950173
BLAKE2b-256 checksum
How to use checksums
9b1637f798f1eb744449b934d54d3fddf9fc77d1b461d2a9a4641fde4c2d0522
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / qirc-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qirc-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bfa6b0c228e2b9f23806b6caa8e4dcd579af1df4ff28c06dda032e693648242b
BLAKE2b-256 checksum
How to use checksums
f51eb699f61a75f7866542e99fcaa708d1efa040cf2b75cf7f770a073d69b3db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / qirc-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL qirc-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
53f813898ca063a45433c73284348b739196001ee46dcbd92459af22592bf23b
BLAKE2b-256 checksum
How to use checksums
a5c2959a6587c2e9ad191da4f3012c3f4f9c0ce6dbcfb234c4dc73893deda931
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / qirc-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL qirc-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.1 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7957eec116d3e3e31eaae2d7e79eed01af0d52f852b512c11072bdd48b222402
BLAKE2b-256 checksum
How to use checksums
e40ee9a1b294f22eb235bae331906e5d83fc2a1e9717742a3d61c0f68f916c74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page