#[non_exhaustive]pub enum SimError {
InvalidProbability(f64),
InvalidProbabilityDistribution,
InvalidRotationAngle(f64),
EmptyStateAfterPruning {
epsilon: f64,
},
RankOverflow {
rank: usize,
cap: usize,
},
PostselectImpossible {
outcome: bool,
probability: f64,
},
RepeatedQubit(usize),
NonCommutingControlledPaulis,
InvalidControlledPauli,
NonHermitianPauli,
MissingBatchRecord {
index: usize,
},
QubitIndexOutOfRange {
index: usize,
num_qubits: usize,
},
}Expand description
Errors returned by TableauSimulator operations.
Every variant models a condition the caller can provoke and reasonably
handle; internal invariants (a decomposed net phase that is not real, a
partner label missing from the amplitude map) are enforced with
debug_assert! rather than surfaced here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidProbability(f64)
A probability was NaN or outside the inclusive unit interval.
InvalidProbabilityDistribution
A categorical channel had mismatched alternatives or total mass above one.
InvalidRotationAngle(f64)
A Pauli rotation angle was not finite.
EmptyStateAfterPruning
Pruning removed every amplitude and would produce a zero state.
RankOverflow
A Pauli rotation or measurement pushed the live-label count past the cap.
Stabilizer rank grows by at most a factor of two per T, so this bounds
the exponential blow-up of magic-heavy circuits.
Fields
PostselectImpossible
A forced measurement outcome has (numerically) zero probability, so the requested post-selection is unreachable from the current state.
Fields
RepeatedQubit(usize)
A multi-qubit gate or Clifford support received one qubit more than once.
NonCommutingControlledPaulis
A controlled-Pauli operation requires commuting control and target axes.
InvalidControlledPauli
A controlled Pauli carries a sign or phase this API does not represent:
conditioning on −P is a different operation, not a global phase.
NonHermitianPauli
A measurement or rotation axis has an imaginary coefficient, so it is not an observable.
MissingBatchRecord
A batched conditional Pauli named a measurement its own batch has not produced. Records are indexed from the start of the batch, so this is a malformed instruction stream rather than a state the run reached.
QubitIndexOutOfRange
A read-only observable names a qubit outside the live register.
Trait Implementations§
Source§impl Error for SimError
impl Error for SimError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()