#[non_exhaustive]pub enum BloqValidationError {
Show 48 variants
DetectorBundle(DetectorBundleError),
UnavailableDetectorBundleOwner {
node: BloqNodeId,
instance: TemplateInstanceId,
},
DetectorBundleLoopStateUnsupported {
bundle: DetectorBundleId,
state: LoopStateId,
},
UnknownDetectorBundleTemplate {
bundle: DetectorBundleId,
template: TemplateId,
},
BooleanResource(BooleanResourceError),
FutureMeasurement {
node: BloqNodeId,
owner: BloqNodeId,
measurement: u32,
},
UnorderedNodeMeasurement {
node: BloqNodeId,
owner: BloqNodeId,
measurement: u32,
},
UnknownTemplate {
node: BloqNodeId,
template: TemplateId,
},
UnknownPipePaddingTemplate {
template: TemplateId,
},
PipePaddingOneRoundLooped {
template: TemplateId,
},
PipePaddingLoopedMalformed {
template: TemplateId,
},
DuplicateTemplateInstance {
instance: TemplateInstanceId,
},
UnknownTemplateInstance {
node: BloqNodeId,
instance: TemplateInstanceId,
},
LogicalInputUnknownInstance {
port: IVec3,
instance: TemplateInstanceId,
},
LogicalOutputUnknownInstance {
port: IVec3,
instance: TemplateInstanceId,
},
UnknownInstanceMeasurement {
node: BloqNodeId,
instance: TemplateInstanceId,
measurement: u32,
},
UnknownTemplateBody {
template: TemplateId,
body: BodyId,
},
UnknownTemplateMeasurement {
template: TemplateId,
measurement: u32,
},
UnknownTemplateLoopState {
template: TemplateId,
state: LoopStateId,
},
NodeLoopStateUnsupported {
node: BloqNodeId,
state: LoopStateId,
},
DuplicateTemplateLoopState {
template: TemplateId,
state: LoopStateId,
},
InvalidInstanceMergeStructure {
node: BloqNodeId,
source: NodeTemplateInstanceMergeError,
},
InvalidTemplateCircuit {
template: TemplateId,
source: NodeTemplateInstanceMergeError,
},
DuplicateValueSlot {
node: BloqNodeId,
slot: u32,
},
QuantumEdgeFanout {
node: BloqNodeId,
},
MissingRegionSelectorInput {
node: BloqNodeId,
slot: u32,
},
CyclicGraph,
MissingClassicalInput {
node: BloqNodeId,
slot: u32,
},
UnusedClassicalInput {
node: BloqNodeId,
slot: u32,
},
DiscardInsideRepeatUntilSuccess {
node: BloqNodeId,
},
NestedRepeatUntilSuccess {
node: BloqNodeId,
},
DuplicateObservableIndex {
node: BloqNodeId,
index: u32,
},
RestartOutsideRepeatUntilSuccess {
node: BloqNodeId,
},
OutputFrameNotCompute {
port: IVec3,
node: BloqNodeId,
},
OutputFrameIncomplete {
port: IVec3,
},
UnusedQuantumValueInput {
node: BloqNodeId,
slot: u32,
},
InvalidActivation {
node: BloqNodeId,
rule: &'static str,
reason: &'static str,
},
InvalidSeamGuard {
node: BloqNodeId,
guard: ValueRef,
},
ConditionalReferenceUnavailable {
node: BloqNodeId,
instance: TemplateInstanceId,
},
DuplicateExprInput {
node: BloqNodeId,
slot: u32,
},
InvalidValueProducer {
node: BloqNodeId,
producer: BloqNodeId,
},
InvalidObservableFold {
node: BloqNodeId,
producer: BloqNodeId,
},
DuplicateOutputFrameStamp {
port: IVec3,
},
InvalidRestartSource {
node: BloqNodeId,
restart_source: ValueRef,
},
InvalidValueOutput {
node: BloqNodeId,
},
InvalidBoundaryOutput {
node: BloqNodeId,
},
DuplicateBoundaryOutput {
node: BloqNodeId,
},
InvalidQuantumTimeline {
node: BloqNodeId,
},
}Expand description
A well-formedness violation or resource exhaustion from Bloq::validate.
Well-formedness messages begin with their normative rule id. Resource failures are explicitly identified and can be queried without parsing text.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DetectorBundle(DetectorBundleError)
A detector bundle definition or use is malformed.
A bundle use reads a bound owner after the consumer or without a path.
DetectorBundleLoopStateUnsupported
A bundle parity contains an unresolvable template loop state.
UnknownDetectorBundleTemplate
A bundle signature names a template missing from the pool.
BooleanResource(BooleanResourceError)
Boolean validation exceeded its resource budget.
FutureMeasurement
A node reads a measurement from a later node.
UnorderedNodeMeasurement
A node reads a measurement from an unrelated node.
UnknownTemplate
A node references an absent template.
UnknownPipePaddingTemplate
Pipe padding references an absent template.
Fields
template: TemplateIdMissing template.
PipePaddingOneRoundLooped
A one-round padding template contains a repeat.
Fields
template: TemplateIdInvalid template.
PipePaddingLoopedMalformed
A looped padding template lacks exactly one repeat.
Fields
template: TemplateIdInvalid template.
DuplicateTemplateInstance
A template-instance id is duplicated.
Fields
instance: TemplateInstanceIdDuplicated instance.
UnknownTemplateInstance
A node references an absent instance.
LogicalInputUnknownInstance
A logical input references an absent instance.
LogicalOutputUnknownInstance
A logical output references a missing owner instance.
UnknownInstanceMeasurement
A node parity references an unavailable instance measurement.
UnknownTemplateBody
A template side table references an unreachable body.
UnknownTemplateMeasurement
A template side table references an unavailable measurement.
UnknownTemplateLoopState
A template side table references an unavailable loop state.
NodeLoopStateUnsupported
A node parity contains a template-local loop state.
DuplicateTemplateLoopState
A template declares one loop-state id twice.
InvalidInstanceMergeStructure
A node’s template instances cannot be merged.
InvalidTemplateCircuit
A template circuit is structurally invalid.
Fields
template: TemplateIdInvalid template.
source: NodeTemplateInstanceMergeErrorCircuit failure.
DuplicateValueSlot
A consumer has two producers on one value slot.
QuantumEdgeFanout
A quantum face fans out.
Fields
node: BloqNodeIdFan-out node.
MissingRegionSelectorInput
A region predicate slot has no producer.
CyclicGraph
The graph is cyclic.
MissingClassicalInput
A classical expression slot has no producer.
UnusedClassicalInput
A value edge feeds an unread classical slot.
DiscardInsideRepeatUntilSuccess
A discard occurs inside a retry body.
Fields
node: BloqNodeIdInvalid discard.
NestedRepeatUntilSuccess
A retry region is nested.
Fields
node: BloqNodeIdNested region.
DuplicateObservableIndex
An observable index is duplicated in the program.
RestartOutsideRepeatUntilSuccess
Restart syndromes occur outside a retry body.
Fields
node: BloqNodeIdInvalid quantum node.
OutputFrameNotCompute
An output-frame stamp is not on a top-level compute.
OutputFrameIncomplete
An output lacks one frame basis stamp.
Fields
port: IVec3Incomplete output port.
UnusedQuantumValueInput
A quantum node receives a value edge.
InvalidActivation
A node’s classical activation is invalid.
Unlike its siblings this variant serves several rules — a separate activation slot is WF-11, whole-node activation of a quantum node is WF-12, and the activation’s edge role is WF-16 — so it carries the one it cites rather than hard-coding a prefix.
Fields
node: BloqNodeIdActivated node.
InvalidSeamGuard
A quantum seam guard is invalid.
A selected node may reference a deselected instance.
DuplicateExprInput
A classical expression reads one slot more than once.
InvalidValueProducer
A value edge comes from a node that produces no value.
InvalidObservableFold
An observable-fold edge has invalid endpoint kinds.
DuplicateOutputFrameStamp
An output has two frame stamps for one basis.
Fields
port: IVec3Output port.
InvalidRestartSource
A retry region’s explicit restart source is invalid.
InvalidValueOutput
A declared bit result is invalid.
Fields
node: BloqNodeIdInvalid result node.
InvalidBoundaryOutput
A declared boundary output is invalid.
Fields
node: BloqNodeIdInvalid boundary node.
DuplicateBoundaryOutput
A boundary output is declared twice.
Fields
node: BloqNodeIdDuplicated boundary node.
InvalidQuantumTimeline
A quantum timeline violates its projection contract.
Fields
node: BloqNodeIdInvalid quantum node.
Implementations§
Source§impl BloqValidationError
impl BloqValidationError
Sourcepub fn is_resource_limited(&self) -> bool
pub fn is_resource_limited(&self) -> bool
Whether validation stopped at a resource allowance. Such a failure is not evidence that the program violates the IR’s well-formedness rules.
Trait Implementations§
Source§impl Clone for BloqValidationError
impl Clone for BloqValidationError
Source§fn clone(&self) -> BloqValidationError
fn clone(&self) -> BloqValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BloqValidationError
impl Debug for BloqValidationError
Source§impl Display for BloqValidationError
impl Display for BloqValidationError
impl Eq for BloqValidationError
Source§impl Error for BloqValidationError
impl Error for BloqValidationError
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 From<BloqValidationError> for ProgramSliceError
impl From<BloqValidationError> for ProgramSliceError
Source§fn from(source: BloqValidationError) -> Self
fn from(source: BloqValidationError) -> Self
Source§impl From<BooleanResourceError> for BloqValidationError
impl From<BooleanResourceError> for BloqValidationError
Source§fn from(source: BooleanResourceError) -> Self
fn from(source: BooleanResourceError) -> Self
Source§impl From<DetectorBundleError> for BloqValidationError
impl From<DetectorBundleError> for BloqValidationError
Source§fn from(source: DetectorBundleError) -> Self
fn from(source: DetectorBundleError) -> Self
Source§impl PartialEq for BloqValidationError
impl PartialEq for BloqValidationError
impl StructuralPartialEq for BloqValidationError
Auto Trait Implementations§
impl Freeze for BloqValidationError
impl RefUnwindSafe for BloqValidationError
impl Send for BloqValidationError
impl Sync for BloqValidationError
impl Unpin for BloqValidationError
impl UnsafeUnpin for BloqValidationError
impl UnwindSafe for BloqValidationError
Blanket Implementations§
§impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
fn assign_index(&mut self, index: usize, to: bool)
fn negate_index(&mut self, index: usize)
fn clear_bits(&mut self)
fn assign_random(
&mut self,
bit_count: usize,
random_number_generator: &mut impl RngExt,
)where
BorrowedSelf: BitLength,
§impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
fn assign(&mut self, other: &Other)
fn bitxor_assign(&mut self, other: &Other)
fn bitand_assign(&mut self, other: &Other)
fn bitor_assign(&mut self, other: &Other)
§impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
§impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
fn index(&self, index: usize) -> bool
fn weight(&self) -> usize
fn parity(&self) -> bool
fn is_zero(&self) -> bool
fn is_unit(&self, index: usize) -> bool
fn support<'a>(&'a self) -> impl SortedIteratorwhere
BorrowedSelf: 'a,
fn max_support(&self) -> Option<usize>
fn min_support(&self) -> Option<usize>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.