HasTruncationParams

Trait HasTruncationParams 

Source
pub trait HasTruncationParams {
    // Required methods
    fn truncation_params(&self) -> &TruncationParams;
    fn truncation_params_mut(&mut self) -> &mut TruncationParams;

    // Provided methods
    fn rtol(&self) -> Option<f64> { ... }
    fn max_rank(&self) -> Option<usize> { ... }
    fn with_rtol(self, rtol: f64) -> Self
       where Self: Sized { ... }
    fn with_max_rank(self, max_rank: usize) -> Self
       where Self: Sized { ... }
    fn with_cutoff(self, cutoff: f64) -> Self
       where Self: Sized { ... }
    fn with_maxdim(self, maxdim: usize) -> Self
       where Self: Sized { ... }
    fn set_cutoff(&mut self, cutoff: f64) { ... }
    fn set_maxdim(&mut self, maxdim: usize) { ... }
}
Expand description

Trait for types that contain truncation parameters.

This trait provides a common interface for accessing and modifying truncation parameters in various options structs.

Required Methods§

Source

fn truncation_params(&self) -> &TruncationParams

Get a reference to the truncation parameters.

Source

fn truncation_params_mut(&mut self) -> &mut TruncationParams

Get a mutable reference to the truncation parameters.

Provided Methods§

Source

fn rtol(&self) -> Option<f64>

Get the rtol value.

Source

fn max_rank(&self) -> Option<usize>

Get the max_rank value.

Source

fn with_rtol(self, rtol: f64) -> Self
where Self: Sized,

Set the rtol value (builder pattern).

Clears any previously set cutoff origin.

Source

fn with_max_rank(self, max_rank: usize) -> Self
where Self: Sized,

Set the max_rank value (builder pattern).

Source

fn with_cutoff(self, cutoff: f64) -> Self
where Self: Sized,

Set cutoff (ITensorMPS.jl convention, builder pattern).

Internally converted to rtol = √cutoff.

Source

fn with_maxdim(self, maxdim: usize) -> Self
where Self: Sized,

Set maxdim (alias for max_rank, builder pattern).

Source

fn set_cutoff(&mut self, cutoff: f64)

Set cutoff via mutable reference.

Source

fn set_maxdim(&mut self, maxdim: usize)

Set maxdim via mutable reference (alias for max_rank).

Implementors§