pub struct MatsubaraFreq<S: StatisticsType> { /* private fields */ }Expand description
Matsubara frequency for a specific statistics type
This represents a Matsubara frequency ω_n = (2n + ζ)π/β where:
- n is the Matsubara index (integer)
- ζ is the statistics parameter (1 for fermionic, 0 for bosonic)
- β is the inverse temperature
The statistics type S is checked at compile time to ensure type safety.
Implementations§
Source§impl<S: StatisticsType> MatsubaraFreq<S>
impl<S: StatisticsType> MatsubaraFreq<S>
Sourcepub fn new(n: i64) -> Result<Self, String>
pub fn new(n: i64) -> Result<Self, String>
Create a new Matsubara frequency
§Arguments
n- The Matsubara index
§Returns
Ok(MatsubaraFreq)if the frequency is valid for the statistics typeErr(String)if the frequency is not allowed (e.g., even n for fermionic)
§Examples
use sparse_ir::freq::{FermionicFreq, BosonicFreq};
let fermionic = FermionicFreq::new(1).unwrap(); // OK: odd n for fermionic
let bosonic = BosonicFreq::new(0).unwrap(); // OK: even n for bosonicSourcepub unsafe fn new_unchecked(n: i64) -> Self
pub unsafe fn new_unchecked(n: i64) -> Self
Create a Matsubara frequency without validation
§Safety
This function bypasses the validation in new(). Only use when you’re
certain the frequency is valid for the statistics type.
Sourcepub fn value_imaginary(&self, beta: f64) -> Complex64
pub fn value_imaginary(&self, beta: f64) -> Complex64
Sourcepub fn statistics(&self) -> Statistics
pub fn statistics(&self) -> Statistics
Get the statistics type
Trait Implementations§
Source§impl<S: StatisticsType> Add for MatsubaraFreq<S>
impl<S: StatisticsType> Add for MatsubaraFreq<S>
Source§impl<S: Clone + StatisticsType> Clone for MatsubaraFreq<S>
impl<S: Clone + StatisticsType> Clone for MatsubaraFreq<S>
Source§fn clone(&self) -> MatsubaraFreq<S>
fn clone(&self) -> MatsubaraFreq<S>
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<S: Debug + StatisticsType> Debug for MatsubaraFreq<S>
impl<S: Debug + StatisticsType> Debug for MatsubaraFreq<S>
Source§impl<S: StatisticsType> Display for MatsubaraFreq<S>
impl<S: StatisticsType> Display for MatsubaraFreq<S>
Source§impl<S: StatisticsType> From<MatsubaraFreq<S>> for i64
impl<S: StatisticsType> From<MatsubaraFreq<S>> for i64
Source§fn from(freq: MatsubaraFreq<S>) -> Self
fn from(freq: MatsubaraFreq<S>) -> Self
Converts to this type from the input type.
Source§impl<S: StatisticsType> Hash for MatsubaraFreq<S>
impl<S: StatisticsType> Hash for MatsubaraFreq<S>
Source§impl<S: StatisticsType> Neg for MatsubaraFreq<S>
impl<S: StatisticsType> Neg for MatsubaraFreq<S>
Source§impl<S: StatisticsType> Ord for MatsubaraFreq<S>
impl<S: StatisticsType> Ord for MatsubaraFreq<S>
Source§impl<S: StatisticsType> PartialEq for MatsubaraFreq<S>
impl<S: StatisticsType> PartialEq for MatsubaraFreq<S>
Source§impl<S: StatisticsType> PartialOrd for MatsubaraFreq<S>
impl<S: StatisticsType> PartialOrd for MatsubaraFreq<S>
Source§impl<S: StatisticsType> Sub for MatsubaraFreq<S>
impl<S: StatisticsType> Sub for MatsubaraFreq<S>
impl<S: Copy + StatisticsType> Copy for MatsubaraFreq<S>
impl<S: StatisticsType> Eq for MatsubaraFreq<S>
Auto Trait Implementations§
impl<S> Freeze for MatsubaraFreq<S>
impl<S> RefUnwindSafe for MatsubaraFreq<S>where
S: RefUnwindSafe,
impl<S> Send for MatsubaraFreq<S>where
S: Send,
impl<S> Sync for MatsubaraFreq<S>where
S: Sync,
impl<S> Unpin for MatsubaraFreq<S>where
S: Unpin,
impl<S> UnwindSafe for MatsubaraFreq<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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.