Skip to main content

RankAdaptiveController

Struct RankAdaptiveController 

Source
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: f64

Current truncation tolerance.

§rank_budget: usize

Maximum allowed rank (memory budget).

§min_tolerance: f64

Minimum allowed tolerance (accuracy floor).

§max_tolerance: f64

Maximum allowed tolerance (compression ceiling).

§conservation_tight: f64

Conservation error threshold above which rank increases.

§conservation_loose: f64

Conservation error threshold below which rank can decrease.

§tighten_factor: f64

Factor by which to tighten tolerance when conservation fails.

§loosen_factor: f64

Factor by which to loosen tolerance when over-resolving.

§current_max_rank: usize

Current observed maximum rank across all HT nodes.

§budget_saturated: bool

Whether 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

Source

pub fn new(rank_budget: usize) -> Self

Create with default parameters suitable for gravitational dynamics.

Source

pub fn with_thresholds( rank_budget: usize, initial_tolerance: f64, conservation_tight: f64, conservation_loose: f64, ) -> Self

Create with custom conservation thresholds.

Source

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 error
  • momentum_error - |ΔP/P| relative momentum conservation error
  • energy_error - |ΔE/E| relative energy conservation error
  • max_rank - maximum rank observed across all HT nodes after truncation
  • truncation_error - Frobenius norm error from the last truncation
Source

pub fn should_increase_budget(&self) -> bool

Recommend whether to increase the rank budget (for checkpoint-and-refine).

Source

pub fn summary(&self) -> RankAdaptiveSummary

Get summary statistics for diagnostics.

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

Source§

fn by_ref(&self) -> &T

Source§

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

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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
Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,