Enum roqoqo::RoqoqoError[][src]

pub enum RoqoqoError {
    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,
    },
    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 of UnitaryMatrixErrror

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.

QubitMappingError

Error when remapping qubits fails because qubit in operation is not in keys of HashMap/dict.

Fields of QubitMappingError

qubit: usize

Qubit that can not be mapped.

ConversionError

Custom error for failed conversion between enums with the TryFrom trait.

Fields of ConversionError

start_type: &'static str

Type from which should be converted.

end_type: &'static str

Type into which should be converted.

TryFromError

Error using try from

MultiplicationIncompatibleQubits

Custom error for failed multipliction of two gates acting on different qubits.

Fields of MultiplicationIncompatibleQubits

squbit: usize

Self qubit of the operation on the left hand.

oqubit: usize

Other qubit of the operation on the right hand.

PauliProductExceedsQubits

Error adding a PauliProduct involving qubits larger than number of qubit to measurement input.

Fields of PauliProductExceedsQubits

pp_qubit: usize

Qubit involved in Pauli product.

number_qubits: usize

Number of qubits in measurement.

MismatchedOperatorDimension

Error when adding a new operator to expectation values.

Fields of MismatchedOperatorDimension

index: (usize, usize)

Index not matching dimensions.

number_qubits: usize

Number of qubits in measurement.

MismatchedRegisterDimension

Error when a complex register does not correspond to the expected dimension for cheated measurement.

Fields of MismatchedRegisterDimension

dim: usize

Index not matching dimensions.

number_qubits: usize

Number of qubits in measurement.

ExpValUsedTwice

Error adding an expectation value, name of expectation value already take.

Fields of ExpValUsedTwice

name: String

Name of the expecataion value missing.

MissingRegister

Expected register is missing from the Output registers.

Fields of MissingRegister

name: String

Name of the missing register.

BasisRotationMeasurementError

Error occured in basis rotation measurement.

Fields of BasisRotationMeasurementError

msg: String

Error message.

CalculatorError(CalculatorError)

Transparent propagation of CalculatorError.

Tuple Fields of CalculatorError

0: CalculatorError

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.