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.35.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.35.0
File Size Uploaded
prism_q-0.35.0.tar.gz 2.9 MB Details

Built distributions (wheels)

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

Total release size: 18.1 MB

Release files / prism_q-0.35.0.tar.gz

Download URL prism_q-0.35.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
0342fc81a1e338845563c3c7f9f095f546e8ed7153a52607525ffac27a1b709b
BLAKE2b-256 checksum
How to use checksums
497ec22ea10a6bf73d4c33151b47485583a51a74a58ec650e818e0282bd617cc
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 Oct 12, 2026.

Transparency log

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

Download URL prism_q-0.35.0-cp311-abi3-win_amd64.whl
Size 4.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7157e3b452f2aaf42701643adb482309ecd9c3f2e8dc81e760c71d3457dd793e
BLAKE2b-256 checksum
How to use checksums
4b0190d4ce1ede0d3a009154500e7991d16b520a76f9709da40919b7f35d6085
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 Oct 12, 2026.

Transparency log

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

Download URL prism_q-0.35.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bb73cc33856e7ba33c56210e2222bb61175e70523bd7bb09284f6f1e89bb13c3
BLAKE2b-256 checksum
How to use checksums
23da833ef6126bdd326058d3bb5d3c15cd18d93237d8939f331a968007c0f9d7
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 Oct 12, 2026.

Transparency log

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

Download URL prism_q-0.35.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.5 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6b5c18fb86e68babad86851bfbabe5d420ec820a8ca30c843a1ae374feae44ae
BLAKE2b-256 checksum
How to use checksums
007a94e63e7a2cad2be034bba141de4608f24e0a4e250da87f3ba3d40081d078
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 Oct 12, 2026.

Transparency log

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

Download URL prism_q-0.35.0-cp311-abi3-macosx_11_0_arm64.whl
Size 3.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9714c4e3f3c750c69f71923eaf5d28fe3df7bdd41bdbb4faafec49ba3be61f72
BLAKE2b-256 checksum
How to use checksums
d0f80d919351125803e0985128f53ca2a4a526991cc5e6126de4d28a3bb09a6f
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.35.0 This release

5 release files

0.33.0

4 release files

0.32.0

4 release files

0.30.0

4 release files

0.29.0

4 release files

0.27.0

4 release files

0.26.0

4 release files

0.25.0

4 release files

0.24.0

4 release files

0.23.0

4 release files

0.22.1

4 release files

0.22.0

4 release files

0.21.1

4 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