pub struct ChainLuOptions {
pub tolerance: f64,
pub max_bond_dim: Option<usize>,
pub normalize_error: bool,
pub factorization: ChainLuFactorization,
}Expand description
Truncation settings for compress_chain_lu_mut and
compress_chain_lu_on_session.
The forward sweep applies a fixed 1e-14 relative pivot cutoff and no
rank cap. The truncation settings below apply only to the backward sweep,
where tolerance and max_bond_dim both limit the retained rank of each bond
and the smaller limit wins. normalize_error selects whether tolerance
is relative to the largest pivot of that bond or absolute.
| Field | Default | Meaning |
|---|---|---|
tolerance | 1e-12 | Pivot threshold; zero selects the 1e-14 relative floor |
max_bond_dim | None | Positive cap on each internal bond, or uncapped |
normalize_error | true | Relative (true) or absolute (false) tolerance |
factorization | RrLu | Pivoted factorization at each bond |
Start with the defaults. Larger tolerances can retain fewer pivots, but a local pivot threshold does not bound the approximation error of the chain.
§Examples
use tensor4all_core::{ChainLuFactorization, ChainLuOptions};
let options = ChainLuOptions {
tolerance: 1e-8,
max_bond_dim: Some(16),
..ChainLuOptions::default()
};
assert!(options.normalize_error);
assert_eq!(options.factorization, ChainLuFactorization::RrLu);Fields§
§tolerance: f64Finite nonnegative pivot threshold for the backward sweep. Zero selects
the 1e-14 relative floor regardless of normalize_error.
max_bond_dim: Option<usize>Positive cap on each internal bond in the backward sweep. None leaves
the rank limited only by tolerance.
normalize_error: boolWhether a positive tolerance is relative to the largest pivot of each
bond (true) or an absolute pivot threshold (false).
factorization: ChainLuFactorizationPivoted factorization applied at each bond.
Trait Implementations§
Source§impl Clone for ChainLuOptions
impl Clone for ChainLuOptions
impl Copy for ChainLuOptions
Source§impl Debug for ChainLuOptions
impl Debug for ChainLuOptions
Source§impl Default for ChainLuOptions
impl Default for ChainLuOptions
Source§impl PartialEq for ChainLuOptions
impl PartialEq for ChainLuOptions
impl StructuralPartialEq for ChainLuOptions
Auto Trait Implementations§
impl Freeze for ChainLuOptions
impl RefUnwindSafe for ChainLuOptions
impl Send for ChainLuOptions
impl Sync for ChainLuOptions
impl Unpin for ChainLuOptions
impl UnsafeUnpin for ChainLuOptions
impl UnwindSafe for ChainLuOptions
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
U: Sized,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreimpl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
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