Rust API reference¶
The authoritative Rust API reference is generated by rustdoc from the source. Once published to crates.io it is hosted at docs.rs/simq; until then (and for unreleased changes), build it locally:
cargo doc --workspace --exclude simq-py --no-deps --open
--no-deps keeps the build fast; drop it if you also want docs for
dependencies.
Crate map¶
The umbrella crate simq re-exports everything, module by module:
Module in |
Source crate |
Contents |
|---|---|---|
|
|
|
|
|
Standard gate library, SIMD kernels, compile-time matrix caches, custom gate support |
|
|
|
|
|
Sparse/dense state vectors, density matrices, measurement, |
|
|
Optimization passes and pipelines |
|
|
|
Most-used types at the crate root¶
pub use simq_core::{
Circuit, CircuitBuilder, Complex64, DynamicCircuitBuilder,
Gate, GateOp, QuantumError, QubitId,
};
pub use simq_sim::{
MeasurementCounts, SimulationResult, Simulator,
SimulatorConfig, SimulatorError,
};
pub use simq_state::{Pauli, PauliObservable, PauliString, StateVector};
pub use circuit::QuantumCircuit; // the fluent builder
For typical usage, one import does it all:
use simq::prelude::*;
The prelude additionally pulls in the full standard gate set
(simq_gates::standard::*) and std::sync::Arc.
Doc tests¶
All code examples in rustdoc comments are compiled and run by cargo test
— they double as the API’s regression suite, so trust them as
copy-pasteable.