Expand description
§everett
A clean, zero-dependency statevector quantum simulator.
everett represents the state of n qubits as a complex vector of 2^n
amplitudes and applies gates in place over amplitude index-groups, never by
materializing a 2^n x 2^n matrix. You describe a computation by building a
Circuit, then run it on a backend such as StateVectorBackend.
§Example: a Bell state
use everett::prelude::*;
let mut circuit = Circuit::new(2);
circuit.h(0).cnot(0, 1);
let exec = StateVectorBackend::run(&circuit)?;
let state = exec.state();
assert!((state.probability(0b00) - 0.5).abs() < 1e-12);
assert!((state.probability(0b11) - 0.5).abs() < 1e-12);§Layout
Complex64: the amplitude scalar.State: the statevector and its observables.Gate1,Gate2: gate matrices.Circuit: the fluent builder.StateVectorBackend: the dense execution backend.algorithms: worked, reusable circuits (Bell, GHZ, teleportation, …).
Re-exports§
pub use density::DensityMatrix;pub use noise::NoiseModel;
Modules§
- algorithms
- Worked, reusable circuits.
- density
- The density-matrix state type.
- kernel
- The numerical kernel: in-place gate application over amplitude index-groups.
- noise
- Noise models for the density-matrix backend.
- prelude
- Common imports for everyday use:
use everett::prelude::*;. - qasm
OpenQASM3.0 import/export forcrate::Circuit.
Structs§
- Circuit
- A quantum circuit: an ordered list of
Ops overnqubits and some number of classical bits. - Classical
Bit - The index of a classical bit, used as the destination of a measurement.
- Complex64
- A complex number backed by two
f64components. - Density
Matrix Backend - Simulates a circuit as a density matrix, optionally with noise.
- Density
Matrix Execution - The result of a density-matrix simulation.
- Execution
- The result of running a circuit: the final state and classical register.
- Gate1
- A single-qubit gate: a
2x2complex matrix in row-major order. - Gate2
- A two-qubit gate: a
4x4complex matrix in row-major order. - Pauli
String - A Pauli operator on
nqubits, with an overall+1/-1sign. - QubitId
- The index of a qubit within a register, counting from 0.
- Rng
- A deterministic pseudo-random generator (
xoshiro256++). - Stabilizer
Backend - Simulates a Clifford circuit via a stabilizer tableau.
- Stabilizer
Execution - The result of running a Clifford circuit on the stabilizer backend.
- State
- The pure state of an
n-qubit system: a complex vector of2^namplitudes. - State
Vector Backend - Simulates a circuit by evolving a dense
Stateof2^namplitudes.
Enums§
Traits§
- Backend
- The backend trait that execution targets implement. A target that gates can be applied to and qubits measured from.