TBTK
TBTK::Solver::ArnoldiIterator Class Reference

Solves a Model using Arnoldi iteration. More...

#include <ArnoldiIterator.h>

Inheritance diagram for TBTK::Solver::ArnoldiIterator:
TBTK::Solver::Solver TBTK::Communicator

Public Types

enum  Mode { Normal, ShiftAndInvert }
 

Public Member Functions

 ArnoldiIterator ()
 
virtual ~ArnoldiIterator ()
 
void setMode (Mode mode)
 
Mode getMode () const
 
void setNumEigenValues (int numEigenValues)
 
int getNumEigenValues () const
 
void setCalculateEigenVectors (bool calculateEigenVectors)
 
bool getCalculateEigenVectors () const
 
void setNumLanczosVectors (int numLanczosVectors)
 
int getNumLanczosVectors () const
 
void setTolerance (double tolerance)
 
void setMaxIterations (int maxIterations)
 
void setCentralValue (double centralValue)
 
void run ()
 
const std::complex< double > * getEigenValues () const
 
const double getEigenValue (int state) const
 
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 Arnoldi iteration.

The ArnoldiIterator can be used to calculate a few eigenvalues and eigenvectors around a given energy.

Member Enumeration Documentation

Enum class describing the different modes of operation.

Normal: Lanczos like iteration for finding extreme eigenvalues and corresponding eigen vectors.

ShiftAndInvert: Shift and invert iteration for finding eigen values around a given value and the corresponding eigen vectors.

Constructor & Destructor Documentation

TBTK::Solver::ArnoldiIterator::ArnoldiIterator ( )

Constructs a Solver::ArnoldiIterator.

virtual TBTK::Solver::ArnoldiIterator::~ArnoldiIterator ( )
virtual

Destructor.

Member Function Documentation

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

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

Parameters
stateEigen state number \(n\).
indexPhysical index \(\).
bool TBTK::Solver::ArnoldiIterator::getCalculateEigenVectors ( ) const
inline

Get wether eigen vectors are calculated or not.

Returns
True if eigenvectors are set to be calculated.
const double TBTK::Solver::ArnoldiIterator::getEigenValue ( int  state) const
inline

Get eigen value.

const std::complex< double > * TBTK::Solver::ArnoldiIterator::getEigenValues ( ) const
inline

Get eigenValues.

ArnoldiIterator::Mode TBTK::Solver::ArnoldiIterator::getMode ( ) const
inline

Get mode of operation.

Returns
The mode of operation.
int TBTK::Solver::ArnoldiIterator::getNumEigenValues ( ) const
inline

Get number of eigenvalues.

Returns
The number of eigenvalues that are calculated.
int TBTK::Solver::ArnoldiIterator::getNumLanczosVectors ( ) const
inline

Get the number of Lanczos vectors to use. (Dimension of the Krylov space).

Returns
The dimension of the Krylov space used.
void TBTK::Solver::ArnoldiIterator::run ( )

Run the implicitly restarted Arnoldi algorithm.

void TBTK::Solver::ArnoldiIterator::setCalculateEigenVectors ( bool  calculateEigenVectors)
inline

Set whether eigen vectors should be calculated.

Parameters
calculateEigenVectorsTrue to enable the calculation of eigenvectors.
void TBTK::Solver::ArnoldiIterator::setCentralValue ( double  centralValue)
inline

Set amount by which eigenvalues will be shifted during calculations. I.e. the calculation is caried out on \(H -\sigma I\) rather than \(H\). Eigenvalues are shifted back, so this does not affect the eigenvalues. However, since Arnoldi iteration calculates extreme eigenvalues in the normal mode and eigenvalues closest to zero in shift-and-invert mode, it does affect which eigenvalues that are calculated.

Note: The shift is not yet implemented in for the normal mode.

Parameters
centralValueThe value \(\sigma\) by which the Hamiltonian is shifted.
void TBTK::Solver::ArnoldiIterator::setMaxIterations ( int  maxIterations)
inline

Set the maixmum number of iterations in the implicitly restarted Arnoldi algorithm.

Parameters
maxIterationsThe maximum number of iterations performed in the implicitly restarted Arnoldi algorithm.
void TBTK::Solver::ArnoldiIterator::setMode ( Mode  mode)
inline

Set mode of operation.

Parameters
modeThe mode of operation to use.
void TBTK::Solver::ArnoldiIterator::setNumEigenValues ( int  numEigenValues)
inline

Set the number of eigenvalues to calculate.

Parameters
numEigenValuesThe number of eigenvalues to calculate.
void TBTK::Solver::ArnoldiIterator::setNumLanczosVectors ( int  numLanczosVectors)
inline

Set the number of Lanczos vectors to use. (Dimension of the Krylov space).

Parameters
numLanczosVectorsThe dimension of the Krylov space used.
void TBTK::Solver::ArnoldiIterator::setTolerance ( double  tolerance)
inline

Set the accpeted tolerance. Passed to the ARPACK functions [d/z]naupd and [d/z]neupd. See the TOL parameter in the ARPACK documentation for more information.

Parameters
toleranceTolerance used by ARPACK.

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