pub enum PrismError {
Parse {
line: usize,
message: String,
},
UnsupportedConstruct {
construct: String,
line: usize,
},
InvalidQubit {
index: usize,
register_size: usize,
},
InvalidClassicalBit {
index: usize,
register_size: usize,
},
GateArity {
gate: String,
expected: usize,
got: usize,
},
BackendUnsupported {
backend: String,
operation: String,
},
InvalidParameter {
message: String,
},
UndefinedRegister {
name: String,
line: usize,
},
IncompatibleBackend {
backend: String,
reason: String,
},
}Expand description
Top-level error type for PRISM-Q operations.
Variants§
Parse
OpenQASM parse error with source line number.
UnsupportedConstruct
Encountered a valid OpenQASM construct that PRISM-Q v0 does not support.
InvalidQubit
Qubit index exceeds register size.
InvalidClassicalBit
Classical bit index exceeds register size.
GateArity
Gate applied to wrong number of qubits.
BackendUnsupported
Backend does not support the requested operation.
InvalidParameter
Invalid gate parameter (e.g., NaN rotation angle).
UndefinedRegister
Reference to a register name that was never declared.
IncompatibleBackend
Incompatible backend for the given circuit.
Trait Implementations§
Source§impl Clone for PrismError
impl Clone for PrismError
Source§fn clone(&self) -> PrismError
fn clone(&self) -> PrismError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrismError
impl Debug for PrismError
Source§impl Display for PrismError
impl Display for PrismError
Source§impl Error for PrismError
impl Error for PrismError
1.30.0 · 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()
Source§impl PartialEq for PrismError
impl PartialEq for PrismError
Source§fn eq(&self, other: &PrismError) -> bool
fn eq(&self, other: &PrismError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PrismError
Auto Trait Implementations§
impl Freeze for PrismError
impl RefUnwindSafe for PrismError
impl Send for PrismError
impl Sync for PrismError
impl Unpin for PrismError
impl UnsafeUnpin for PrismError
impl UnwindSafe for PrismError
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