tkwantoperator.EnergySiteValidator

class tkwantoperator.EnergySiteValidator(syst)

A class that tells if energy related quantities can be calculated on a given site or hopping.

In principle any site/hopping can be used, though (t)Kwant’s implementation doesn’t enable accessing the wave function on lead sites. Thus, if an energy operator is calculated on a site/hopping that involves lead sites as neighbors it would return wrong results (energy operators test against that use case to throw an exception).

Parameters

syst (FiniteSystem) – The finalized Kwant system for which sites/hoppings are checked.

Attributes

syst

The finalized system for which sites/hoppings are checked.

Type

FiniteSystem

interface_site_ids

List of all lead-interface sites

Type

list[int]

interface_site_and_neighbors_ids

List of all lead-interface sites and their neighbors

Type

list[int]

Methods

is_hopping_valid_for_current(hopping)

Returns if the energy current can be calculated correctly between the two sites of the given hopping. Sites at the interface with leads would give wrong results.

Parameters

hopping (tuple [Site, Site] or tuple [int, int]) – The hopping to validate

Returns

Whether the hopping is valid for an energy current calculation.

Return type

bool

is_site_valid_for_density(site)

Tells if the energy density or source can be calculated correctly in the given site.

Calculating the energy density on lead-interface sites would give wrong results.

Parameters

site (Site or int) – The Site to validate

Returns

Whether the site is valid for a density calculation.

Return type

bool

is_site_valid_for_divergence(site)

Tells if the energy current divergence can be calculated correctly in the given site.

Calculating the energy current divergence on lead-interface sites and their first nearest-neighbors would give wrong results.

Parameters

site (Site or int) – The Site to validate

Returns

Whether the site is valid of a divergence calculation.

Return type

bool

Previous topic

3. Documentation

Next topic

tkwantoperator.EnergyCurrent

This Page