tbplas.DiagSolver

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

Base class for solvers based on exact diagonalization.

_model

model for which properties will be calculated

Type:

‘PrimitiveCell’ instance

_overlap

model holding the overlap of basis functions

Type:

‘PrimitiveCell’ instance

_cpp_model

c++ interface of model

Type:

‘CPPPrimitiveCell’ instance

_cpp_overlap

c++ interface of overlap

Type:

‘CPPPrimitiveCell’ instance

_cpp_solver

C++ interface of solvers

Type:

‘CppDiagSolver’ or other class instance

_cpp_model_data

container of data to which _cpp_model is referenced to avoid dangling pointers

Type:

namedtuple

_cpp_overlap_data

container of data to which _cpp_overlap is referenced to avoid dangling pointers

Type:

namedtuple

_mpi_env

mpi parallel environment

Type:

‘MPIEnv’ instance

config

parameters controlling the calculations

Type:

‘DiagConfig’ instance

__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_states()

Calculate bands as well as eigenstates.

Attributes

is_master

Wrapper for determine the master process for compatibility.

__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_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

__weakref__

list of weak references to the object

property is_master: bool

Wrapper for determine the master process for compatibility.