TBTK
TBTK::Solver::BlockDiagonalizer Class Reference

Solves a block diagonal Model using diagonalization. More...

#include <BlockDiagonalizer.h>

Inheritance diagram for TBTK::Solver::BlockDiagonalizer:
TBTK::Solver::Solver TBTK::Communicator

Public Member Functions

 BlockDiagonalizer ()
 
virtual ~BlockDiagonalizer ()
 
void setSelfConsistencyCallback (bool(*selfConsistencyCallback)(BlockDiagonalizer &blockDiagonalizer))
 
void setMaxIterations (int maxIterations)
 
void run ()
 
const double getEigenValue (int state)
 
const double getEigenValue (const Index &blockIndex, int state)
 
const std::complex< double > getAmplitude (int state, const Index &index)
 
const std::complex< double > getAmplitude (const Index &blockIndex, int state, const Index &intraBlockIndex)
 
unsigned int getFirstStateInBlock (const Index &index) const
 
unsigned int getLastStateInBlock (const Index &index) const
 
void setParallelExecution (bool parallelExecution)
 
- 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 block diagonal 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::BlockDiagonalizer::BlockDiagonalizer ( )

Constructor

virtual TBTK::Solver::BlockDiagonalizer::~BlockDiagonalizer ( )
virtual

Destructor.

Member Function Documentation

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

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

Parameters
stateEigenstate number \(n\).
indexPhysical index \(x\).
const std::complex< double > TBTK::Solver::BlockDiagonalizer::getAmplitude ( const Index blockIndex,
int  state,
const Index intraBlockIndex 
)
inline

Same as getAmplitude(int state, const Index &index), but the amplitude is accessed by first identifying the block using the blockIndex, then using 'state', which here is relative to the first state in the block, and finally accessing the amplitude {blockIndex, intraBlockIndex}.

const double TBTK::Solver::BlockDiagonalizer::getEigenValue ( int  state)
inline

Get eigenvalue.

const double TBTK::Solver::BlockDiagonalizer::getEigenValue ( const Index blockIndex,
int  state 
)
inline

Get eigenvalue for specific block. Note that in contrast to getEigenValue(int state), 'state' here is relative to the first state of the block.

unsigned int TBTK::Solver::BlockDiagonalizer::getFirstStateInBlock ( const Index index) const
inline

Get first state in the block corresponding to the given index.

unsigned int TBTK::Solver::BlockDiagonalizer::getLastStateInBlock ( const Index index) const
inline

Get last state in the block corresponding to the given index.

void TBTK::Solver::BlockDiagonalizer::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::BlockDiagonalizer::setMaxIterations ( int  maxIterations)
inline

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

void TBTK::Solver::BlockDiagonalizer::setParallelExecution ( bool  parallelExecution)
inline

Set whether parallel execution is enabled or not.

void TBTK::Solver::BlockDiagonalizer::setSelfConsistencyCallback ( bool(*)(BlockDiagonalizer &blockDiagonalizer)  selfConsistencyCallback)
inline

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: