Skip to main content

sirraya_qutub/
lib.rs

1//! Sirraya QuTub: a quantum circuit and noise simulator.
2//!
3//! # Quickstart
4//!
5//! ```
6//! use sirraya_qutub::{QuantumRegister, create_bell_state};
7//!
8//! # fn main() -> Result<(), String> {
9//! // Build a Bell state (|00> + |11>) / sqrt(2) and inspect it.
10//! let bell = create_bell_state()?;
11//! assert!((bell.fidelity(&bell)? - 1.0).abs() < 1e-9);
12//!
13//! // Or build a register by hand and apply gates directly.
14//! let mut reg = QuantumRegister::new(2)?;
15//! reg.apply_hadamard(0)?;
16//! reg.apply_cnot(0, 1)?;
17//! let outcome = reg.measure_all_qubits()?;
18//! assert_eq!(outcome.len(), 2);
19//! # Ok(())
20//! # }
21//! ```
22//!
23//! # Modules
24//!
25//! - [`complex`]: complex-number arithmetic underlying every amplitude and
26//!   matrix entry.
27//! - [`core`]: pure-state (`QuantumRegister`) and mixed-state/noise
28//!   (`DensityMatrix`) simulation, circuit building, and standard
29//!   algorithm building blocks (Bell/GHZ/W states, QFT, Deutsch-Jozsa,
30//!   Grover).
31//! - [`xeb`]: noise calibrated to published hardware fidelities, validated
32//!   via cross-entropy benchmarking.
33//! - [`reservoir`]: quantum reservoir computing on top of the core
34//!   simulator.
35
36/// Complex-number arithmetic (`Complex`) underlying every amplitude and
37/// matrix entry used throughout this crate.
38pub mod complex;
39
40/// Pure-state (`QuantumRegister`) and mixed-state/noise (`DensityMatrix`)
41/// simulation, the chainable `QuantumCircuit` builder, and standard
42/// algorithm building blocks.
43pub mod core;
44
45/// Quantum reservoir computing (`QuantumReservoir`, `QuantumReservoirComputer`)
46/// built on top of the `core` simulator.
47pub mod reservoir;
48
49/// Hardware-calibrated noise models and cross-entropy benchmarking (XEB).
50pub mod xeb;
51
52pub use complex::Complex;
53pub use core::{
54    create_bell_state, create_ghz_state, create_w_state, inverse_quantum_fourier_transform,
55    quantum_fourier_transform, DensityMatrix, PauliOp, QuantumAlgorithm, QuantumBenchmark,
56    QuantumCircuit, QuantumRegister,
57};
58pub use reservoir::{
59    demonstrate_quantum_reservoir_computing, QuantumReservoir, QuantumReservoirComputer,
60};
61pub use xeb::{cross_entropy_benchmark_fidelity, run_xeb_demo, HardwareCalibration};