Skip to content

API Reference

Each page is a guide to one module: what it does in plain words, a QASM example run through the real parser, then the reference generated from the package's own docstrings via mkdocstrings, so the reference can't drift out of sync with the code.

Driving these modules without writing Python: the Composer kernel runs the same modules from a browser (Composer) or from an MCP-aware agent (MCP Server, 32 tools — Claude Code, Claude Desktop, ...). Both call the exact same kernel, not a separate reimplementation.

Simulators and circuits

Module What it's for
Simulator Core dense statevector engine (DenseSVSimulator)
MPS Simulator Matrix-product-state engine for low-entanglement circuits at scale
Chunk Anti-OOM statevector chunking, including distributed multi-device dispatch
QASM Parser OpenQASM 2.0 / 3.0 parsing, including user-defined gate definitions
Compiler Circuit transpilation (QuantumTranspiler)
Registry Hardware detection: how many qubits this machine can safely simulate
Precision 64-bit JAX precision: automatic ensure_x64, set_precision, with_x64
Gates Gate matrix tables (GATES, PARAMETRIC_GATES, GATE_IDS)
Topology Entangling-layer patterns for variational circuits
States Common state-preparation circuits (GHZ, ...)
QFT Quantum Fourier Transform circuit
Arithmetic Register adders, subtractors, comparators, modular add / multiply / power
Postselection Keep only the runs where a qubit lands in a chosen state
Random Circuit Random valid circuits for benchmarking and fuzz-testing
Drawing Plain-text circuit diagrams
Diagram Quirk-style box diagrams (plot_circuit)
Interop Qiskit / PennyLane bridges

Measurement, noise and mitigation

Module What it's for
Observables Pauli-string expectation values and Pauli-sum Hamiltonians
Measurement Shot sampling and pure-state fidelity
Spectral exp(-iHt) and other matrix functions with correct gradients at exact degeneracy
Entropy Multi-qubit partial trace, von Neumann entropy, mutual information
Noise NoiseModel Kraus channels, density-matrix channels, time-varying noise
Mitigation Zero-Noise Extrapolation (scalar, density-matrix, single-qubit Bloch vector), shot allocation, density-matrix diagnostics
Healing Predictive-healing primitives
QEC Erasure-aware stabilizer decoding, MWPM, syndrome-based noise estimation
Cryptography Protocols BB84, device-independent QKD and conference key agreement (crypto-q)

Chemistry and materials

Module What it's for
Autodiff Differentiable circuit-to-energy pipeline for VQE
UCCSD Native excitation circuits for the UCCSD ansatz
Trotter Real-time Hamiltonian evolution as an actual gate circuit
Fermions Majorana-fermion → qubit (Jordan-Wigner) mapping
Native Hartree-Fock From-scratch JAX/Obara-Saika Hartree-Fock, with libcint integrals on Windows, macOS and Linux
QM/MM Region partitioning, embedding, Hellmann-Feynman forces, molecular dynamics
Harrison Tight-Binding Universal (materials-independent) sp3 tight-binding Hamiltonians
VHD Tight-Binding Material-specific sp3s* tight-binding, validated against real GaAs/Si/Ge gaps
Mass Decomposition Molecular formulas and neutral losses from mass-spectrometry peaks

Tools built on the library

These live under tools/, not inside the dense_evolution package: the vector-healing, adversarial-attack and retrieval utilities (ia_utils) and the Composer kernel (dashboard_core) behind the Composer, the MCP server and the Streamlit Dashboard.

Module What it's for
IA Utils — Vector Healing Repair corrupted steps in a vector sequence (VQE iterations, MD steps, embeddings)
IA Utils — Adversarial Vector Attack Adversarial tests of vector healing's dynamics-versus-noise decision
IA Utils — Hybrid Retrieval (RAG) Hybrid keyword + embedding passage retrieval over a document collection
Dashboard Core — Engine Runs the actual DenseSVSimulator circuits for the dashboard
Dashboard Core — Wormhole SYK traversable-wormhole-inspired teleportation
Dashboard Core — VQE VQE ansatz circuits generated for molecular Hamiltonians
Dashboard Core — Hamiltonians Molecular Hamiltonians built on demand from atomic geometry
Dashboard Core — QM/MM Backward-compatible re-export of dense_evolution.qmmm
Dashboard Core — Mitigation ZNE panel wired to the engine and its noise channels
Dashboard Core — Vector Healing Predictive-healing pass over a noisy vector sequence
Dashboard Core — QASM Library Standard OpenQASM 2.0 presets (Bell pair, GHZ, W-state, ...)
Dashboard Core — System Limits Per-machine qubit limits from available RAM
Dashboard Core — Circuit Diagram Native matplotlib circuit diagrams
Dashboard Core — State Visuals Histogram, Q-sphere, per-qubit Bloch spheres
Dashboard Core — Visuals Native matplotlib visualizations used across the dashboard
Dashboard Core — Graphical Builder Converts drag-and-drop builder ops into gate tuples
Dashboard Core — Circuit Builder Component Drag-and-drop circuit builder component