tkwantoperator.EnergyCurrentDivergence

class tkwantoperator.EnergyCurrentDivergence(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 that calculates the net energy current leaving a given site of the system by summing the outgoing energy currents towards its neighbors.

Parameters
  • syst (FiniteSystem) – The finalized Kwant system on which the current divergence will be calculated.

  • where (list [int] or list [Site]) – The sites on which the net outgoing energy current 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 divergences over the sites of the where list and return a single float, which will be the net current flowing out of the surface(s) made by the sites in where (using optimised code). Saved as an integer in the sum attribute of this class.

Notes

This class calculates the net energy current leaving each site \(i\) given in where, by summing the outgoing energy currents to each of its neighbors \(j \neq i\) (with \(H_{ji} \neq 0\))

\[D_i(t) = \sum_j I^ε_{ji}\]

where \(I^ε_{ji}\) is the energy current flowing from site \(i\) to site \(j\) (calculated by the class EnergyCurrent).

Attributes

syst

The finalized Kwant system on which the current divergence will be calculated.

Type

FiniteSystem

where

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

Type

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

where_size

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

Type

int

sum

Whether to sum the current divergences over the where list and return a single float result.

Type

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

_energy_current_op

An instance of tKwant’s energy current, used internally to calculate the divergences. The attribute _energy_current_where is given to it as a where at instantiation.

Type

EnergyCurrent

_neighbors_num

Number of neighbors of each site of the where list, with the same order. This attribute is not used if sum is set to \(1\).

Type

list of int

_energy_current_where

List of hoppings on which the energy current will be calculated. Slices of this list are then made, with the help of _neighbors_num, to calculate the current divergence on each site of the where list. if sum is set to \(1\), this list will contain only the outgoing hoppings from the surface(s) made by the sites in the where list.

Type

list [(Site, Site)]

Methods

__call__()

Returns the contribution \(D_i^ε(ψ, t)\) of psi to the expectation value of the current divergence on each site 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 “\(ψ\)” :

\[D_i^ε(ψ, t) = \sum_j I^ε_{ji}(ψ, t)\]

Where \(I^ε_{ji}(ψ, t)\) is calculated with __call__ from the EnergyCurrent class.

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 current divergence on each site of the where list \(\left [ D_i^ε(ψ, t) \right ]_{i \in \text{where}}\), when sum \(= 0\). Otherwise the sum of these values \(\sum_{i \in \text{where}} D_i^ε(ψ, t)\).

Return type

list [float] or float

Previous topic

tkwantoperator.LeadHeatCurrent

This Page