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 simq

Source crate

Contents

simq::core

simq-core

Circuit, QubitId, the Gate trait, builders, parameters, noise types, validation, serialization, visualization

simq::gates

simq-gates

Standard gate library, SIMD kernels, compile-time matrix caches, custom gate support

simq::sim

simq-sim

Simulator, SimulatorConfig, execution engine, gradients, optimizers, VQE/QAOA helpers

simq::state

simq-state

Sparse/dense state vectors, density matrices, measurement, PauliObservable

simq::compiler

simq-compiler

Optimization passes and pipelines

simq::backend

simq-backend

QuantumBackend trait, transpiler, routing, IBM Quantum, local simulator

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.