TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::PropertyExtractor::ArnoldiIterator Class Reference

Extracts physical properties from the Solver::ArnoldiIterator. More...

#include <ArnoldiIterator.h>

Inheritance diagram for TBTK::PropertyExtractor::ArnoldiIterator:
TBTK::PropertyExtractor::PropertyExtractor

Public Member Functions

 ArnoldiIterator (Solver::ArnoldiIterator &solver)
 
Property::EigenValues getEigenValues ()
 
double getEigenValue (int state)
 
const std::complex< double > getAmplitude (int state, const Index &index)
 
Property::WaveFunctions calculateWaveFunctions (std::vector< Index > patterns, std::vector< Subindex > states)
 
virtual Property::DOS calculateDOS ()
 
virtual Property::LDOS calculateLDOS (Index pattern, Index ranges)
 
virtual Property::LDOS calculateLDOS (std::vector< Index > patterns)
 
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS (Index pattern, Index ranges)
 
virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS (std::vector< Index > patterns)
 
- Public Member Functions inherited from TBTK::PropertyExtractor::PropertyExtractor
 PropertyExtractor ()
 
virtual ~PropertyExtractor ()
 
virtual void setEnergyWindow (double lowerBound, double upperBound, int energyResolution)
 
virtual void setEnergyWindow (int lowerFermionicMatsubaraEnergyIndex, int upperFermionicMatsubaraEnergyIndex, int lowerBosonicMatsubaraEnergyIndex, int upperBosonicMatsubaraEnergyIndex)
 
virtual void setEnergyInfinitesimal (double energyInfinitesimal)
 
virtual Property::Density calculateDensity (Index pattern, Index ranges)
 
virtual Property::Density calculateDensity (std::vector< Index > patterns)
 
virtual Property::Magnetization calculateMagnetization (Index pattern, Index ranges)
 
virtual Property::Magnetization calculateMagnetization (std::vector< Index > patterns)
 
virtual std::complex< double > calculateExpectationValue (Index to, Index from)
 
virtual Property::DOS sampleDOS (unsigned int numSamples, const std::vector< Index > &patterns={}, unsigned int seed=time(nullptr))
 
virtual double calculateEntropy ()
 

Additional Inherited Members

- Protected Types inherited from TBTK::PropertyExtractor::PropertyExtractor
enum  EnergyType { Real, Matsubara }
 
- Protected Member Functions inherited from TBTK::PropertyExtractor::PropertyExtractor
EnergyType getEnergyType () const
 
int getEnergyResolution () const
 
double getLowerBound () const
 
double getUpperBound () const
 
int getLowerFermionicMatsubaraEnergyIndex () const
 
int getUpperFermionicMatsubaraEnergyIndex () const
 
int getLowerBosonicMatsubaraEnergyIndex () const
 
int getUpperBosonicMatsubaraEnergyIndex () const
 
double getEnergyInfinitesimal () const
 
template<typename DataType >
void calculate (void(*callback)(PropertyExtractor *cb_this, Property::Property &property, const Index &index, int offset, Information &information), Property::AbstractProperty< DataType > &property, Index pattern, const Index &ranges, int currentOffset, int offsetMultiplier, Information &information)
 
template<typename DataType >
void calculate (void(*callback)(PropertyExtractor *cb_this, Property::Property &property, const Index &index, int offset, Information &information), const IndexTree &allIndices, const IndexTree &memoryLayout, Property::AbstractProperty< DataType > &abstractProperty, Information &information)
 
void ensureCompliantRanges (const Index &pattern, Index &ranges)
 
std::vector< int > getLoopRanges (const Index &pattern, const Index &ranges)
 
IndexTree generateIndexTree (std::vector< Index > patterns, const HoppingAmplitudeSet &hoppingAmplitudeSet, bool keepSummationWildcards, bool keepSpinWildcards)
 

Detailed Description

Extracts physical properties from the Solver::ArnoldiIterator.

The PropertyExtractor::ArnoldiIterator extracts Properties from the Solver::ArnoldiIterator.

Example

#include "TBTK/Model.h"
#include "TBTK/PropertyExtractor/ArnoldiIterator.h"
#include "TBTK/Smooth.h"
#include "TBTK/Solver/ArnoldiIterator.h"
#include "TBTK/Streams.h"
#include "TBTK/TBTK.h"
#include <complex>
using namespace std;
using namespace TBTK;
using namespace Visualization::MatPlotLib;
complex<double> i(0, 1);
int main(){
Model model;
for(unsigned int x = 0; x < 400; x++){
model << HoppingAmplitude(-1, {x+1, 0}, {x, 0}) + HC;
model << HoppingAmplitude(1, {x+1, 1}, {x, 1}) + HC;
model << HoppingAmplitude(0.1*i, {x+1, 1}, {x, 0}) + HC;
}
model.construct();
solver.setModel(model);
solver.setMode(Solver::ArnoldiIterator::Mode::ShiftAndInvert);
solver.setCentralValue(0.01);
solver.setNumEigenValues(200);
solver.setNumLanczosVectors(400);
solver.setMaxIterations(500);
solver.run();
const double LOWER_BOUND = -1;
const double UPPER_BOUND = 1;
const int RESOLUTION = 200;
PropertyExtractor::ArnoldiIterator propertyExtractor(solver);
propertyExtractor.setEnergyWindow(
LOWER_BOUND,
UPPER_BOUND,
RESOLUTION
);
Plotter plotter;
const double SMOOTHING_SIGMA = 0.02;
const unsigned int SMOOTHING_WINDOW = 51;
Property::DOS dos = propertyExtractor.calculateDOS();
dos = Smooth::gaussian(dos, SMOOTHING_SIGMA, SMOOTHING_WINDOW);
Streams::out << dos << "\n";
plotter.plot(dos);
plotter.save("figures/DOS.png");
= propertyExtractor.calculateLDOS({{_a_, IDX_SUM_ALL}});
ldos = Smooth::gaussian(ldos, SMOOTHING_SIGMA, SMOOTHING_WINDOW);
Streams::out << ldos << "\n";
plotter.clear();
plotter.plot({_a_, IDX_SUM_ALL}, ldos);
plotter.save("figures/LDOS.png");
}

