Skip to main content

Crate everett

Crate everett 

Source
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

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
OpenQASM 3.0 import/export for crate::Circuit.

Structs§

Circuit
A quantum circuit: an ordered list of Ops over n qubits and some number of classical bits.
ClassicalBit
The index of a classical bit, used as the destination of a measurement.
Complex64
A complex number backed by two f64 components.
DensityMatrixBackend
Simulates a circuit as a density matrix, optionally with noise.
DensityMatrixExecution
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 2x2 complex matrix in row-major order.
Gate2
A two-qubit gate: a 4x4 complex matrix in row-major order.
PauliString
A Pauli operator on n qubits, with an overall +1/-1 sign.
QubitId
The index of a qubit within a register, counting from 0.
Rng
A deterministic pseudo-random generator (xoshiro256++).
StabilizerBackend
Simulates a Clifford circuit via a stabilizer tableau.
StabilizerExecution
The result of running a Clifford circuit on the stabilizer backend.
State
The pure state of an n-qubit system: a complex vector of 2^n amplitudes.
StateVectorBackend
Simulates a circuit by evolving a dense State of 2^n amplitudes.

Enums§

Error
Errors returned when building or running a circuit.
Op
A single circuit operation.

Traits§

Backend
The backend trait that execution targets implement. A target that gates can be applied to and qubits measured from.

Type Aliases§

Result
A Result whose error is this crate’s Error.