pub struct BatchEvalCache { /* private fields */ }Expand description
Cache for batch evaluation results in VQE optimization loops.
Optimized for scenarios where the same expression is evaluated many times with slightly different parameter sets (e.g., parameter sweeps).
Implementations§
Source§impl BatchEvalCache
impl BatchEvalCache
Sourcepub fn with_capacity(max_expressions: usize, max_params_per_expr: usize) -> Self
pub fn with_capacity(max_expressions: usize, max_params_per_expr: usize) -> Self
Create a new batch evaluation cache with specified capacities
Sourcepub fn get_or_compute_batch<F>(
&self,
expr_hash: u64,
param_hashes: &[u64],
compute: F,
) -> Vec<f64>
pub fn get_or_compute_batch<F>( &self, expr_hash: u64, param_hashes: &[u64], compute: F, ) -> Vec<f64>
Get or compute a batch of evaluation results
Sourcepub fn total_params_cached(&self) -> usize
pub fn total_params_cached(&self) -> usize
Get total number of cached parameter sets across all expressions
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BatchEvalCache
impl !RefUnwindSafe for BatchEvalCache
impl Send for BatchEvalCache
impl Sync for BatchEvalCache
impl Unpin for BatchEvalCache
impl UnwindSafe for BatchEvalCache
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