Output

DOS
Lower bound: -1 eV (-1 n.u.)
Upper bound: 1 eV (1 n.u.)
Resolution: 200
LDOS
Number of sites: 401
Lower bound: -1 eV (-1 n.u.)
Upper bound: 1 eV (1 n.u.)
Resolution: 200

Constructor & Destructor Documentation

◆ ArnoldiIterator()

TBTK::PropertyExtractor::ArnoldiIterator::ArnoldiIterator ( Solver::ArnoldiIterator solver)

Constructs a PropertyExtractor::ArnoldiIterator.

Parameters
solverSolver to use.

Member Function Documentation

◆ calculateDOS()

virtual Property::DOS TBTK::PropertyExtractor::ArnoldiIterator::calculateDOS ( )
virtual

Calculate Green's function. Overrides PropertyExtractor::calculateDOS().

Reimplemented from TBTK::PropertyExtractor::PropertyExtractor.

◆ calculateLDOS() [1/2]

virtual Property::LDOS TBTK::PropertyExtractor::ArnoldiIterator::calculateLDOS ( Index  pattern,
Index  ranges 
)
virtual

◆ calculateLDOS() [2/2]

virtual Property::LDOS TBTK::PropertyExtractor::ArnoldiIterator::calculateLDOS ( std::vector< Index patterns)
virtual

◆ calculateSpinPolarizedLDOS() [1/2]

virtual Property::SpinPolarizedLDOS TBTK::PropertyExtractor::ArnoldiIterator::calculateSpinPolarizedLDOS ( Index  pattern,
Index  ranges 
)
virtual

◆ calculateSpinPolarizedLDOS() [2/2]

virtual Property::SpinPolarizedLDOS TBTK::PropertyExtractor::ArnoldiIterator::calculateSpinPolarizedLDOS ( std::vector< Index patterns)
virtual

◆ calculateWaveFunctions()

Property::WaveFunctions TBTK::PropertyExtractor::ArnoldiIterator::calculateWaveFunctions ( std::vector< Index patterns,
std::vector< Subindex states 
)

Calculate wave function.

◆ getAmplitude()

const std::complex< double > TBTK::PropertyExtractor::ArnoldiIterator::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\).

◆ getEigenValue()

double TBTK::PropertyExtractor::ArnoldiIterator::getEigenValue ( int  state)
inline

Get eigenvalue.

◆ getEigenValues()

Property::EigenValues TBTK::PropertyExtractor::ArnoldiIterator::getEigenValues ( )

Get eigenvalues.


The documentation for this class was generated from the following file:
Plotter.h
Plots data.
TBTK::Model
Container of Model related information.
Definition: Model.h:57
TBTK::Property::DOS
Property container for density of states (DOS).
Definition: DOS.h:48
Model.h
Container of Model related information.
TBTK::Solver::ArnoldiIterator::setMaxIterations
void setMaxIterations(int maxIterations)
Definition: ArnoldiIterator.h:299
Streams.h
Streams for TBTK output.
TBTK::Solver::ArnoldiIterator::setMode
void setMode(Mode mode)
Definition: ArnoldiIterator.h:263
TBTK::Solver::ArnoldiIterator::run
void run()
TBTK::Solver::ArnoldiIterator
Solves a Model using Arnoldi iteration.
Definition: ArnoldiIterator.h:60
TBTK::Property::LDOS
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
TBTK::Smooth::gaussian
static Array< DataType > gaussian(const Array< DataType > &data, double sigma, int windowSize)
Definition: Smooth.h:88
TBTK::Initialize
void Initialize()
TBTK::Solver::Solver::setModel
virtual void setModel(Model &model)
Definition: Solver.h:69
TBTK::Solver::ArnoldiIterator::setCentralValue
void setCentralValue(double centralValue)
Definition: ArnoldiIterator.h:303
TBTK::Solver::ArnoldiIterator::setCalculateEigenVectors
void setCalculateEigenVectors(bool calculateEigenVectors)
Definition: ArnoldiIterator.h:279
TBTK::Solver::ArnoldiIterator::setNumLanczosVectors
void setNumLanczosVectors(int numLanczosVectors)
Definition: ArnoldiIterator.h:287
TBTK::HoppingAmplitude
Hopping amplitude from state 'from' to state 'to'.
Definition: HoppingAmplitude.h:53
TBTK::Solver::ArnoldiIterator::setNumEigenValues
void setNumEigenValues(int numEigenValues)
Definition: ArnoldiIterator.h:271
TBTK::Streams::out
static std::ostream out
Definition: Streams.h:70
TBTK::PropertyExtractor::ArnoldiIterator
Extracts physical properties from the Solver::ArnoldiIterator.
Definition: ArnoldiIterator.h:53
TBTK.h
TBTK initialization.
Smooth.h
Collection of functions for smoothing data.
TBTK::Model::construct
void construct()