Metadata-Version: 2.4
Name: prism-q
Version: 0.25.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Requires-Dist: numpy>=1.23
Summary: PRISM-Q: performance-first quantum circuit simulator (Python bindings)
Keywords: quantum,quantum-computing,quantum-simulator,simulator,openqasm,stabilizer,qec,statevector,simd,gpu
License: MIT OR Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/AbeCoull/prism-q/blob/main/CHANGELOG.md
Project-URL: Documentation, https://abecoull.github.io/prism-q/
Project-URL: Homepage, https://github.com/AbeCoull/prism-q
Project-URL: Repository, https://github.com/AbeCoull/prism-q

# PRISM-Q (Python)

Python bindings for [PRISM-Q](https://github.com/AbeCoull/prism-q), a
performance-first quantum circuit simulator written in Rust.

## Install

```bash
pip install prism-q
```

## Quick start

```python
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

