#[non_exhaustive]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,
},
ExportUnsupported {
index: usize,
reason: String,
},
IncompatibleBackend {
backend: String,
reason: String,
},
StepLimit {
region: String,
max_steps: u64,
},
ResourceLimit(Box<ResourceLimit>),
}Expand description
Top-level error type for PRISM-Q operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse
OpenQASM parse error with source line number.
UnsupportedConstruct
Valid OpenQASM that PRISM-Q does not support. A loop keyword names the entry point that reads it.
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.
ExportUnsupported
Circuit holds an instruction with no OpenQASM 3.0 spelling.
IncompatibleBackend
Incompatible backend for the given circuit.
StepLimit
A shot of a dynamic program ran more blocks than its step bound allows.
region names the loop it was in.
ResourceLimit(Box<ResourceLimit>)
An allocation the run needs is over a memory cap; the numbers are on
ResourceLimit, boxed so the error stays small on every Result.
Trait Implementations§
Source§impl Clone for PrismError
impl Clone for PrismError
Source§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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for PrismError
impl PartialEq for PrismError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more