pub struct RankAdaptiveController {
pub tolerance: f64,
pub rank_budget: usize,
pub min_tolerance: f64,
pub max_tolerance: f64,
pub conservation_tight: f64,
pub conservation_loose: f64,
pub tighten_factor: f64,
pub loosen_factor: f64,
pub current_max_rank: usize,
pub budget_saturated: bool,
pub truncation_errors: Vec<f64>,
pub conservation_errors: Vec<(f64, f64, f64)>,
}Expand description
Adaptive rank controller for HT tensor truncation.
Fields§
§tolerance: f64Current truncation tolerance.
rank_budget: usizeMaximum allowed rank (memory budget).
min_tolerance: f64Minimum allowed tolerance (accuracy floor).
max_tolerance: f64Maximum allowed tolerance (compression ceiling).
conservation_tight: f64Conservation error threshold above which rank increases.
conservation_loose: f64Conservation error threshold below which rank can decrease.
tighten_factor: f64Factor by which to tighten tolerance when conservation fails.
loosen_factor: f64Factor by which to loosen tolerance when over-resolving.
current_max_rank: usizeCurrent observed maximum rank across all HT nodes.
budget_saturated: boolWhether rank budget has been hit (budget-driven mode).
truncation_errors: Vec<f64>History of truncation errors for monitoring.
conservation_errors: Vec<(f64, f64, f64)>History of conservation errors for monitoring.
Implementations§
Source§impl RankAdaptiveController
impl RankAdaptiveController
Sourcepub fn new(rank_budget: usize) -> Self
pub fn new(rank_budget: usize) -> Self
Create with default parameters suitable for gravitational dynamics.
Sourcepub fn with_thresholds(
rank_budget: usize,
initial_tolerance: f64,
conservation_tight: f64,
conservation_loose: f64,
) -> Self
pub fn with_thresholds( rank_budget: usize, initial_tolerance: f64, conservation_tight: f64, conservation_loose: f64, ) -> Self
Create with custom conservation thresholds.
Sourcepub fn update(
&mut self,
mass_error: f64,
momentum_error: f64,
energy_error: f64,
max_rank: usize,
truncation_error: f64,
) -> f64
pub fn update( &mut self, mass_error: f64, momentum_error: f64, energy_error: f64, max_rank: usize, truncation_error: f64, ) -> f64
Update the controller after a time step, given conservation errors.
Returns the new truncation tolerance to use for the next step.
§Arguments
mass_error- |ΔM/M| relative mass conservation errormomentum_error- |ΔP/P| relative momentum conservation errorenergy_error- |ΔE/E| relative energy conservation errormax_rank- maximum rank observed across all HT nodes after truncationtruncation_error- Frobenius norm error from the last truncation
Sourcepub fn should_increase_budget(&self) -> bool
pub fn should_increase_budget(&self) -> bool
Recommend whether to increase the rank budget (for checkpoint-and-refine).
Auto Trait Implementations§
impl Freeze for RankAdaptiveController
impl RefUnwindSafe for RankAdaptiveController
impl Send for RankAdaptiveController
impl Sync for RankAdaptiveController
impl Unpin for RankAdaptiveController
impl UnsafeUnpin for RankAdaptiveController
impl UnwindSafe for RankAdaptiveController
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
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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