pub struct QCTBlock {
pub hamiltonian: LearnedHamiltonian,
pub value_weights: Vec<f32>,
}Expand description
A single QCT block: quantum attention + value projection.
Fields§
§hamiltonian: LearnedHamiltonian§value_weights: Vec<f32>Value projection weights [dim × dim]. Maps populations → output features.
Implementations§
Source§impl QCTBlock
impl QCTBlock
pub fn new(dim: usize, seed: u64) -> Self
Sourcepub fn forward(
&self,
states: &[DensityMatrixN],
values: &[Vec<f32>],
) -> (AttentionOutput, Vec<Vec<f32>>)
pub fn forward( &self, states: &[DensityMatrixN], values: &[Vec<f32>], ) -> (AttentionOutput, Vec<Vec<f32>>)
Forward pass through one QCT block. Input: sequence of density matrices + value vectors. Output: updated value vectors (populations-weighted projection).
Sourcepub fn num_params(&self) -> usize
pub fn num_params(&self) -> usize
Number of learnable parameters in this block.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QCTBlock
impl RefUnwindSafe for QCTBlock
impl Send for QCTBlock
impl Sync for QCTBlock
impl Unpin for QCTBlock
impl UnsafeUnpin for QCTBlock
impl UnwindSafe for QCTBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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