DiscreteLehmannRepresentation

Struct DiscreteLehmannRepresentation 

Source
pub struct DiscreteLehmannRepresentation<S>
where S: StatisticsType,
{ pub poles: Vec<f64>, pub beta: f64, pub wmax: f64, pub accuracy: f64, pub regularizers: Vec<f64>, /* private fields */ }
Expand description

Discrete Lehmann Representation (DLR)

The DLR is a variant of the IR basis based on a “sketching” of the analytic continuation kernel K. Instead of using singular value expansion, it represents Green’s functions as a linear combination of poles on the real-frequency axis:

G(iν) = Σ_i a[i] * reg[i] / (iν - ω[i])

where:

  • ω[i] are pole positions on the real axis
  • a[i] are expansion coefficients
  • reg[i] are regularization factors (1 for fermions, tanh(βω/2) for bosons)

Note: DLR always uses LogisticKernel-type weights, regardless of the IR basis kernel type.

§Type Parameters

  • S - Statistics type (Fermionic or Bosonic)

Fields§

§poles: Vec<f64>

Pole positions on the real-frequency axis ω ∈ [-ωmax, ωmax]

§beta: f64

Inverse temperature β

§wmax: f64

Maximum frequency ωmax

§accuracy: f64

Accuracy of the representation

§regularizers: Vec<f64>

Regularizers for each pole: regularizer[i] = w(β, ω_i) Always computed using LogisticKernel:

  • Fermionic: regularizer = 1.0
  • Bosonic: regularizer = tanh(β·ω/2)

Implementations§

Source§

impl<S> DiscreteLehmannRepresentation<S>
where S: StatisticsType,

Source

pub fn with_poles<K>(basis: &impl Basis<S, Kernel = K>, poles: Vec<f64>) -> Self
where S: 'static, K: KernelProperties + Clone,

Create DLR from IR basis with custom poles

Note: Always uses LogisticKernel-type weights, regardless of the basis kernel type.

§Arguments
  • basis - The IR basis to construct DLR from
  • poles - Pole positions on the real-frequency axis
§Returns

A new DLR representation

Source

pub fn new<K>(basis: &impl Basis<S, Kernel = K>) -> Self
where S: 'static, K: KernelProperties + Clone,

Create DLR from IR basis with default pole locations

Uses the default omega sampling points from the basis.

§Arguments
  • basis - The IR basis to construct DLR from
§Returns

A new DLR representation with default poles

§Panics

Panics if the number of default poles is less than the basis size. This can happen with certain kernel types (e.g., RegularizedBoseKernel) due to numerical precision limitations in root finding.

Source

pub fn from_ir_nd<T>( &self, backend: Option<&GemmBackendHandle>, gl: &Tensor<T, DynRank>, dim: usize, ) -> Tensor<T, DynRank>
where T: ComplexFloat + ComplexField + From<f64> + Copy + Default + 'static,

Convert IR coefficients to DLR (N-dimensional, generic over real/complex)

§Type Parameters
  • T - Element type (f64 or Complex)
§Arguments
  • gl - IR coefficients as N-D tensor
  • dim - Dimension along which to transform
§Returns

DLR coefficients as N-D tensor

Source

pub fn to_ir_nd<T>( &self, backend: Option<&GemmBackendHandle>, g_dlr: &Tensor<T, DynRank>, dim: usize, ) -> Tensor<T, DynRank>
where T: ComplexFloat + ComplexField + From<f64> + Copy + Default + 'static,

Convert DLR coefficients to IR (N-dimensional, generic over real/complex)

§Type Parameters
  • T - Element type (f64 or Complex)
§Arguments
  • g_dlr - DLR coefficients as N-D tensor
  • dim - Dimension along which to transform
§Returns

IR coefficients as N-D tensor

Trait Implementations§

Source§

impl<S> Basis<S> for DiscreteLehmannRepresentation<S>
where S: StatisticsType + 'static,

Source§

type Kernel = LogisticKernel

Associated kernel type
Source§

fn kernel(&self) -> &Self::Kernel

Get reference to the kernel Read more
Source§

fn beta(&self) -> f64

Inverse temperature β Read more
Source§

fn wmax(&self) -> f64

Maximum frequency ωmax Read more
Source§

fn lambda(&self) -> f64

Kernel parameter Λ = β × ωmax Read more
Source§

fn size(&self) -> usize

Number of basis functions Read more
Source§

fn accuracy(&self) -> f64

Accuracy of the basis Read more
Source§

fn significance(&self) -> Vec<f64>

Significance of each basis function Read more
Source§

fn svals(&self) -> Vec<f64>

Get singular values (non-normalized) Read more
Source§

fn default_tau_sampling_points(&self) -> Vec<f64>

Get default tau sampling points Read more
Source§

fn default_matsubara_sampling_points( &self, _positive_only: bool, ) -> Vec<MatsubaraFreq<S>>

Get default Matsubara sampling points Read more
Source§

fn evaluate_tau(&self, tau: &[f64]) -> DTensor<f64, 2>

Evaluate basis functions at imaginary time points Read more
Source§

fn evaluate_matsubara( &self, freqs: &[MatsubaraFreq<S>], ) -> DTensor<Complex<f64>, 2>

Evaluate basis functions at Matsubara frequencies Read more
Source§

fn evaluate_omega(&self, omega: &[f64]) -> DTensor<f64, 2>

Evaluate spectral basis functions at real frequencies Read more
Source§

fn default_omega_sampling_points(&self) -> Vec<f64>

Get default omega (real frequency) sampling points Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoCloned<T> for T

Source§

fn clone_to(self, target: &mut T)

Moves an existing object or clones from a reference to the target object.
Source§

fn into_cloned(self) -> T

Returns an existing object or a new clone from a reference.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V