Skip to main content

PRISM-Q (Python)

Python bindings for PRISM-Q, a performance-first quantum circuit simulator written in Rust.

Install

pip install prism-q

The Linux and Windows wheels include the CUDA backends. They need an NVIDIA driver and NVRTC, which the cuda12 extra installs:

pip install "prism-q[cuda12]"

prism_q.gpu_info() reports the device, or why it cannot be used.

Quick start

import prism_q

# Build a Bell state and run it.
circuit = prism_q.CircuitBuilder(2).h(0).cx(0, 1).build()
outcome = prism_q.simulate(circuit).seed(42).run()
print(outcome.probabilities)        # array([0.5, 0., 0., 0.5])

# Parse OpenQASM and sample shots.
qasm = """
OPENQASM 3.0;
qubit[2] q;
bit[2] c;
h q[0];
cx q[0], q[1];
c = measure q;
"""
result = prism_q.simulate(prism_q.parse_qasm(qasm)).seed(7).shots(1000)
print(result.counts())              # {'00': ~500, '11': ~500}

# Exact statevector as a NumPy array.
sv = prism_q.simulate(prism_q.circuits.ghz(3)).seed(1).state_vector()
print(sv.dtype, sv.shape)           # complex128 (8,)

Bit ordering

Count keys and measurement bit indices are LSB-first: in a bitstring key, the leftmost character is classical bit 0, and q[0] is the least-significant qubit. This is reversed relative to Qiskit. For example, the state where only q[0] is set reads as "10...", not "...01".

Features

  • Fluent CircuitBuilder and OpenQASM 3.0 parsing.
  • Classical control on measured bits (ClassicalCondition, guarded with an else branch) and measurement in a Pauli basis or of a Pauli product.
  • OpenQASM 3.0 export (Circuit.to_qasm) and text, SVG, and Jupyter circuit drawing.
  • Reusable circuit generators (prism_q.circuits): QFT, GHZ, QAOA, hardware-efficient ansatz, quantum volume, and more.
  • Backend selection via BackendKind (statevector, stabilizer, sparse, MPS, Pauli propagation, ...).
  • Parameter sweeps without a rebuild (Parameters, PreparedCircuit) plus adjoint gradients.
  • Noise models (NoiseModel, NoiseChannel, two-qubit Kraus channels included) for shot sampling.
  • Compiled Clifford samplers (CompiledSampler) with streamed marginals, parities, and correlators, plus analytic noisy marginals (noisy_marginals_analytical).
  • Native QEC programs (QecProgram) with detector and observable sampling and feed-forward corrections.
  • NumPy output for probabilities, statevectors, and QEC bit matrices.
  • Pickling for circuits, parameters, noise models, and QEC programs, so they cross multiprocessing, Ray, and Dask boundaries.

License

MIT OR Apache-2.0

Metadata

Release files for prism-q 0.36.0

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

Source distribution (sdist)

Source distribution for prism-q 0.36.0
File Size Uploaded Provenance Actions
prism_q-0.36.0.tar.gz 3.2 MB With provenance Details for prism_q-0.36.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for prism-q 0.36.0
File Actions
prism_q-0.36.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for prism_q-0.36.0-cp311-abi3-win_amd64.whl
prism_q-0.36.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for prism_q-0.36.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
prism_q-0.36.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for prism_q-0.36.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
prism_q-0.36.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for prism_q-0.36.0-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 19.4 MB

Release files / prism_q-0.36.0.tar.gz

Download URL prism_q-0.36.0.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
ae37a2978fcabb7b90de1161e53bc1dc25c7b3bc8841082b8812e9fac3aebc9e
BLAKE2b-256 checksum
How to use checksums
0e6642420496e493c01b4beec970ac33e01e345d1c0652c04dd9ccd79da1108b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / prism_q-0.36.0-cp311-abi3-win_amd64.whl

Download URL prism_q-0.36.0-cp311-abi3-win_amd64.whl
Size 4.7 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
bbd3646a2899dddd6172b18bb8ff2857122346c429d36fe08956b404ceb0ad0e
BLAKE2b-256 checksum
How to use checksums
a7e44d33c0fb5f6bb1812f2228d0292cdada6f4b19074eb66c3e8eca59c0edc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / prism_q-0.36.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL prism_q-0.36.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0eef8085599efcb6981194def7d8f89ae4e689eb241467eea25eb574f8705b10
BLAKE2b-256 checksum
How to use checksums
0f11f9b4af2f9aca0fd33c50371f2b2d72a6a21fc1bacf7c665f4e3b2bb0b70e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / prism_q-0.36.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL prism_q-0.36.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.7 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
eab47d988a862d1355b7aa36b004a6d349c48038e3d6660c697fb3c44c5bfbc0
BLAKE2b-256 checksum
How to use checksums
73f9d8852b35db39daa47c8f083990f1e391ff768b08d8be5ecd2af29b8bcad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Release files / prism_q-0.36.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL prism_q-0.36.0-cp311-abi3-macosx_11_0_arm64.whl
Size 3.3 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
762ca114ec748dacc1983234388015d38a97b550918a4d2d5531344c9c04b7a9
BLAKE2b-256 checksum
How to use checksums
887d2b61807d1b047274572ca7949429469345caea62a51be7b9f058a0f41bc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 27, 2026.

Transparency log

Security for prism-q 0.36.0

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for prism_q-0.36.0.tar.gz

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 Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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