Skip to main content

BloqValidationError

Enum BloqValidationError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

DetectorBundle(DetectorBundleError)

A detector bundle definition or use is malformed.

§

UnavailableDetectorBundleOwner

A bundle use reads a bound owner after the consumer or without a path.

Fields

§node: BloqNodeId

Consumer node.

§instance: TemplateInstanceId

Bound record owner.

§

DetectorBundleLoopStateUnsupported

A bundle parity contains an unresolvable template loop state.

Fields

§bundle: DetectorBundleId

Bundle definition.

§state: LoopStateId

Unresolvable state.

§

UnknownDetectorBundleTemplate

A bundle signature names a template missing from the pool.

Fields

§bundle: DetectorBundleId

Bundle definition.

§template: TemplateId

Missing template.

§

BooleanResource(BooleanResourceError)

Boolean validation exceeded its resource budget.

§

FutureMeasurement

A node reads a measurement from a later node.

Fields

§node: BloqNodeId

Consumer node.

§owner: BloqNodeId

Measurement owner.

§measurement: u32

Owner-local measurement id.

§

UnorderedNodeMeasurement

A node reads a measurement from an unrelated node.

Fields

§node: BloqNodeId

Consumer node.

§owner: BloqNodeId

Measurement owner.

§measurement: u32

Owner-local measurement id.

§

UnknownTemplate

A node references an absent template.

Fields

§node: BloqNodeId

Referencing node.

§template: TemplateId

Missing template.

§

UnknownPipePaddingTemplate

Pipe padding references an absent template.

Fields

§template: TemplateId

Missing template.

§

PipePaddingOneRoundLooped

A one-round padding template contains a repeat.

Fields

§template: TemplateId

Invalid template.

§

PipePaddingLoopedMalformed

A looped padding template lacks exactly one repeat.

Fields

§template: TemplateId

Invalid template.

§

DuplicateTemplateInstance

A template-instance id is duplicated.

Fields

§instance: TemplateInstanceId

Duplicated instance.

§

UnknownTemplateInstance

A node references an absent instance.

Fields

§node: BloqNodeId

Referencing node.

§instance: TemplateInstanceId

Missing instance.

§

LogicalInputUnknownInstance

A logical input references an absent instance.

Fields

§port: IVec3

Source port.

§instance: TemplateInstanceId

Missing instance.

§

LogicalOutputUnknownInstance

A logical output references a missing owner instance.

Fields

§port: IVec3

Source port.

§instance: TemplateInstanceId

Missing instance.

§

UnknownInstanceMeasurement

A node parity references an unavailable instance measurement.

Fields

§node: BloqNodeId

Referencing node.

§instance: TemplateInstanceId

Referenced instance.

§measurement: u32

Missing measurement id.

§

UnknownTemplateBody

A template side table references an unreachable body.

Fields

§template: TemplateId

Referencing template.

§body: BodyId

Missing body.

§

UnknownTemplateMeasurement

A template side table references an unavailable measurement.

Fields

§template: TemplateId

Referencing template.

§measurement: u32

Missing measurement.

§

UnknownTemplateLoopState

A template side table references an unavailable loop state.

Fields

§template: TemplateId

Referencing template.

§state: LoopStateId

Missing loop state.

§

NodeLoopStateUnsupported

A node parity contains a template-local loop state.

Fields

§node: BloqNodeId

Referencing node.

§state: LoopStateId

Unsupported loop state.

§

DuplicateTemplateLoopState

A template declares one loop-state id twice.

Fields

§template: TemplateId

Owning template.

§state: LoopStateId

Duplicated state.

§

InvalidInstanceMergeStructure

A node’s template instances cannot be merged.

Fields

§node: BloqNodeId

Invalid quantum node.

§source: NodeTemplateInstanceMergeError

Merge failure.

§

InvalidTemplateCircuit

A template circuit is structurally invalid.

Fields

§template: TemplateId

Invalid template.

§source: NodeTemplateInstanceMergeError

Circuit failure.

§

DuplicateValueSlot

A consumer has two producers on one value slot.

Fields

§node: BloqNodeId

Consumer node.

§slot: u32

Duplicated slot.

§

QuantumEdgeFanout

A quantum face fans out.

Fields

§node: BloqNodeId

Fan-out node.

§

MissingRegionSelectorInput

A region predicate slot has no producer.

Fields

§node: BloqNodeId

Region node.

§slot: u32

Missing slot.

§

CyclicGraph

The graph is cyclic.

§

MissingClassicalInput

A classical expression slot has no producer.

Fields

§node: BloqNodeId

Consumer node.

§slot: u32

Missing slot.

§

UnusedClassicalInput

A value edge feeds an unread classical slot.

Fields

§node: BloqNodeId

Consumer node.

§slot: u32

Unused slot.

§

