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,
},
BasisRotationMeasurementError {
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
Fields
alpha_r: f64
Real part of diagonal element of (not) unitary matrix.
alpha_i: f64
Imaginary part of diagonal element of (not) unitary matrix.
beta_r: f64
Real part of off-diagonal element of (not) unitary matrix.
beta_i: f64
Real part of off-diagonal element of (not) unitary matrix.
norm: f64
Norm of (not) unitary matrix.
Error when values of alpha and beta lead to an invalid unitary matrix.
QubitMappingError
Fields
qubit: usize
Qubit that can not be mapped.
Error when remapping qubits fails because qubit in operation is not in keys of HashMap/dict.
ConversionError
Fields
start_type: &'static str
Type from which should be converted.
end_type: &'static str
Type into which should be converted.
Custom error for failed conversion between enums with the TryFrom trait.
TryFromError
Error using try from
MultiplicationIncompatibleQubits
Fields
squbit: usize
Self qubit of the operation on the left hand.
oqubit: usize
Other qubit of the operation on the right hand.
Custom error for failed multipliction of two gates acting on different qubits.
PauliProductExceedsQubits
Fields
pp_qubit: usize
Qubit involved in Pauli product.
number_qubits: usize
Number of qubits in measurement.
Error adding a PauliProduct involving qubits larger than number of qubit to measurement input.
MismatchedOperatorDimension
Fields
number_qubits: usize
Number of qubits in measurement.
Error when adding a new operator to expectation values.
MismatchedRegisterDimension
Error when a complex register does not correspond to the expected dimension for cheated measurement.
ExpValUsedTwice
Fields
name: String
Name of the expecataion value missing.
Error adding an expectation value, name of expectation value already take.
MissingRegister
Fields
name: String
Name of the missing register.
Expected register is missing from the Output registers.
BasisRotationMeasurementError
Fields
msg: String
Error message.
Error occured in basis rotation measurement.
SerializationError
Fields
msg: String
Error message
Error serializing an internal roqoqo object
GenericError
Fields
msg: String
Generic error message
Generic error that does not fit in other error categories.
VersionMissmatch
Fields
library_major_version: u32
Major version of the library
library_minor_version: u32
Minor version of the library
data_major_version: u32
Major version of the data
data_minor_version: u32
Minor version of the data
Error when trying to deserialize roqoqo data created with an incompatible version of roqoqo
CalculatorError(CalculatorError)
Transparent propagation of CalculatorError.
Trait Implementations
sourceimpl Debug for RoqoqoError
impl Debug for RoqoqoError
sourceimpl Display for RoqoqoError
impl Display for RoqoqoError
sourceimpl Error for RoqoqoError
impl Error for RoqoqoError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<CalculatorError> for RoqoqoError
impl From<CalculatorError> for RoqoqoError
sourcefn from(source: CalculatorError) -> Self
fn from(source: CalculatorError) -> Self
Performs the conversion.
sourceimpl From<RoqoqoError> for RoqoqoBackendError
impl From<RoqoqoError> for RoqoqoBackendError
sourcefn from(source: RoqoqoError) -> Self
fn from(source: RoqoqoError) -> Self
Performs the conversion.
sourceimpl PartialEq<RoqoqoError> for RoqoqoError
impl PartialEq<RoqoqoError> for RoqoqoError
sourcefn eq(&self, other: &RoqoqoError) -> bool
fn eq(&self, other: &RoqoqoError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RoqoqoError) -> bool
fn ne(&self, other: &RoqoqoError) -> bool
This method tests for !=
.
impl StructuralPartialEq for RoqoqoError
Auto Trait Implementations
impl RefUnwindSafe for RoqoqoError
impl Send for RoqoqoError
impl Sync for RoqoqoError
impl Unpin for RoqoqoError
impl UnwindSafe for RoqoqoError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.