TBTK::Solver::Diagonalizer Class Reference

Solves a Model using diagonalization. More...

#include <Diagonalizer.h>

Inheritance diagram for TBTK::Solver::Diagonalizer:
TBTK::Solver::Solver TBTK::Communicator

Public Member Functions

 Diagonalizer ()
virtual ~Diagonalizer ()
void setSelfConsistencyCallback (bool(*selfConsistencyCallback)(Diagonalizer &diagonalizer))
void setMaxIterations (int maxIterations)
void run ()
const double * getEigenValues ()
double * getEigenValuesRW ()
const std::complex< double > * getEigenVectors ()
std::complex< double > * getEigenVectorsRW ()
const double getEigenValue (int state)
const std::complex< double > getAmplitude (int state, const Index &index)
- Public Member Functions inherited from TBTK::Solver::Solver
 Solver ()
virtual ~Solver ()
virtual void setModel (Model &model)
ModelgetModel ()
const ModelgetModel () const
- Public Member Functions inherited from TBTK::Communicator
 Communicator (bool verbose)
void setVerbose (bool verbose)
bool getVerbose () const

Additional Inherited Members

- Static Public Member Functions inherited from TBTK::Communicator
static void setGlobalVerbose (bool globalVerbose)
static bool getGlobalVerbose ()

Detailed Description

Solves a Model using diagonalization.

Solves a given model by Diagonalizing the Hamiltonian. The eigenvalues and eigenvectors can then either be directly extracted and used to calculate custom physical quantities, or the PropertyExtractor can be used to extract common properties. Scales as \(O(n^3)\) with the dimension of the Hilbert space.

Constructor & Destructor Documentation

TBTK::Solver::Diagonalizer::Diagonalizer ( )


virtual TBTK::Solver::Diagonalizer::~Diagonalizer ( )


Member Function Documentation

const std::complex< double > TBTK::Solver::Diagonalizer::getAmplitude ( int  state,
const Index index 

Get amplitude for given eigenvector \(n\) and physical index \(x\): \(\Psi_{n}(x)\).

stateEigenstate number \(n\).
indexPhysical index \(x\).
const double TBTK::Solver::Diagonalizer::getEigenValue ( int  state)

Get eigenvalue.

const double * TBTK::Solver::Diagonalizer::getEigenValues ( )

Get eigenvalues.

double * TBTK::Solver::Diagonalizer::getEigenValuesRW ( )

Get eigenvalues. Same as getEigenValues(), but with write access. Use with causion.

const std::complex< double > * TBTK::Solver::Diagonalizer::getEigenVectors ( )

Get eigenvectors.

std::complex< double > * TBTK::Solver::Diagonalizer::getEigenVectorsRW ( )

Get eigenvectors. Same as getEigenVectors(), but with write access. Use with causion.

void TBTK::Solver::Diagonalizer::run ( )

Run calculations. Diagonalizes ones if no self-consistency callback have been set, or otherwise multiple times until slef-consistencey or maximum number of iterations has been reached.

void TBTK::Solver::Diagonalizer::setMaxIterations ( int  maxIterations)

Set maximum number of iterations for the self-consistency loop.

void TBTK::Solver::Diagonalizer::setSelfConsistencyCallback ( bool(*)(Diagonalizer &diagonalizer)  selfConsistencyCallback)

Set self-consistency callback. If set to NULL or never called, the self-consistency loop will not be run.

The documentation for this class was generated from the following file: