tbplas.Z2

class tbplas.Z2(model: PrimitiveCell, overlap: PrimitiveCell = None, echo_details: bool = True)

Class for evaluating the Z2 topological invariant.

Reference: https://journals.aps.org/prb/abstract/10.1103/PhysRevB.84.075119

__init__(model: PrimitiveCell, overlap: PrimitiveCell = None, echo_details: bool = True) None
Parameters:
  • model – model for which properties will be calculated

  • overlap – model holding the overlap of basis functions

  • echo_details – whether to output parallelization details

Methods

__init__(model[, overlap, echo_details])

calc_bands()

Calculate band structure along given k_path. :return: (k_len, bands) k_len: (num_kpt,) float64 array, length of k-path bands: (num_kpt, num_bands) float64 array, band structure.

calc_bands_scipy()

Calculate band structure along given k_path.

calc_dos()

Calculate density of states for given energy range and step. :return: (energies, dos) energies: (num_eng,) float64 array energies determined by e_min, e_max and e_step dos: (num_eng,) float64 array density of states in states/eV.

calc_phases()

Calculate the phases of WF centers as function of kb (eqn. 12 of ref). :return: (kb_array, phases) kb_array: (num_kb,) float64 array FRACTIONAL coordinates of the loop along b-axis phases: (num_kpt, num_occ) float64 array phases of WF centers.

calc_states()

Calculate bands as well as eigenstates.

count_crossing(phases[, phase_ref])

Count the number that the phases go across a reference value.

reorder_phases(phases[, threshold, smooth])

Reorder the phases to improve continuity and smoothness.

Attributes

is_master

Wrapper for determine the master process for compatibility.

static count_crossing(phases: ndarray, phase_ref: float = 0.5) int

Count the number that the phases go across a reference value.

The Z2 topological invariant is determined as num_crossing % 2.

NOTE: the phases must be CORRECTLY reordered before passing to this function. Otherwise, the crossing number will be wrong!

If the reordering algorithm fails to work by all means, then you have to plot the phases using scatter plot and count the crossing number manually.

Parameters:
  • phases – (num_kpt, num_occ) float64 array phases of WF centers

  • phase_ref – reference value

Returns:

number of crossing

__init__(model: PrimitiveCell, overlap: PrimitiveCell = None, echo_details: bool = True) None
Parameters:
  • model – model for which properties will be calculated

  • overlap – model holding the overlap of basis functions

  • echo_details – whether to output parallelization details

calc_bands() Tuple[ndarray, ndarray]

Calculate band structure along given k_path. :return: (k_len, bands)

k_len: (num_kpt,) float64 array, length of k-path bands: (num_kpt, num_bands) float64 array, band structure

calc_bands_scipy() Tuple[ndarray, ndarray]

Calculate band structure along given k_path.

This function calls C++ interface to set up the Hamiltonian. However, the diagonalization is done using scipy. For now this function is intended to be called by the ‘ParamFit’ class. It also works as an example for obtaining the Hamiltonian for post-process.

Returns:

(k_len, bands) k_len: (num_kpt,) float64 array, length of k-path bands: (num_kpt, num_bands) float64 array, band structure

calc_dos() Tuple[ndarray, ndarray]

Calculate density of states for given energy range and step. :return: (energies, dos)

energies: (num_eng,) float64 array energies determined by e_min, e_max and e_step dos: (num_eng,) float64 array density of states in states/eV

calc_phases() Tuple[ndarray, ndarray]

Calculate the phases of WF centers as function of kb (eqn. 12 of ref). :return: (kb_array, phases)

kb_array: (num_kb,) float64 array FRACTIONAL coordinates of the loop along b-axis phases: (num_kpt, num_occ) float64 array phases of WF centers

calc_states() Tuple[ndarray, ndarray]

Calculate bands as well as eigenstates.

Returns:

(bands, states) bands: (num_kpt, num_bands) float64 array

band structure

states: (num_kpt, num_bands, num_orb) complex128 array

eigenstates at each k-point, with each ROW being a state

reorder_phases(phases: ndarray, threshold: float = 0.1, smooth: bool = True) ndarray

Reorder the phases to improve continuity and smoothness.

NOTE: sometimes this method may not work properly. In that case, try to increase threshold and the density of kb_array.

Parameters:
  • phases – (num_kpt, num_occ) float64 array phases of WF centers

  • threshold – threshold for detecting discontinuity

  • smooth – whether to smooth the phases by ensuring the continuity of 1st order derivative with respect to kb

Returns:

(num_kpt, num_occ) float64 array reordered phases

__weakref__

list of weak references to the object

property is_master: bool

Wrapper for determine the master process for compatibility.