DiscardInsideRepeatUntilSuccess

A discard occurs inside a retry body.

Fields

§node: BloqNodeId

Invalid discard.

§

NestedRepeatUntilSuccess

A retry region is nested.

Fields

§node: BloqNodeId

Nested region.

§

DuplicateObservableIndex

An observable index is duplicated in the program.

Fields

§node: BloqNodeId

Duplicate observable node.

§index: u32

Duplicate index.

§

RestartOutsideRepeatUntilSuccess

Restart syndromes occur outside a retry body.

Fields

§node: BloqNodeId

Invalid quantum node.

§

OutputFrameNotCompute

An output-frame stamp is not on a top-level compute.

Fields

§port: IVec3

Output port.

§node: BloqNodeId

Invalid frame node.

§

OutputFrameIncomplete

An output lacks one frame basis stamp.

Fields

§port: IVec3

Incomplete output port.

§

UnusedQuantumValueInput

A quantum node receives a value edge.

Fields

§node: BloqNodeId

Quantum node.

§slot: u32

Invalid input slot.

§

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: BloqNodeId

Activated node.

§rule: &'static str

Normative rule violated.

§reason: &'static str

Contract violation.

§

InvalidSeamGuard

A quantum seam guard is invalid.

Fields

§node: BloqNodeId

Guarded target.

§guard: ValueRef

Invalid guard producer.

§

ConditionalReferenceUnavailable

A selected node may reference a deselected instance.

Fields

§node: BloqNodeId

Referencing node.

§instance: TemplateInstanceId

Conditionally unavailable instance.

§

DuplicateExprInput

A classical expression reads one slot more than once.

Fields

§node: BloqNodeId

Consumer node.

§slot: u32

Repeated slot.

§

InvalidValueProducer

A value edge comes from a node that produces no value.

Fields

§node: BloqNodeId

Consumer node.

§producer: BloqNodeId

Invalid producer.

§

InvalidObservableFold

An observable-fold edge has invalid endpoint kinds.

Fields

§node: BloqNodeId

Consumer node.

§producer: BloqNodeId

Invalid producer.

§

DuplicateOutputFrameStamp

An output has two frame stamps for one basis.

Fields

§port: IVec3

Output port.

§

InvalidRestartSource

A retry region’s explicit restart source is invalid.

Fields

§node: BloqNodeId

Retry region.

§restart_source: ValueRef

Invalid body-local producer.

§

InvalidValueOutput

A declared bit result is invalid.

Fields

§node: BloqNodeId

Invalid result node.

§

InvalidBoundaryOutput

A declared boundary output is invalid.

Fields

§node: BloqNodeId

Invalid boundary node.

§

DuplicateBoundaryOutput

A boundary output is declared twice.

Fields

§node: BloqNodeId

Duplicated boundary node.

§

InvalidQuantumTimeline

A quantum timeline violates its projection contract.

Fields

§node: BloqNodeId

Invalid quantum node.

Implementations§

Source§

impl BloqValidationError

Source

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

Source§

fn clone(&self) -> BloqValidationError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BloqValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for BloqValidationError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for BloqValidationError

Source§

impl Error for BloqValidationError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BloqValidationError> for ProgramSliceError

Source§

fn from(source: BloqValidationError) -> Self

Converts to this type from the input type.
Source§

impl From<BooleanResourceError> for BloqValidationError

Source§

fn from(source: BooleanResourceError) -> Self

Converts to this type from the input type.
Source§

impl From<DetectorBundleError> for BloqValidationError

Source§

fn from(source: DetectorBundleError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BloqValidationError

Source§

fn eq(&self, other: &BloqValidationError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BloqValidationError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
where T: BorrowMut<BorrowedSelf>, BorrowedSelf: BitwiseMut + ?Sized,

§

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
where Bits: BorrowMut<BorrowedSelf> + ?Sized, Other: Borrow<BorrowedOther> + ?Sized, BorrowedSelf: Bitwise + BitwisePairMut<BorrowedOther> + ?Sized, BorrowedOther: Bitwise + ?Sized,

§

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
where T: Borrow<BorrowedSelf> + ?Sized, Other: Borrow<BorrowedOther> + ?Sized, BorrowedSelf: Bitwise + BitwisePair<BorrowedOther> + ?Sized, BorrowedOther: Bitwise + ?Sized,

§

fn dot(&self, other: &Other) -> bool

§

fn and_weight(&self, other: &Other) -> usize

§

fn or_weight(&self, other: &Other) -> usize

§

fn xor_weight(&self, other: &Other) -> usize

§

impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
where T: Borrow<BorrowedSelf>, BorrowedSelf: Bitwise + ?Sized,

§

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 SortedIterator
where BorrowedSelf: 'a,

§

fn max_support(&self) -> Option<usize>

§

fn min_support(&self) -> Option<usize>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.