Expand description
§toroidal-noise
A small Rust crate for single-qubit quantum noise channels and 2×2
density-matrix simulation, including a phenomenological dephasing
parameterization driven by the spectral gap of an n × n discrete-torus
Laplacian.
§Channels
| Function | Parameters | Kraus operators |
|---|---|---|
dephasing(gamma) | gamma ∈ [0, 1] | 2 |
amplitude_damping(gamma) | gamma ∈ [0, 1] | 2 |
depolarizing(p) | p ∈ [0, 1] | 4 (I, X, Y, Z) |
toroidal_dephasing(gamma, n, alpha) | gamma ∈ [0, 1], n >= 2, alpha > 0 | 2 |
Plus utility functions:
spectral_gap(n)—λ₁(n) = 2 − 2cos(2π/n), the smallest non-zero eigenvalue of the cycle-graph Laplacian (also the spectral gap of then × ntorus).effective_gamma(gamma, grid_n, alpha)— the phenomenological mappingγ · λ₁ / (λ₁ + α).
§Status
toroidal_dephasing is a phenomenological model, not a derivation from
physical first principles. It is a thin wrapper that delegates to
dephasing(effective_gamma(γ, n, α)). The mapping is offered as a tunable
parameterization for studying lattice-geometry-dependent dephasing in
simulations; alpha is a knob, not a physically calibrated coupling.
Treat results as exploratory unless you have an independent physical
justification.
The other channels (dephasing, amplitude_damping, depolarizing) are
standard textbook noise channels and have no such caveat.
§Usage
use toroidal_noise::{
apply_channel, apply_unitary, dephasing, effective_gamma,
toroidal_dephasing, HADAMARD, RHO_ZERO,
};
// Start with |+⟩
let rho = apply_unitary(&RHO_ZERO, &HADAMARD);
// Two equivalent ways to apply toroidal-parameterized dephasing:
// 1. Named wrapper
let rho_a = apply_channel(&rho, &toroidal_dephasing(0.5, 12, 1.0));
// 2. Explicit composition (preferred when readers should see the parameterization)
let rho_b = apply_channel(&rho, &dephasing(effective_gamma(0.5, 12, 1.0)));
// Off-diagonal coherence comparable in both
assert!((rho_a[0][1].re - rho_b[0][1].re).abs() < 1e-12);§Math
The discrete n × n torus is the graph product Cₙ □ Cₙ of two cycle
graphs. Eigenvalues of its Laplacian are pairwise sums of cycle-graph
eigenvalues:
λ_{j,k}(n) = (2 − 2cos(2πj/n)) + (2 − 2cos(2πk/n)), 0 ≤ j, k < nThe smallest non-zero eigenvalue, attained at (1, 0) or (0, 1), is
λ₁(n) = 2 − 2cos(2π/n)The library uses this in the saturation:
γ_eff(γ, n, α) = γ · λ₁(n) / (λ₁(n) + α)grid_n | λ₁(n) | γ_eff/γ (α=1) |
|---|---|---|
| 4 | 2.000 | 0.667 |
| 6 | 1.000 | 0.500 |
| 8 | 0.586 | 0.369 |
| 12 | 0.268 | 0.211 |
| 32 | 0.0383 | 0.0369 |
| 64 | 0.00964 | 0.00955 |
§Limitations and caveats
- Phenomenological direction.
γ_eff = γ · λ₁ / (λ₁ + α)reduces dephasing asλ₁ → 0. This direction does not correspond to any particular standard physical mechanism — typical “spectral-gap protection” arguments in many-body physics suppress noise as the gap increases, not as it shrinks. Do not interpret results from this parameterization as a physical prediction without independent justification. - No T₂ / hardware claim. This crate does not derive or claim any hardware T₂-extension figure. If you need such numbers, they must come from a calibrated device model, not from this parameterization.
- Single-qubit channels only. The spectral-gap calculation references
an
n × nlattice geometry, but every channel here acts on a single qubit. There is no multi-qubit lattice noise correlation.
§Related
- A PennyLane-compatible Python sibling is published as
pennylane-toroidal-noise, which delegates toqml.PhaseDamping.
§License
MIT.
Structs§
- Kraus
Operator - A Kraus operator: a 2×2 complex matrix K such that the channel maps ρ → Σᵢ Kᵢ ρ Kᵢ†.
Constants§
Functions§
- amplitude_
damping - Single-qubit amplitude damping channel.
- apply_
channel - Apply a channel (list of Kraus operators) to a 2×2 density matrix: ρ → Σᵢ Kᵢ ρ Kᵢ†
- apply_
unitary - Apply a unitary gate to a density matrix: ρ → U ρ U†
- dephasing
- Single-qubit phase damping channel.
- depolarizing
- Single-qubit symmetric depolarizing channel.
- effective_
gamma - Phenomenological effective dephasing rate from a toroidal lattice spectral gap.
- is_
trace_ preserving - Check if Kraus operators satisfy trace preservation: Σᵢ Kᵢ† Kᵢ = I.
- spectral_
gap - Spectral gap of the cycle graph Cₙ Laplacian.
- toroidal_
dephasing - Single-qubit dephasing parameterized by a toroidal lattice spectral gap.
- trace
- Trace of a 2×2 matrix.
Type Aliases§
- Matrix2x2
- A 2×2 complex matrix stored in row-major order.