SparQ Documentation¶
SparQ is a sparse-state quantum circuit simulator framework with native QRAM support, a register-level programming paradigm, a quantum algorithm library (Grover, Shor, block encoding, Hamiltonian simulation, discrete adiabatic, etc.), and complete Python bindings (pysparq).
Quick Links¶
GitHub repository - source code and issue tracking
QRAM-Simulator repository - the QRAM foundation (referenced by this repository as a submodule)
PyPI -
pip install pysparq
User Guide
- Installation
- Quick Start
- SparQSim Architecture
- Examples
- Algorithm Guide
- Dynamic Operator Extension
- RIR Interpretive Execution
- Core Concepts
- Quantum Algorithm Development Guide
Operator Reference
C++ API Reference
- C++ API Reference
- Core Components and Quantum Gates
- Measurement and Readout
- QRAM Operations
- Quantum Arithmetic and State Organization
- Register/System Operations and Debugging
- Algorithm Library (Top Level)
- Block Encoding (BlockEncoding/)
- Discrete Adiabatic (DiscreteAdiabatic/)
- CUDA Backend
- Python Binding Layer (C++ Side)
Interactive Tutorials
Getting Started¶
Install PySparQ via pip (see installation for building from source):
pip install pysparq
A quick example:
import pysparq as ps
ps.System.clear()
ps.System.add_register("q", ps.UnsignedInteger, 4)
state = ps.SparseState()
ps.Hadamard_Int("q", 4)(state)
print(state)
This declares a register, creates a SparseState in the |0⟩ state, and applies the Hadamard operator. Continue with the Quick Start.