tileuniverse-quantum
Structured sparse quantum-state representations with GHZ and W-state helpers.
This crate is not a general-purpose quantum circuit simulator. It stores compact representations for state families whose nonzero amplitudes are already known.
Key Insight
GHZ state |GHZ_n> = (|00...0> + |11...1>)/sqrt(2) has exactly 2 non-zero amplitudes regardless of n. Store only those two amplitudes; the qubit count is metadata.
use *;
// Fixed endpoint-block memory for this concrete usize qubit count.
let ghz = new;
let v = ghz.verify;
assert!;
State Types
| Struct | Count Representation | Use Case |
|---|---|---|
MinimalGhzState |
usize |
Fixed-size endpoint GHZ representation |
UnlimitedGhzState |
Materialized BigUint |
Endpoint GHZ representation with large integer labels |
SymbolicGhzState |
Symbolic labels | Graham's number, TREE(3), and formal infinity labels |
SparseQuantumGridVec |
usize |
Materialized W-state excitation amplitudes with O(n) memory |
W-State Example
use SparseQuantumGridVec;
// W-states materialize one amplitude per excitation position: O(n), not O(2^n).
let grid = new;
assert_eq!;
Symbolic Example
use *;
// Graham's number as a symbolic qubit-count label.
let ghz = graham;
let v = ghz.verify;
assert!;
assert_eq!;
Installation
Add to your Cargo.toml:
[]
= "0.1"
Features
- GHZ endpoint states: fixed endpoint-block storage for
usize,BigUint, and symbolic labels - W-states: O(n) memory for materialized n-qubit W-states via sparse block grid (BLOCK_SIZE=128)
- Symbolic labels: qubit counts as symbolic expressions (Graham's number, TREE(3), Knuth up-arrow, tetration, BigUint, and formal infinity labels)
- Dicke states: Generalized states with k excitations among n qubits
- Symbolic amplitudes/fractions: Algebraic verification of probabilities, entropy, binomial coefficients
- Parallel verification: Rayon-accelerated doctest examples
Doctests
All public API includes runnable doctests:
License
MIT