pub struct DlrBuilder<S>where
S: StatisticsType,{ /* private fields */ }Expand description
Builder for the independent (interpolative-decomposition) DLR.
use sparse_ir::{DlrBuilder, Fermionic};
let dlr = DlrBuilder::<Fermionic>::new(10.0, 10.0)
.accuracy(1e-10)
.build()
.unwrap();
assert!(!dlr.poles().is_empty());Implementations§
Source§impl<S> DlrBuilder<S>where
S: StatisticsType + 'static,
impl<S> DlrBuilder<S>where
S: StatisticsType + 'static,
Sourcepub const DEFAULT_ACCURACY: f64 = 1e-14
pub const DEFAULT_ACCURACY: f64 = 1e-14
Default target accuracy, 1e-14.
The poles are selected by a pivoted Gram–Schmidt factorization of the
kernel in double precision, whose residuals cannot fall much below
1e-15. An accuracy below about 1e-14 is therefore beyond what the
selection can resolve: it keeps adding near-redundant poles chosen by
rounding, which makes the representation larger and its fits less
accurate. 1e-14 is the tolerance the reference implementations use
at full precision (cppdlr warns below it).
Sourcepub fn new(beta: f64, wmax: f64) -> DlrBuilder<S>
pub fn new(beta: f64, wmax: f64) -> DlrBuilder<S>
Start a DLR for inverse temperature beta and frequency cutoff wmax.
Sourcepub fn accuracy(self, accuracy: f64) -> DlrBuilder<S>
pub fn accuracy(self, accuracy: f64) -> DlrBuilder<S>
Target relative accuracy of the kernel interpolation.
Values below about 1e-14 are beyond double-precision resolution; see
Self::DEFAULT_ACCURACY.
Sourcepub fn max_size(self, max_size: usize) -> DlrBuilder<S>
pub fn max_size(self, max_size: usize) -> DlrBuilder<S>
Upper bound on the number of poles.
Sourcepub fn build(self) -> Result<DiscreteLehmannRepresentation<S>, Error>
pub fn build(self) -> Result<DiscreteLehmannRepresentation<S>, Error>
Select the poles and build the representation.
§Errors
Error::InvalidParameter if beta or wmax is not positive and
finite, the accuracy is not in (0, 1), or max_size is 0.
Trait Implementations§
Source§impl<S> Clone for DlrBuilder<S>where
S: Clone + StatisticsType,
impl<S> Clone for DlrBuilder<S>where
S: Clone + StatisticsType,
Source§fn clone(&self) -> DlrBuilder<S>
fn clone(&self) -> DlrBuilder<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<S> Freeze for DlrBuilder<S>
impl<S> RefUnwindSafe for DlrBuilder<S>where
S: RefUnwindSafe,
impl<S> Send for DlrBuilder<S>where
S: Send,
impl<S> Sync for DlrBuilder<S>where
S: Sync,
impl<S> Unpin for DlrBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for DlrBuilder<S>
impl<S> UnwindSafe for DlrBuilder<S>where
S: UnwindSafe,
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
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> 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, 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 moreimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSendSync for T
impl<T> MaybeSync for Twhere
T: Sync,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.