pub struct TauSampling<S>where
S: StatisticsType,{ /* private fields */ }Expand description
Sparse sampling in imaginary time
Allows transformation between the IR basis and a set of sampling points in imaginary time (τ).
Implementations§
Source§impl<S> TauSampling<S>where
S: StatisticsType,
impl<S> TauSampling<S>where
S: StatisticsType,
Sourcepub fn new(basis: &impl Basis<S>) -> Selfwhere
S: 'static,
pub fn new(basis: &impl Basis<S>) -> Selfwhere
S: 'static,
Create a new TauSampling with default sampling points
The default sampling points are chosen as the extrema of the highest-order
basis function, which gives near-optimal conditioning.
SVD is computed lazily on first call to fit or fit_nd.
§Arguments
basis- Any basis implementing theBasistrait
§Returns
A new TauSampling object
Sourcepub fn with_sampling_points(
basis: &impl Basis<S>,
sampling_points: Vec<f64>,
) -> Selfwhere
S: 'static,
pub fn with_sampling_points(
basis: &impl Basis<S>,
sampling_points: Vec<f64>,
) -> Selfwhere
S: 'static,
Create a new TauSampling with custom sampling points
SVD is computed lazily on first call to fit or fit_nd.
§Arguments
basis- Any basis implementing theBasistraitsampling_points- Custom sampling points in τ ∈ [-β, β]
§Returns
A new TauSampling object
§Panics
Panics if sampling_points is empty or if any point is outside [-β, β]
Sourcepub fn from_matrix(sampling_points: Vec<f64>, matrix: DTensor<f64, 2>) -> Self
pub fn from_matrix(sampling_points: Vec<f64>, matrix: DTensor<f64, 2>) -> Self
Create a new TauSampling with custom sampling points and pre-computed matrix
This constructor is useful when the sampling matrix is already computed (e.g., from external sources or for testing).
§Arguments
sampling_points- Sampling points in τ ∈ [-β, β]matrix- Pre-computed sampling matrix (n_points × basis_size)
§Returns
A new TauSampling object
§Panics
Panics if sampling_points is empty or if matrix dimensions don’t match
Sourcepub fn sampling_points(&self) -> &[f64]
pub fn sampling_points(&self) -> &[f64]
Get the sampling points
Sourcepub fn n_sampling_points(&self) -> usize
pub fn n_sampling_points(&self) -> usize
Get the number of sampling points
Sourcepub fn basis_size(&self) -> usize
pub fn basis_size(&self) -> usize
Get the basis size
Sourcepub fn evaluate_to(&self, coeffs: &[f64], out: &mut [f64])
pub fn evaluate_to(&self, coeffs: &[f64], out: &mut [f64])
Evaluate basis coefficients at sampling points, writing to output slice
Sourcepub fn fit(&self, values: &[f64]) -> Vec<f64>
pub fn fit(&self, values: &[f64]) -> Vec<f64>
Fit values at sampling points to basis coefficients
Sourcepub fn fit_to(&self, values: &[f64], out: &mut [f64])
pub fn fit_to(&self, values: &[f64], out: &mut [f64])
Fit values at sampling points to basis coefficients, writing to output slice
Sourcepub fn evaluate_zz(&self, coeffs: &[Complex<f64>]) -> Vec<Complex<f64>>
pub fn evaluate_zz(&self, coeffs: &[Complex<f64>]) -> Vec<Complex<f64>>
Evaluate complex basis coefficients at sampling points
Sourcepub fn evaluate_zz_to(&self, coeffs: &[Complex<f64>], out: &mut [Complex<f64>])
pub fn evaluate_zz_to(&self, coeffs: &[Complex<f64>], out: &mut [Complex<f64>])
Evaluate complex basis coefficients, writing to output slice
Sourcepub fn fit_zz(&self, values: &[Complex<f64>]) -> Vec<Complex<f64>>
pub fn fit_zz(&self, values: &[Complex<f64>]) -> Vec<Complex<f64>>
Fit complex values at sampling points to basis coefficients
Sourcepub fn fit_zz_to(&self, values: &[Complex<f64>], out: &mut [Complex<f64>])
pub fn fit_zz_to(&self, values: &[Complex<f64>], out: &mut [Complex<f64>])
Fit complex values, writing to output slice
Sourcepub fn evaluate_nd(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<f64, DynRank>,
dim: usize,
) -> Tensor<f64, DynRank>
pub fn evaluate_nd( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<f64, DynRank>, dim: usize, ) -> Tensor<f64, DynRank>
Sourcepub fn evaluate_nd_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<f64, DynRank>,
dim: usize,
out: &mut ViewMut<'_, f64, DynRank>,
)
pub fn evaluate_nd_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<f64, DynRank>, dim: usize, out: &mut ViewMut<'_, f64, DynRank>, )
Evaluate N-D real coefficients, writing to a mutable view
Sourcepub fn fit_nd(
&self,
backend: Option<&GemmBackendHandle>,
values: &Slice<f64, DynRank>,
dim: usize,
) -> Tensor<f64, DynRank>
pub fn fit_nd( &self, backend: Option<&GemmBackendHandle>, values: &Slice<f64, DynRank>, dim: usize, ) -> Tensor<f64, DynRank>
Sourcepub fn fit_nd_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &Slice<f64, DynRank>,
dim: usize,
out: &mut ViewMut<'_, f64, DynRank>,
)
pub fn fit_nd_to( &self, backend: Option<&GemmBackendHandle>, values: &Slice<f64, DynRank>, dim: usize, out: &mut ViewMut<'_, f64, DynRank>, )
Fit N-D real values, writing to a mutable view
Sourcepub fn evaluate_nd_zz(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<Complex<f64>, DynRank>,
dim: usize,
) -> Tensor<Complex<f64>, DynRank>
pub fn evaluate_nd_zz( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<Complex<f64>, DynRank>, dim: usize, ) -> Tensor<Complex<f64>, DynRank>
Sourcepub fn evaluate_nd_zz_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<Complex<f64>, DynRank>,
dim: usize,
out: &mut ViewMut<'_, Complex<f64>, DynRank>,
)
pub fn evaluate_nd_zz_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<Complex<f64>, DynRank>, dim: usize, out: &mut ViewMut<'_, Complex<f64>, DynRank>, )
Evaluate N-D complex coefficients, writing to a mutable view
Trait Implementations§
Source§impl<S: StatisticsType> InplaceFitter for TauSampling<S>
InplaceFitter implementation for TauSampling
impl<S: StatisticsType> InplaceFitter for TauSampling<S>
InplaceFitter implementation for TauSampling
Delegates to RealMatrixFitter which supports dd and zz operations.
Source§fn basis_size(&self) -> usize
fn basis_size(&self) -> usize
Source§fn evaluate_nd_dd_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<f64, DynRank>,
dim: usize,
out: &mut ViewMut<'_, f64, DynRank>,
) -> bool
fn evaluate_nd_dd_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<f64, DynRank>, dim: usize, out: &mut ViewMut<'_, f64, DynRank>, ) -> bool
Source§fn evaluate_nd_zz_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<Complex<f64>, DynRank>,
dim: usize,
out: &mut ViewMut<'_, Complex<f64>, DynRank>,
) -> bool
fn evaluate_nd_zz_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<Complex<f64>, DynRank>, dim: usize, out: &mut ViewMut<'_, Complex<f64>, DynRank>, ) -> bool
Source§fn fit_nd_dd_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &Slice<f64, DynRank>,
dim: usize,
out: &mut ViewMut<'_, f64, DynRank>,
) -> bool
fn fit_nd_dd_to( &self, backend: Option<&GemmBackendHandle>, values: &Slice<f64, DynRank>, dim: usize, out: &mut ViewMut<'_, f64, DynRank>, ) -> bool
Source§fn fit_nd_zz_to(
&self,
backend: Option<&GemmBackendHandle>,
values: &Slice<Complex<f64>, DynRank>,
dim: usize,
out: &mut ViewMut<'_, Complex<f64>, DynRank>,
) -> bool
fn fit_nd_zz_to( &self, backend: Option<&GemmBackendHandle>, values: &Slice<Complex<f64>, DynRank>, dim: usize, out: &mut ViewMut<'_, Complex<f64>, DynRank>, ) -> bool
Source§fn evaluate_nd_dz_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<f64, DynRank>,
dim: usize,
out: &mut ViewMut<'_, Complex<f64>, DynRank>,
) -> bool
fn evaluate_nd_dz_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<f64, DynRank>, dim: usize, out: &mut ViewMut<'_, Complex<f64>, DynRank>, ) -> bool
Source§fn evaluate_nd_zd_to(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Slice<Complex<f64>, DynRank>,
dim: usize,
out: &mut ViewMut<'_, f64, DynRank>,
) -> bool
fn evaluate_nd_zd_to( &self, backend: Option<&GemmBackendHandle>, coeffs: &Slice<Complex<f64>, DynRank>, dim: usize, out: &mut ViewMut<'_, f64, DynRank>, ) -> bool
Auto Trait Implementations§
impl<S> !Freeze for TauSampling<S>
impl<S> RefUnwindSafe for TauSampling<S>where
S: RefUnwindSafe,
impl<S> Send for TauSampling<S>where
S: Send,
impl<S> Sync for TauSampling<S>where
S: Sync,
impl<S> Unpin for TauSampling<S>where
S: Unpin,
impl<S> UnwindSafe for TauSampling<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
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoCloned<T> for T
impl<T> IntoCloned<T> for 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.