Skip to main content

Scba

Struct Scba 

Source
pub struct Scba {
    pub hk: Vec<CMat>,
    pub mean_field: CMat,
    pub vertices: Vec<(f64, CMat)>,
}
Expand description

SCBA problem: H(k) on a k grid, mean field ⟨V⟩ and second-order vertices.

Fields§

§hk: Vec<CMat>

H(k) at each point of the k grid (orbitals of a unit cell): ⟨G⟩ averages over them.

§mean_field: CMat

Mean field Σ_MF = ⟨V⟩.

§vertices: Vec<(f64, CMat)>

Vertices (w_t, V_t) of the second cumulant: Σ₂ = Σ_t w_t V_t ⟨G⟩ V_t.

Implementations§

Source§

impl Scba

Source

pub fn local_green(&self, z: c64, sigma: &CMat) -> CMat

⟨G⟩(z) = (1/N_k) Σ_k [z − H(k) − Σ_MF − Σ₂]⁻¹. Large grids are summed in parallel, in fixed chunks added in order, so the result does not depend on the number of threads.

Source

pub fn update(&self, z: c64, sigma: &CMat) -> CMat

One SCBA map: Σ_t w_t V_t ⟨G⟩(z; Σ₂) V_t.

Source

pub fn solve( &self, z: c64, guess: &CMat, mixing: f64, tol: f64, max_iter: usize, ) -> Solution

Fixed-point iteration Σ ← (1 − p) Σ + p F(Σ) from guess until the largest change of an element is below tol (at most max_iter steps). A non-finite update stops the iteration with a NaN residual.

Source§

impl Scba

Source

pub fn solve_anderson( &self, z: c64, guess: &CMat, depth: usize, tol: f64, max_iter: usize, ) -> Solution

Fixed point Σ₂ = F(Σ₂) by Anderson acceleration (Anderson mixing, also known as DIIS) on the residual F(Σ) − Σ with the last depth iterates, from guess, until the largest change of an element is below tol. It needs far fewer k sums than Self::solve. When the extrapolation misbehaves (non-finite values, a residual that grows tenfold), the history is dropped and a plain step taken.

Source§

impl Scba

Source

pub fn from_model(model: &Model, grid: &[usize], disorder: Disorder) -> Self

The SCBA of model with disorder, H(k) sampled on a uniform grid of the Brillouin zone with grid[a] points along reciprocal direction a (one size per lattice direction; the 2D grid is k_grid). The unit cell holds every sublattice, so the matrices of disorder act on all the orbitals of a cell.

Source

pub fn self_energy(&self, energy: f64, eta: f64) -> Solution

Second-order self-energy Σ₂ at energy + iη, from zero, by Anderson acceleration to a largest change of 1e-11 (at most 500 k sums).

Source

pub fn sweep(&self, energies: &[f64], eta: f64) -> Vec<Solution>

Self::self_energy at each energy, each solution starting from the previous one.

Source

pub fn total_self_energy(&self, sigma: &CMat) -> CMat

The whole self-energy Σ_MF + Σ₂.

Source

pub fn dos(&self, energy: f64, eta: f64, sigma: &CMat) -> f64

Averaged density of states per unit cell, −Im Tr ⟨G⟩(E + iη) / π, with the self-energy Σ₂ = sigma (zero for the clean model).

Trait Implementations§

Source§

impl Clone for Scba

Source§

fn clone(&self) -> Scba

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Scba

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Scba

§

impl RefUnwindSafe for Scba

§

impl Send for Scba

§

impl Sync for Scba

§

impl Unpin for Scba

§

impl UnsafeUnpin for Scba

§

impl UnwindSafe for Scba

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.