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, ...).
  • 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prism_q-0.28.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

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

prism_q-0.28.0-cp311-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

prism_q-0.28.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

prism_q-0.28.0-cp311-abi3-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file prism_q-0.28.0.tar.gz.

File metadata

  • Download URL: prism_q-0.28.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prism_q-0.28.0.tar.gz
Algorithm Hash digest
SHA256 23fe509504be85177bf20fdd61fdeaa46b42e3785b19b78bac5d1e649ec72f1b
MD5 3d39b30e609c6fd739885f30693f69a8
BLAKE2b-256 d462b6372dd8b8acabb1481cb7972630f0e55efa6c50e3d166011a854ab7dd77

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.28.0.tar.gz:

Publisher: python.yml on AbeCoull/prism-q

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prism_q-0.28.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: prism_q-0.28.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prism_q-0.28.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6b682212484fbf3f0f4c1ca38363cd33e7cb7a12bcfde9ff1a9225e0c9d6e0e1
MD5 9a00e53567ae0e16c00a67473b86f679
BLAKE2b-256 09adf322de3753bc28dddee14eb5832681663c436f6e957a13f7fedd4d6157e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.28.0-cp311-abi3-win_amd64.whl:

Publisher: python.yml on AbeCoull/prism-q

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prism_q-0.28.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for prism_q-0.28.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b2dc8ba2ef64e08437c186c1acb3048663e4880a23e1b2a460a21e26bbf247e4
MD5 6817f184bfbbd88c19ce45894fc99ae9
BLAKE2b-256 070a6cd3174b7c4275c9f962c4766008098fa89e75880b5be468c064ded10feb

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.28.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python.yml on AbeCoull/prism-q

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prism_q-0.28.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for prism_q-0.28.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 91a752392d04d6dcf6fa880f5a4bd48e47b4af4531f27ceacf7393a6222549e6
MD5 719140411a6345dcd390abc8c34129ce
BLAKE2b-256 498d339ce4283dc6b28a9e336ea58cf231ddd080ee406d2219663aea66e56298

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.28.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: python.yml on AbeCoull/prism-q

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.31.0

4 files

0.30.0

4 files

0.29.0

4 files

This release

0.28.0 This release

4 files

0.27.0

4 files

0.26.0

4 files

0.25.0

4 files

0.24.0

4 files

0.23.0

4 files

0.22.1

4 files

0.22.0

4 files

0.21.1

4 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