Enum roqoqo::RoqoqoError
source · pub enum RoqoqoError {
Show 15 variants
UnitaryMatrixErrror {
alpha_r: f64,
alpha_i: f64,
beta_r: f64,
beta_i: f64,
norm: f64,
},
QubitMappingError {
qubit: usize,
},
ConversionError {
start_type: &'static str,
end_type: &'static str,
},
TryFromError,
MultiplicationIncompatibleQubits {
squbit: usize,
oqubit: usize,
},
PauliProductExceedsQubits {
pp_qubit: usize,
number_qubits: usize,
},
MismatchedOperatorDimension {
index: (usize, usize),
number_qubits: usize,
},
MismatchedRegisterDimension {
dim: usize,
number_qubits: usize,
},
ExpValUsedTwice {
name: String,
},
MissingRegister {
name: String,
},
PauliZProductMeasurementError {
msg: String,
},
SerializationError {
msg: String,
},
GenericError {
msg: String,
},
VersionMissmatch {
library_major_version: u32,
library_minor_version: u32,
data_major_version: u32,
data_minor_version: u32,
},
CalculatorError(CalculatorError),
}
Expand description
Errors that can occur in roqoqo.
Variants§
UnitaryMatrixErrror
Error when values of alpha and beta lead to an invalid unitary matrix.
Fields
QubitMappingError
Error when remapping qubits fails because qubit in operation is not in keys of HashMap/dict.
ConversionError
Custom error for failed conversion between enums with the TryFrom trait.
Fields
TryFromError
Error using try from
MultiplicationIncompatibleQubits
Custom error for failed multipliction of two gates acting on different qubits.
Fields
PauliProductExceedsQubits
Error adding a PauliProduct involving qubits larger than number of qubit to measurement input.
Fields
MismatchedOperatorDimension
Error when adding a new operator to expectation values.
Fields
MismatchedRegisterDimension
Error when a complex register does not correspond to the expected dimension for cheated measurement.
Fields
ExpValUsedTwice
Error adding an expectation value, name of expectation value already take.
MissingRegister
Expected register is missing from the Output registers.
PauliZProductMeasurementError
Error occured in basis rotation measurement.
SerializationError
Error serializing an internal roqoqo object
GenericError
Generic error that does not fit in other error categories.
VersionMissmatch
Error when trying to deserialize roqoqo data created with an incompatible version of roqoqo
Fields
CalculatorError(CalculatorError)
Transparent propagation of CalculatorError.
Trait Implementations§
source§impl Debug for RoqoqoError
impl Debug for RoqoqoError
source§impl Display for RoqoqoError
impl Display for RoqoqoError
source§impl Error for RoqoqoError
impl Error for RoqoqoError
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
source§impl From<CalculatorError> for RoqoqoError
impl From<CalculatorError> for RoqoqoError
source§fn from(source: CalculatorError) -> Self
fn from(source: CalculatorError) -> Self
source§impl From<RoqoqoError> for RoqoqoBackendError
impl From<RoqoqoError> for RoqoqoBackendError
source§fn from(source: RoqoqoError) -> Self
fn from(source: RoqoqoError) -> Self
source§impl PartialEq for RoqoqoError
impl PartialEq for RoqoqoError
source§fn eq(&self, other: &RoqoqoError) -> bool
fn eq(&self, other: &RoqoqoError) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for RoqoqoError
Auto Trait Implementations§
impl Freeze for RoqoqoError
impl RefUnwindSafe for RoqoqoError
impl Send for RoqoqoError
impl Sync for RoqoqoError
impl Unpin for RoqoqoError
impl UnwindSafe for RoqoqoError
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
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.