pub struct ForwardCache {
pub rho_before: Vec<Vec<Complex>>,
pub unitaries: Vec<Vec<Complex>>,
pub rho_after: Vec<Vec<Complex>>,
pub populations: Vec<Vec<f32>>,
pub values: Vec<Vec<f32>>,
}Expand description
Stored forward state for one QCT block (needed for backward pass).
Fields§
§rho_before: Vec<Vec<Complex>>Density matrices BEFORE evolve at each token position [T × dim²].
unitaries: Vec<Vec<Complex>>Unitaries computed during forward [T × dim²].
rho_after: Vec<Vec<Complex>>Density matrices AFTER full attention at each position [T × dim²].
populations: Vec<Vec<f32>>Populations from Born measurement [T × dim].
values: Vec<Vec<f32>>Values passed to projection [T × dim].
Auto Trait Implementations§
impl Freeze for ForwardCache
impl RefUnwindSafe for ForwardCache
impl Send for ForwardCache
impl Sync for ForwardCache
impl Unpin for ForwardCache
impl UnsafeUnpin for ForwardCache
impl UnwindSafe for ForwardCache
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> 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