Skip to main content

Model

Struct Model 

Source
pub struct Model { /* private fields */ }
Expand description

Tight-binding model on a lattice.

Implementations§

Source§

impl Model

Source

pub fn new(lattice: Lattice) -> Self

Model with zero on-site matrices and no hopping.

Source

pub fn lattice(&self) -> &Lattice

The lattice of the model.

Source

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.

Source

pub fn onsite(self, sub: usize, matrix: impl IntoMatrix) -> Self

Sets the on-site matrix of a sublattice (a number for one orbital).

Source

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.

Source

pub fn with_onsite_term(self, term: impl OnSite + 'static) -> Self

Adds a site-dependent on-site term (disorder, external potential…).

Source

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.

Source

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.

Source

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

Source

pub fn field(&self) -> Option<f64>

The uniform field set by Self::with_field, if any.

Source

pub fn sublattice_onsite(&self, sub: usize) -> &CMat

The on-site matrix of a sublattice, without the site-dependent terms.

Source

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.

Source

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.

Source

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.

Source

pub fn onsite_matrix(&self, site: &Site) -> CMat

Full on-site matrix of a site (sublattice term plus site-dependent terms).

Source

pub fn hamiltonian(&self, region: &Region) -> CMat

Dense Hamiltonian of a finite region (open boundaries).

Source

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

Source

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

Source

pub fn sparse_bloch_hamiltonian( &self, region: &Region, periods: &[Cell], phases: &[f64], ) -> SparseMatrix

Sparse version of Self::bloch_hamiltonian (twisted periodic boundaries).

Source

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.

Source

pub fn coupling(&self, a: &Region, b: &Region) -> CMat

Coupling matrix ⟨a| H |b⟩ between two disjoint regions (rows: a, columns: b).

Source

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