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

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.
  • 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) for shot sampling.
  • Native QEC programs (QecProgram) with detector and observable sampling.
  • NumPy output for probabilities, statevectors, and QEC bit matrices.

License

MIT OR Apache-2.0

Release files for prism-q 0.32.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.32.0
File Size Uploaded
prism_q-0.32.0.tar.gz 2.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for prism-q 0.32.0
File Interpreter ABI Platform
prism_q-0.32.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
prism_q-0.32.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.32.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details

Total release size: 10.1 MB

Release files / prism_q-0.32.0.tar.gz

Download URL prism_q-0.32.0.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
2b105954580620645a9cd9e7032044226a428e2405e8bf36e7b40b3ae3f5cdba
BLAKE2b-256 checksum
How to use checksums
2d53662a471a06491daffcc86cc598369cb0b7beb1d28efbed7bf8afc4b52a75
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 16, 2026.

Transparency log

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

Download URL prism_q-0.32.0-cp311-abi3-win_amd64.whl
Size 2.9 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c041a8e00038058a66d6c84ca8c8e9690dde671410d2783dda461e1583e223ed
BLAKE2b-256 checksum
How to use checksums
400e660755bebdebc29ee0222a2bea10132635de945377388269521ceeab5368
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 16, 2026.

Transparency log

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

Download URL prism_q-0.32.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a3b5f3feac69e9397b84241b0af483d552f0b3210c91fb989007341928f07c35
BLAKE2b-256 checksum
How to use checksums
0a375a953eec9d769f4d3455a8b1b207d6df41c5c80b9a544cd8aa64fb3137fa
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 16, 2026.

Transparency log

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

Download URL prism_q-0.32.0-cp311-abi3-macosx_11_0_arm64.whl
Size 2.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
43f63654f0cb81fd0383db527c793c619cdf8d82feff89d88a8a57adc3d96853
BLAKE2b-256 checksum
How to use checksums
1a85261d4bf7e0bcb16c4f64392200ac9151657ed9ceaad25e112bc5fce6efd0
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.33.0

4 release files

This release

0.32.0 This release

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