tkwantoperator.EnergyDensity

class tkwantoperator.EnergyDensity(syst: kwant.system.FiniteSystem, where: Union[List[int], List[kwant.builder.Site]], unicode baseOperator: str = u'Kinetic+', customOnsite: Optional[Callable[[kwant.builder.Site, Dict[str, Union[float, complex]]], Union[complex, ta.matrix]]] = None, sum: bool = False)

An operator for calculating the local energy density on sites.

Parameters
  • syst (FiniteSystem) – The finalized Kwant system on which energy density will be calculated.

  • where (list [int] or list [Site]) – The sites on which the energy density will be evaluated. It is saved in a normalized way, with the same order, in the where attribute of this class.

  • baseOperator (str) – Can be Hamiltonian, Kinetic+ or Custom (case unsensitive). It tells the operator which onsite term to use when calculating the energy current. Saved as an integer in operatorType

  • customOnsite (None (default) or (Site, dict) \(\rightarrow\) complex matrix-like object) – Overwrites the value of the energy operator \(ε\) on sites: \(\forall i \, \forall t \; ~ ε_{ii}(t) = \text{customOnsite}(i, t)\), but only when baseOperator is set to Custom. In practice, its signature should be customOnsite(site, params) where site is a Site instance and params is a dict containing the parameters values (including the current time). The method must return a matrix-like object (e.g. a tinyarray instance) of the right dimensions at each site (the same as the onsite hamiltonian). It is saved in the customOnsite attribute of this class.

  • sum (bool) – Whether to sum the energy densities over the where list and return a single float result when called. Saved as an integer in the sum attribute of this class.

Notes

This operator is used to calculate the energy density on each site \(i\) in the where list. At a given time \(t\), the energy density on a site \(i\) writes:

\[ρ^ε_i(t) = \sum_{\text{lead } α} \; \sum_{{\text{mode } m_α}} \int \frac{{\text{d}E}}{2π} f_α(E) \sum_{j} \text{Re} \left [ \left [ ψ_i^{m_α E} \right ]^\dagger ε_{ij} ψ_j^{m_α E} \right ]\]

The above formula has been derived in Reference article for single-orbital Hamiltonians. In practice, the operator EnergyDensity has been implemented for generic multi-orbital Hamiltonian matrices but the physical meaning of the multi-orbital formula is not clear in general. It has not yet been investigated. \(ε\) is the energy operator derived from the system’s Hamiltonian:

  • Its values on hoppings coincide with the Hamiltonian \(\forall i \! \neq \! j \; ε_{ij}(t) = H_{ij}(t)\)

  • Its value on sites depends on what the user chooses for baseOperator:

    • Hamiltonian: \(\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t)\)

    • Kinetic+: \(\forall i \, \forall t \; ~ ε_{ii}(t) = H_{ii}(t_0 - 1)\) where \(t_0\) is the instant at which the Hamiltonian starts being time-dependent, given by time_start (the \(-1\) has been added to avoid use-case problems with heaviside-like time-dependence).

    • Custom: \(\forall i \, \forall t \; ~ ε_{ii}(t) = W_{i}(t)\) where \(W\) is given by the user through customOnsite. Note that it is necessary to impose \(ε_{ii}(t) = H_{ii}(t_0 - 1)\) for all sites \(i\) (belonging to added_lead_sites) that were part of the leads and have been added into the central system. Be cautious that there is currently no implemented check to verify this condition and if it is not satisfied, the output result of Density might be wrong.

The index \(j\) runs formally over all sites in the whole system, but effectively only the sites connected to \(i\) (including \(i\)) give in general a non zero result.

Attributes

sum

Whether to sum the energy densities over the where list and return a single float result.

Type

int, \(0\) (no) or \(1\) (yes)

where_size

Number of sites in the where list: the size of its first dimension.

Type

int

operatorType

Translation to an integer of the baseOperator parameter of the class constructor: “hamiltonian” \(\leftrightarrow 0\), “kinetic+” \(\leftrightarrow 1\) and “custom” \(\leftrightarrow 2\).

Type

int

syst

The finalized Kwant system on which energy currents will be calculated.

Type

FiniteSystem

customOnsite

Used as the value of the energy operator \(ε\) on sites: \(\forall i \, \forall t \; ~ ε_{ii}(t) = \text{customOnsite}(i, t)\), when operatorType = 2.

Type

None or (Site, dict) \(\rightarrow\) complex matrix-like object

time_name

The name the time parameter has in the params dictionary given to __call__. It is initialised with tkwant’s default name, which is time.

Type

str

time_start

The instant \(t_0\) at which time dependence starts in the Hamiltonian. Initialized with tKwant’s default value, which is 0.

Type

float

where

List of sites \(i\) (accessed as i = where[n, 0]) on which the energy density is calculated at each call.

Type

2D array of gint (a python int compatible type) of shape \(n \times 2\)

_neighbors_i

List of lists of the neighbors of each site \(i\) in where

Type

list of array of int

Methods

__call__()

Returns the contribution \(ρ_i^ε(ψ, t)\) of psi to the expectation value of the energy density on each site \(i\) of the where list.

This method enables calling an instance A of this class like a function, with a wave function and the “params” dictionary as parameters :

>>> A(psi, params)

For each site \(i\) it calculates the following sum, with psi written as “\(ψ\)” :

\[ρ^ε_i(ψ, t) = \sum_{j} \text{Re} \left [ ψ_i^\dagger ε_{ij} ψ_j \right ]\]
Parameters
  • psi (array of complex values) – The wave function to use for calculation. Must have the same length as the total number of orbitals in the system.

  • params (dict, optional) – Dictionary of parameter names and their values.

Returns

List of the values of the contribution of psi to the energy density on each site \(\left [ ρ_i^ε(ψ, t) \right ]_{i \in \text{where}}\), when sum \(= 0\). Otherwise the sum of these values \(\sum_{i \in \text{where}} ρ_i^ε(ψ, t)\).

Return type

list [float] or float

Previous topic

tkwantoperator.EnergySource

Next topic

tkwantoperator.LeadHeatCurrent

This Page