pub struct Model { /* private fields */ }Expand description
Tight-binding model on a lattice.
Implementations§
Source§impl Model
impl Model
Sourcepub fn hoppings(&self) -> &[Hopping]
pub fn hoppings(&self) -> &[Hopping]
The hoppings in the order they were added, one direction each (the reverse hops are implied), before hopping terms and Peierls phases.
Sourcepub fn onsite(self, sub: usize, matrix: impl IntoMatrix) -> Self
pub fn onsite(self, sub: usize, matrix: impl IntoMatrix) -> Self
Sets the on-site matrix of a sublattice (a number for one orbital).
Sourcepub fn hopping(
self,
from: usize,
to: usize,
offset: Cell,
matrix: impl IntoMatrix,
) -> Self
pub fn hopping( self, from: usize, to: usize, offset: Cell, matrix: impl IntoMatrix, ) -> Self
Adds a hopping ⟨(R, from)| H |(R + offset, to)⟩ = matrix (and its conjugate); a number
for one orbital.
Sourcepub fn with_onsite_term(self, term: impl OnSite + 'static) -> Self
pub fn with_onsite_term(self, term: impl OnSite + 'static) -> Self
Adds a site-dependent on-site term (disorder, external potential…).
Sourcepub fn with_hopping_term(self, term: impl HoppingTerm + 'static) -> Self
pub fn with_hopping_term(self, term: impl HoppingTerm + 'static) -> Self
Adds a site-dependent hopping term (see HoppingTerm); terms apply in the order they
were added, each to the result of the previous ones.
Sourcepub fn with_peierls(self, phase: impl Peierls + 'static) -> Self
pub fn with_peierls(self, phase: impl Peierls + 'static) -> Self
Multiplies every hopping ⟨i| H |j⟩ by exp(i φ(r_i, r_j)): a vector potential through
the Peierls substitution (see gauge for uniform fields). Replaces any previous phase.
Sourcepub fn with_field(self, b: f64) -> Self
pub fn with_field(self, b: f64) -> Self
A uniform field b ẑ (see gauge for the units), in the gauge gauge::landau_x.
The transport constructors change the gauge of each lead so that it is invariant along
the lead, whatever its direction (as Kwant’s magnetic_gauge).
Sourcepub fn field(&self) -> Option<f64>
pub fn field(&self) -> Option<f64>
The uniform field set by Self::with_field, if any.
Sourcepub fn sublattice_onsite(&self, sub: usize) -> &CMat
pub fn sublattice_onsite(&self, sub: usize) -> &CMat
The on-site matrix of a sublattice, without the site-dependent terms.
Sourcepub fn onsite_terms(&self, site: &Site) -> Option<CMat>
pub fn onsite_terms(&self, site: &Site) -> Option<CMat>
The sum of the site-dependent on-site terms of a site (disorder, potentials), or None
if none applies.
Sourcepub fn has_uniform_hoppings(&self) -> bool
pub fn has_uniform_hoppings(&self) -> bool
Whether every hopping is the same in every cell: no site-dependent hopping term and no Peierls phase. The on-site terms may still depend on the site.
Sourcepub fn bonds(&self, region: &Region, periods: &[Cell]) -> Vec<Bond>
pub fn bonds(&self, region: &Region, periods: &[Cell]) -> Vec<Bond>
Every hopping block of a region, repeated along periods (open if empty), with the
displacement of its bond: the blocks of Self::bloch_hamiltonian other than the on-site
ones, before the Bloch phases. Each bond appears in both directions. With them, a uniform
vector potential A enters as the Peierls factor exp(−i A·d) of each block.
Sourcepub fn onsite_matrix(&self, site: &Site) -> CMat
pub fn onsite_matrix(&self, site: &Site) -> CMat
Full on-site matrix of a site (sublattice term plus site-dependent terms).
Sourcepub fn hamiltonian(&self, region: &Region) -> CMat
pub fn hamiltonian(&self, region: &Region) -> CMat
Dense Hamiltonian of a finite region (open boundaries).
Sourcepub fn bloch_hamiltonian(
&self,
region: &Region,
periods: &[Cell],
phases: &[f64],
) -> CMat
pub fn bloch_hamiltonian( &self, region: &Region, periods: &[Cell], phases: &[f64], ) -> CMat
Bloch Hamiltonian of a region repeated periodically: periods are translations (in
cells) and phases the matching Bloch phases k·T in radians. Hoppings that leave the
region by n periods pick up exp(i Σ n·phase).
Sourcepub fn sparse_hamiltonian(&self, region: &Region) -> SparseMatrix
pub fn sparse_hamiltonian(&self, region: &Region) -> SparseMatrix
Sparse Hamiltonian of a finite region (open boundaries), for regions too large for dense matrices (KPM, time evolution).
Sourcepub fn sparse_bloch_hamiltonian(
&self,
region: &Region,
periods: &[Cell],
phases: &[f64],
) -> SparseMatrix
pub fn sparse_bloch_hamiltonian( &self, region: &Region, periods: &[Cell], phases: &[f64], ) -> SparseMatrix
Sparse version of Self::bloch_hamiltonian (twisted periodic boundaries).
Sourcepub fn sparse_velocity(
&self,
region: &Region,
periods: &[Cell],
phases: &[f64],
direction: Vec3,
) -> SparseMatrix
pub fn sparse_velocity( &self, region: &Region, periods: &[Cell], phases: &[f64], direction: Vec3, ) -> SparseMatrix
Velocity operator v = i[H, r·d] (ħ = 1) along direction, as a sparse matrix, on a
region with periodic directions as Self::sparse_bloch_hamiltonian:
v_ij = i H_ij (r_j − r_i)·d. The displacement is that of the hopping itself, not
reduced into the region, so it is also the velocity of a torus. On-site terms do not
contribute.
Sourcepub fn coupling(&self, a: &Region, b: &Region) -> CMat
pub fn coupling(&self, a: &Region, b: &Region) -> CMat
Coupling matrix ⟨a| H |b⟩ between two disjoint regions (rows: a, columns: b).
Sourcepub fn slice_blocks(
&self,
region: &Region,
axis: usize,
) -> (Vec<Region>, Vec<CMat>, Vec<CMat>)
pub fn slice_blocks( &self, region: &Region, axis: usize, ) -> (Vec<Region>, Vec<CMat>, Vec<CMat>)
Transport blocks of a region cut into slices along primitive vector axis: the on-slice
Hamiltonians H_nn and the couplings V_n = ⟨n| H |n+1⟩. Panics if a hopping skips a
slice (range longer than one slice).
Auto Trait Implementations§
impl !RefUnwindSafe for Model
impl !UnwindSafe for Model
impl Freeze for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
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
impl<T, U> Imply<T> for U
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 more