Expand description
§dreamwell-quantum — Quantum Simulation for Classical Hardware
Implements the formal quantum-simulation spec from QUANTUM.md:
- Density matrices (rho in C^{N x N}, Hermitian, trace-1, positive semidefinite)
- Hamiltonian evolution (U = exp(-iH dt/hbar), applied as rho -> U rho U_dag)
- CPTP quantum channels (dephasing, amplitude damping, depolarization)
- Born rule measurement (p_k = rho_kk, stochastic or deterministic)
- Interference kernels (kappa_{n,ij} in C^3, the decisive coherence test)
- Superposition state machine (Active/Decohering/Superposed/Dormant)
- Decoherence fields (Lindblad kernel exp(-Gamma t) with spatial falloff)
§The Decisive Test (QUANTUM.md S7)
A system is a genuine quantum simulation (not just quantum-inspired) if:
exists n: x_n(rho) != x_n(Delta(rho))
where Delta is the dephasing map that zeros off-diagonal entries.
The ablation_test function verifies this.
§Clean Compute Compliance
- Pre-allocated buffers reused every frame
- No heap allocation in tick/measure/evolve functions
- Deterministic from seed
Modules§
- qft
- Quantum Field Theory Extensions
- toy_
models - Toy models for attention-as-locomotion-decode.
- wave_
animator - ProceduralWaveAnimator — wave-state morph controller.
- wave_
controller - WaveController — wave-based procedural input and locomotion runtime.
Structs§
- Complex
- Complex number z = re + i·im.
- Decoherence
Field - A spatial decoherence field attached to a zone or POI. When the observer enters the field radius, the wave form begins collapsing into the target form at rate gamma.
- Decoherence
State - Tracks the observer’s current decoherence state.
- Density
Matrix5 - 5x5 density matrix for a Hilbert space H = C^5.
- Interference
Kernels - Interference kernel kappa_{n,ij} in C^3 for particle n between modes i and j. Controls how off-diagonal coherence rho_{ij} affects particle geometry.
- Locomotion
Hamiltonian - Locomotion Hamiltonian H_loc = H_bias + H_input + H_couple + H_phase. Generates the unitary U_tick = exp(-i H dt / hbar_eff) each frame.
- Locomotion
Observables - Named class of frame-collapsed decohering player locomotion observables. Each variant computes from the full density matrix. The GPU bridge evaluates the same observables from B(ρ_t). Bounded-error validation compares the two.
- Observable
Decode Contract - Observable Decode Contract — formalizes GPU shaders as constrained decoders.
- Observable
Errors - Per-observable error magnitudes from bounded-error validation.
- Observable
Spec - A single named observable in the decode contract.
- Quantum
Locomotion State - Full quantum locomotion state — wraps density matrix, Hamiltonian, kernels. Satisfies the quantum-simulation spec (QUANTUM.md S11).
- Quantum
State Snapshot - Serializable snapshot of a quantum locomotion state for BLAKE3 attestation. Contains the density matrix populations + coherence magnitude + measured mode.
- Super
Body - SuperBody — the authoritative, collision-safe, deterministic gameplay body.
- Superposition
Observer - Observer that classifies nearby bodies into superposition states based on distance thresholds.
- Wave
Body - WaveBody — the expressive, procedural, observer-facing presentation body.
Enums§
- Decoherence
TagValue - Parsed result from a decoherence PropertyTag string.
- Superposition
State - Superposition state classification for observer-aware systems.
- Wave
Form - The observer’s physical representation form. Transitions between forms are governed by DecoherenceFields on zones.
Functions§
- ablation_
test - Run the decisive ablation test: verify that for at least one particle, the quantum position differs from the dephased (classical) position. Returns the maximum squared displacement difference across all particles. Should be > 0 for a state with nonzero off-diagonal coherence.
- amplitude_
damp - Amplitude damping (T1 relaxation): drains excited states toward ground state |0>.
- dephase
- Partial dephasing: rho -> (1-epsilon) rho + epsilon Delta(rho).
Equivalent to
DensityMatrix5::apply_dephasingbut as a free function. - depolarize
- Depolarizing channel: rho -> (1-p) rho + p I/N. Drives the state toward the maximally mixed state I/5.
- fidelity_
approx - Quantum fidelity between two density matrices: F(rho, sigma). Approximated via population overlap: F ~ (sum_k sqrt(p_k * q_k))^2
- fully_
dephase - Full dephasing: rho -> Delta(rho). Zeros all off-diagonal elements.
- parse_
decoherence_ tag - Parse a decoherence PropertyTag string. Format: “decohere:form[:clip]” or “gamma:rate”
- quantum_
mutual_ information - Quantum mutual information: I(A:B) = S(A) + S(B) - S(AB). Measures total correlations (classical + quantum) between subsystems. Inputs are Von Neumann entropies of subsystem A, B, and joint AB.
- thermal_
relaxation - Thermal relaxation channel: combined T1 (energy) and T2 (dephasing) decay.