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
CircuitBuilderand 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prism_q-0.21.1.tar.gz.
File metadata
- Download URL: prism_q-0.21.1.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8983662830b56b5fde4f9c51fadd49639f2360223917d793f78795094626cc3
|
|
| MD5 |
045fe6116d099c1255083ee979c1817b
|
|
| BLAKE2b-256 |
3f179d5082a1e483e3cdda29ad49d2bd8e78b7e52c936d9103e43c55acf5296b
|
Provenance
The following attestation bundles were made for prism_q-0.21.1.tar.gz:
Publisher:
python.yml on AbeCoull/prism-q
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prism_q-0.21.1.tar.gz -
Subject digest:
f8983662830b56b5fde4f9c51fadd49639f2360223917d793f78795094626cc3 - Sigstore transparency entry: 2174085349
- Sigstore integration time:
-
Permalink:
AbeCoull/prism-q@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Branch / Tag:
refs/tags/py-v0.21.1 - Owner: https://github.com/AbeCoull
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file prism_q-0.21.1-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: prism_q-0.21.1-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f65dda857d3821a72d8e027adf619175fffc1b12ff76603b29e666f7eb99f448
|
|
| MD5 |
26dd6a076d52301d7806e4c8bf469e0e
|
|
| BLAKE2b-256 |
38107e77495a0e5f85a29047f15806617a5cd291dc185e6f55e889d1d2beb31b
|
Provenance
The following attestation bundles were made for prism_q-0.21.1-cp311-abi3-win_amd64.whl:
Publisher:
python.yml on AbeCoull/prism-q
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prism_q-0.21.1-cp311-abi3-win_amd64.whl -
Subject digest:
f65dda857d3821a72d8e027adf619175fffc1b12ff76603b29e666f7eb99f448 - Sigstore transparency entry: 2174085433
- Sigstore integration time:
-
Permalink:
AbeCoull/prism-q@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Branch / Tag:
refs/tags/py-v0.21.1 - Owner: https://github.com/AbeCoull
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file prism_q-0.21.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: prism_q-0.21.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
658d6f896fbd4606449cf542d0f284f93b52c531144e294dd9fb72a5e3a8cb02
|
|
| MD5 |
d4dc0d4fa7018951ae72b2196d456740
|
|
| BLAKE2b-256 |
5555a06cdb85fc08080ea8335ac01405f81496653d62c65a4e66e0b94c7f9148
|
Provenance
The following attestation bundles were made for prism_q-0.21.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python.yml on AbeCoull/prism-q
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prism_q-0.21.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
658d6f896fbd4606449cf542d0f284f93b52c531144e294dd9fb72a5e3a8cb02 - Sigstore transparency entry: 2174085401
- Sigstore integration time:
-
Permalink:
AbeCoull/prism-q@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Branch / Tag:
refs/tags/py-v0.21.1 - Owner: https://github.com/AbeCoull
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file prism_q-0.21.1-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: prism_q-0.21.1-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4995747395f50673550dee7e3623af7b1fcf4decdd6961b8d2bf2eafbcebe3ab
|
|
| MD5 |
831a7e3c6c95f7b8e4598b0a8c152303
|
|
| BLAKE2b-256 |
231ff9fdec844c382d4d08d3ac6f8e59f5c20b946256fe631bfa2947732e6cd3
|
Provenance
The following attestation bundles were made for prism_q-0.21.1-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
python.yml on AbeCoull/prism-q
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prism_q-0.21.1-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
4995747395f50673550dee7e3623af7b1fcf4decdd6961b8d2bf2eafbcebe3ab - Sigstore transparency entry: 2174085371
- Sigstore integration time:
-
Permalink:
AbeCoull/prism-q@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Branch / Tag:
refs/tags/py-v0.21.1 - Owner: https://github.com/AbeCoull
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@a2e94e3fd641fc24892dc0272d937be822e81dd7 -
Trigger Event:
push
-
Statement type: