Skip to main content

Spectrum

Struct Spectrum 

Source
pub struct Spectrum<'a> { /* private fields */ }
Expand description

The kernel polynomial method on the Hamiltonian of a Model on a Region.

Energies are those of the model. Densities are per unit energy and per sample: the density of states integrates to the number of orbitals of the region. The energy resolution of the Jackson kernel is about π · half_width / moments (Self::resolution).

Implementations§

Source§

impl<'a> Spectrum<'a>

Source

pub fn new(model: &'a Model, region: &'a Region) -> Self

The region with open boundaries.

Source

pub fn periodic(model: &'a Model, region: &'a Region, periods: &[Cell]) -> Self

The region repeated along periods (cells), e.g. [[n, 0, 0], [0, n, 0]] for an n × n torus. The spectral bounds come from Gershgorin’s theorem, widened by 1 %.

Source

pub fn bounds(self, lower: f64, upper: f64) -> Self

Bounds on the spectrum, tighter than Gershgorin’s for a finer resolution. They must contain every eigenvalue (they are widened by 1 %).

Source

pub fn moments(self, moments: usize) -> Self

Number of Chebyshev moments (default 256).

Source

pub fn vectors(self, vectors: usize) -> Self

Number of random-phase vectors of the stochastic trace (default 10).

Source

pub fn exact_trace(self) -> Self

Exact traces over every basis vector instead of random vectors (small systems).

Source

pub fn seed(self, seed: u64) -> Self

Seed of the random vectors (default 1).

Source

pub fn device(self, options: Options) -> Self

Where the density-of-states moments run (CPU by default; see caroli_gpu::Options).

Source

pub fn scaling(&self) -> (f64, f64)

(centre, half_width) of the rescaling H̃ = (H − centre)/half_width.

Source

pub fn resolution(&self) -> f64

Width of the Jackson kernel, π · half_width / moments.

Source

pub fn hamiltonian(&self) -> &SparseMatrix

The Hamiltonian (unscaled).

Source

pub fn dos_moments(&self) -> (Vec<c64>, Report)

Moments μ_n = g_n Tr T_n(H̃) of the density of states, and where they ran.

Source

pub fn density(&self, mu: &[c64], energies: &[f64]) -> Vec<f64>

Density per unit energy at energies from moments of H̃ (zero outside the bounds).

Source

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

Density of states Tr δ(E − H) at energies.

Source

pub fn projected_dos(&self, op: &CMat, energies: &[f64]) -> Vec<f64>

Tr[O δ(E − H)] for a Hermitian on-site operator O (the same matrix on every site, e.g. a spin or sublattice projector; all sites must carry O.nrows() orbitals).

Source

pub fn ldos(&self, sites: &[usize], energies: &[f64]) -> Vec<Vec<f64>>

Local densities of states Σ_a ⟨i, a| δ(E − H) |i, a⟩ of the sites sites (indices into the region), summed over their orbitals: one curve per site.

Source

pub fn orbital_ldos( &self, sites: &[usize], energies: &[f64], ) -> Vec<Vec<Vec<f64>>>

Local densities of states ⟨i, a| δ(E − H) |i, a⟩ of every orbital a of the sites sites: one curve per site and orbital. The basis vectors go through the Chebyshev recursion in blocks, so that the memory stays that of a few blocks of vectors.

Source

pub fn conductivity( &self, a: Vec3, b: Vec3, mus: &[f64], temperature: f64, ) -> Vec<f64>

Kubo–Bastin conductivity σ_ab in units of e²/h at the chemical potentials mus and the temperature temperature (energy units; 0 for a step), for a region periodic in every direction of the lattice (an n × n torus in 2D). a and b are directions (unit vectors). The cost grows as moments² per random vector.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Spectrum<'a>

§

impl<'a> !UnwindSafe for Spectrum<'a>

§

impl<'a> Freeze for Spectrum<'a>

§

impl<'a> Send for Spectrum<'a>

§

impl<'a> Sync for Spectrum<'a>

§

impl<'a> Unpin for Spectrum<'a>

§

impl<'a> UnsafeUnpin for Spectrum<'a>

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> AutoreleaseSafe for T
where T: ?Sized,

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> 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, 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.