Skip to main content

QuantBlock

Struct QuantBlock 

Source
pub struct QuantBlock {
    pub encoding: Option<String>,
    pub observable: Option<String>,
    pub qubits: Option<i64>,
    pub depth: Option<i64>,
    pub bandwidth: Option<f64>,
    pub reupload: Option<i64>,
    pub effect: String,
    pub body: Vec<FlowStep>,
    pub loc: Loc,
}
Expand description

§Fase 51.a — the quant cognitive primitive block surface (docs/papers/paper_primitiva_quant.md; enterprise §Fase 51).

quant projects an MEK semantic tensor into a complex Hilbert space, evolves it under a variational / kernel-feature map, and collapses back to classical silicon. The attribute header is OPTIONAL — the bare quant { … } form (the paper’s example) leaves every attribute defaulted. The richer form quant(encoding: amplitude, observable: M, qubits: 10, depth: 4, bandwidth: 0.5, backend: quant_sim) { … } pins the encoding scheme (D2), the Pauli-sum observable (D5), the register width / circuit depth, the projected-kernel bandwidth γ (D7), and the algebraic-effect backend (D1/D9).

§51.a ships the SURFACE only. The Continuous Type Invariant over body (§51.b), the typed continuous grammar incl. typed let + Observable (§51.c), and the quant_sim/qpu_native effect injection + yield measurement point (§51.d) land in subsequent sub-fases.

Fields§

§encoding: Option<String>

encoding:amplitude (default) or angle (shallow). None = the compiler default (amplitude). Carried as the surface spelling; §51.c validates against the closed scheme set.

§observable: Option<String>

observable: — the name of a declared Observable (Pauli-sum, D5). None if unspecified (§51.c resolves + Hermiticity-checks it).

§qubits: Option<i64>

qubits: — the register width n (D = 2ⁿ). None = inferred from the encoded tensor dimensionality. The OSS reference backend caps n ≤ 10 (D1); that bound is enforced at §51.e, not here.

§depth: Option<i64>

depth: — the variational circuit depth L. None = backend default.

§bandwidth: Option<f64>

bandwidth: — the projected-quantum-kernel bandwidth γ (D7). None = backend default.

§reupload: Option<i64>

§Fase 69.c — reupload: L, the number of DATA RE-UPLOADING layers. None or 1 = no re-uploading (the data enters once → a quadratic form, provably classical for amplitude+Pauli, §69.b). L ≥ 2 interleaves the data encoding with entangling layers L times — the ONLY provable escape from the quadratic bound (Havlíček-style; canonical with encoding: angle). The resulting kernel must still pass an Advantage Witness to be deployed claiming advantage (§69.a/b).

§effect: String

The algebraic-effect backend tag: quant_sim (default) or qpu_native (D1/D9). Stored as the bare backend name; §51.d injects the full ots:backend:<tag> effect into the enclosing flow’s effect row.

§body: Vec<FlowStep>

The nested flow-body statements (parsed like par branches, so §51.b can apply the Continuous Type Invariant to real AST). Empty for an empty quant {}.

§loc: Loc

Trait Implementations§

Source§

impl Debug for QuantBlock

Source§

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

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

impl Default for QuantBlock

Source§

fn default() -> QuantBlock

Returns the “default value” for a type. Read more

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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more