pub struct SplitOptions {
pub form: CanonicalForm,
pub final_sweep: bool,
/* private fields */
}Expand description
Options for split operations.
§Builder Pattern
use tensor4all_core::SvdTruncationPolicy;
use tensor4all_treetn::{CanonicalForm, SplitOptions};
let options = SplitOptions::default()
.with_max_rank(50)
.with_svd_policy(SvdTruncationPolicy::new(1e-10))
.with_qr_rtol(1e-12)
.with_final_sweep(true);
assert!(matches!(options.form, CanonicalForm::Unitary));
assert_eq!(options.max_rank(), Some(50));
assert_eq!(options.svd_policy(), Some(SvdTruncationPolicy::new(1e-10)));
assert_eq!(options.qr_rtol(), Some(1e-12));
assert!(options.final_sweep);Fields§
§form: CanonicalFormCanonical form / algorithm to use (SVD, QR, etc.)
final_sweep: boolWhether to perform a final sweep for global bond dimension optimization
Implementations§
Source§impl SplitOptions
impl SplitOptions
Sourcepub fn with_max_rank(self, rank: usize) -> Self
pub fn with_max_rank(self, rank: usize) -> Self
Create options with a maximum rank.
Sourcepub fn with_svd_policy(self, policy: SvdTruncationPolicy) -> Self
pub fn with_svd_policy(self, policy: SvdTruncationPolicy) -> Self
Set the SVD truncation policy used when form is unitary/SVD-based.
Sourcepub fn with_qr_rtol(self, rtol: f64) -> Self
pub fn with_qr_rtol(self, rtol: f64) -> Self
Set the QR-specific relative tolerance used when form is QR-based.
Sourcepub fn with_form(self, form: CanonicalForm) -> Self
pub fn with_form(self, form: CanonicalForm) -> Self
Set the canonical form / algorithm.
Sourcepub fn with_final_sweep(self, final_sweep: bool) -> Self
pub fn with_final_sweep(self, final_sweep: bool) -> Self
Enable or disable final sweep for global optimization.
Sourcepub fn svd_policy(&self) -> Option<SvdTruncationPolicy>
pub fn svd_policy(&self) -> Option<SvdTruncationPolicy>
Get the SVD truncation policy.
Trait Implementations§
Source§impl Clone for SplitOptions
impl Clone for SplitOptions
Source§fn clone(&self) -> SplitOptions
fn clone(&self) -> SplitOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SplitOptions
impl Debug for SplitOptions
Source§impl Default for SplitOptions
impl Default for SplitOptions
impl Copy for SplitOptions
Auto Trait Implementations§
impl Freeze for SplitOptions
impl RefUnwindSafe for SplitOptions
impl Send for SplitOptions
impl Sync for SplitOptions
impl Unpin for SplitOptions
impl UnsafeUnpin for SplitOptions
impl UnwindSafe for SplitOptions
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
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 moreSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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