Skip to main content

PRISM-Q: performance-first quantum circuit simulator (Python bindings)

Project description

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

Project details


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.26.0.tar.gz (1.5 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.26.0-cp311-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

prism_q-0.26.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

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

prism_q-0.26.0-cp311-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for prism_q-0.26.0.tar.gz
Algorithm Hash digest
SHA256 2e3f18695f00a33a474afd29dc6878a6d1e95c4f8705e1297c35957b63997e9c
MD5 cfeda779706b60c613bd6f473b79ea05
BLAKE2b-256 ecce98d216bb8742c1453a85cc8bd5d3339e60d3148de2d7b88626ab87aa92f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.26.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.26.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: prism_q-0.26.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/6.1.0 CPython/3.13.14

File hashes

Hashes for prism_q-0.26.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 56ec6148a15f2af64836d0ea75463a9cf2af55f8775578c687fc92579d358e32
MD5 94e32eb977bd5e9ba59071c476e7422e
BLAKE2b-256 683826630b860ee574e07b0a523938861778bc4f0c4ac572c0ad3fa73b85d8f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.26.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.26.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for prism_q-0.26.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4aad72a6df902658f644596f8dcbed75bdc6014e643b3b2c7a2abbb6801afed
MD5 8a2dbe2b1d12a22a42c6bad6fd577523
BLAKE2b-256 2053fd9082c7b26673be175745b1f252cc2b175fdaddf273ed17e3a4883ca852

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.26.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.26.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for prism_q-0.26.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e43f21c619241b2d4729102ee513ed068faca37e00533da81dc2e2591062ff86
MD5 50b92c4d4a629ee2a175afe80f7ae314
BLAKE2b-256 7dc180717388679125d266b3dfc1617d2460c60a8df3995831965483e03ad3b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for prism_q-0.26.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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page