pub struct MatsubaraSamplingPositiveOnly<S: StatisticsType> { /* private fields */ }Expand description
Matsubara sampling for positive frequencies only
Exploits symmetry to reconstruct real coefficients from positive frequencies only. Supports: {0, 1, 2, 3, …} (no negative frequencies)
Implementations§
Source§impl<S: StatisticsType> MatsubaraSamplingPositiveOnly<S>
impl<S: StatisticsType> MatsubaraSamplingPositiveOnly<S>
Sourcepub fn new(basis: &impl Basis<S>) -> Selfwhere
S: 'static,
pub fn new(basis: &impl Basis<S>) -> Selfwhere
S: 'static,
Create Matsubara sampling with default positive-only sampling points
Uses extrema-based sampling point selection (positive frequencies only). Exploits symmetry to reconstruct real coefficients.
Sourcepub fn with_sampling_points(
basis: &impl Basis<S>,
sampling_points: Vec<MatsubaraFreq<S>>,
) -> Selfwhere
S: 'static,
pub fn with_sampling_points(
basis: &impl Basis<S>,
sampling_points: Vec<MatsubaraFreq<S>>,
) -> Selfwhere
S: 'static,
Create Matsubara sampling with custom positive-only sampling points
Sourcepub fn from_matrix(
sampling_points: Vec<MatsubaraFreq<S>>,
matrix: DTensor<Complex<f64>, 2>,
) -> Self
pub fn from_matrix( sampling_points: Vec<MatsubaraFreq<S>>, matrix: DTensor<Complex<f64>, 2>, ) -> Self
Create Matsubara sampling (positive-only) with custom sampling points and pre-computed matrix
This constructor is useful when the sampling matrix is already computed. Uses symmetry to fit real coefficients from complex values at positive frequencies.
§Arguments
sampling_points- Matsubara frequency sampling points (should be positive)matrix- Pre-computed sampling matrix (n_points × basis_size)
§Returns
A new MatsubaraSamplingPositiveOnly object
§Panics
Panics if sampling_points is empty or if matrix dimensions don’t match
Sourcepub fn sampling_points(&self) -> &[MatsubaraFreq<S>]
pub fn sampling_points(&self) -> &[MatsubaraFreq<S>]
Get sampling points
Sourcepub fn n_sampling_points(&self) -> usize
pub fn n_sampling_points(&self) -> usize
Number of sampling points
Sourcepub fn basis_size(&self) -> usize
pub fn basis_size(&self) -> usize
Basis size
Sourcepub fn evaluate(&self, coeffs: &[f64]) -> Vec<Complex<f64>>
pub fn evaluate(&self, coeffs: &[f64]) -> Vec<Complex<f64>>
Evaluate basis coefficients at sampling points
Sourcepub fn fit(&self, values: &[Complex<f64>]) -> Vec<f64>
pub fn fit(&self, values: &[Complex<f64>]) -> Vec<f64>
Fit basis coefficients from values at sampling points
Sourcepub fn evaluate_nd(
&self,
backend: Option<&GemmBackendHandle>,
coeffs: &Tensor<f64, DynRank>,
dim: usize,
) -> Tensor<Complex<f64>, DynRank>
pub fn evaluate_nd( &self, backend: Option<&GemmBackendHandle>, coeffs: &Tensor<f64, DynRank>, dim: usize, ) -> Tensor<Complex<f64>, DynRank>
Sourcepub fn fit_nd(
&self,
backend: Option<&GemmBackendHandle>,
values: &Tensor<Complex<f64>, DynRank>,
dim: usize,
) -> Tensor<f64, DynRank>
pub fn fit_nd( &self, backend: Option<&GemmBackendHandle>, values: &Tensor<Complex<f64>, DynRank>, dim: usize, ) -> Tensor<f64, DynRank>
Fit N-dimensional array of complex values to real basis coefficients
§Arguments
backend- Optional GEMM backend handle (None uses default)values- N-dimensional tensor of complex values at Matsubara frequenciesdim- Dimension along which to fit (must have size = n_sampling_points)
§Returns
N-dimensional tensor of real basis coefficients
Auto Trait Implementations§
impl<S> !Freeze for MatsubaraSamplingPositiveOnly<S>
impl<S> !RefUnwindSafe for MatsubaraSamplingPositiveOnly<S>
impl<S> Send for MatsubaraSamplingPositiveOnly<S>where
S: Send,
impl<S> !Sync for MatsubaraSamplingPositiveOnly<S>
impl<S> Unpin for MatsubaraSamplingPositiveOnly<S>where
S: Unpin,
impl<S> UnwindSafe for MatsubaraSamplingPositiveOnly<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.