pub enum Error {
QubitIndexOutOfBounds(usize, usize),
InvalidNumQubits(usize),
DuplicateQubitIndices(usize),
ImpossibleProjection {
qubit_index: usize,
desired: bool,
},
QubitCountMismatch {
operation: &'static str,
left: usize,
right: usize,
},
InvalidPermutationLength(usize, usize),
InvalidPermutation(Vec<usize>),
InvalidQubitStateLength(usize, usize),
CannotDiscardQubit(usize),
QasmParsingError(String),
PauliStringParsingError(String),
Io(Error),
}Expand description
Custom error type for StabilizerCHForm operations.
Variants§
QubitIndexOutOfBounds(usize, usize)
Error for invalid qubit index.
InvalidNumQubits(usize)
Error for invalid number of qubits.
DuplicateQubitIndices(usize)
Error for duplicate qubit indices in two-qubit gates.
ImpossibleProjection
Error for impossible projection during measurement.
QubitCountMismatch
Error for mismatched qubit counts in operations involving two states (e.g., inner product).
InvalidPermutationLength(usize, usize)
Error for invalid permutation length.
InvalidPermutation(Vec<usize>)
Error for invalid permutation (not a valid rearrangement).
InvalidQubitStateLength(usize, usize)
Error for invalid qubit state length.
CannotDiscardQubit(usize)
Error for attempting to discard a qubit that cannot be discarded.
QasmParsingError(String)
Error for QASM parsing issues.
PauliStringParsingError(String)
Error for Pauli string parsing issues.
Io(Error)
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more