TBTK
|
Need a break? Support the development by playing Polarity Puzzles |
Solves a Model using diagonalization. More...
#include <Diagonalizer.h>
Classes | |
class | SelfConsistencyCallback |
Public Member Functions | |
Diagonalizer () | |
void | setSelfConsistencyCallback (SelfConsistencyCallback &selfConsistencyCallback) |
void | setMaxIterations (int maxIterations) |
void | run () |
const CArray< double > & | getEigenValues () |
CArray< double > & | getEigenValuesRW () |
const CArray< std::complex< double > > & | getEigenVectors () |
CArray< 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) |
Model & | getModel () |
const Model & | getModel () 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 () |
Solves a Model using diagonalization.
Solves a Model by Diagonalizing the Hamiltonian. Use PropertyExtractor::Diagonalizer to extract Properties.
Scaling behavior:
Time: \(O(h^3)\)
Space: \(O(h^2)\)
Here \(h\) is the size of the Hilbert space basis.
TBTK::Solver::Diagonalizer::Diagonalizer | ( | ) |
Constructs a Solver::Diagonalizer.
|
inline |
Get amplitude for given eigenvector \(n\) and physical index \(x\): \(\Psi_{n}(x)\).
state | Eigenstate number \(n\). |
index | Physical index \(x\). |
|
inline |
Get eigenvalue for a specific state.
state | The state number, ordered in accending order. |
|
inline |
Get eigenvalues. Eigenvalues are ordered in accending order.
|
inline |
Get eigenvalues. Eigenvalues are ordered in accending order. Same as getEigenValues(), but with write access. Use with caution.
|
inline |
Get eigenvectors. The eigenvectors are stored successively in memory, with the eigenvector corresponding to the smallest eigenvalue occupying the 'basisSize' first positions, the second occupying the next 'basisSize' elements, and so forth, where 'basisSize' is the basis size of the Model.
|
inline |
Get eigenvectors. The eigenvectors are stored successively in memory, with the eigenvector corresponding to the smallest eigenvalue occupying the 'basisSize' first positions, the second occupying the next 'basisSize' elements, and so forth, where 'basisSize' is the basis size of the Model. Same as getEigenVectors(), but with write access. Use with caution.
void TBTK::Solver::Diagonalizer::run | ( | ) |
Run calculations. Diagonalizes ones if no self-consistency callback have been set, or otherwise multiple times until self-consistencey or maximum number of iterations has been reached.
|
inline |
Set the maximum number of iterations for the self-consistency loop. Only used if Diagonalizer::setSelfConsistencyCallback() has been called with a non-nullptr argument. If the self-consistency callback does not return true, maxIterations determines the maximum number of times it is called.
maxIterations | Maximum number of iterations to use in a self-consistent callculation. |
|
inline |
Set SelfConsistencyCallback. If never called, the self-consistency loop will not be run.
selfConsistencyCallback | A SelfConsistencyCallback that will be called after the Model has been diagonalized. The callback should calculate relevant quantities, modify the Model if necessary, and return false if further iteration is necessary. If true is returned, self-consistency is considered to be reached and the iteration stops. |