TBTK
Need a break? Support the development by playing Polarity Puzzles
ChebyshevExpander

Hamiltonian

\(H = -\mu\sum_{\mathbf{i}}c_{\mathbf{i}}^{\dagger}c_{\mathbf{i}} + t\sum_{\langle \mathbf{i}\mathbf{j}\rangle}c_{\mathbf{i}}^{\dagger}c_{\mathbf{j}}\)

Code

#include "TBTK/Smooth.h"
#include "TBTK/TBTK.h"
#include <complex>
using namespace std;
using namespace TBTK;
using namespace Visualization::MatPlotLib;
complex<double> i(0, 1);
int main(){
//Initialize TBTK.
//Parameters.
const unsigned int SIZE_X = 10;
const unsigned int SIZE_Y = 10;
const double t = -1;
const double mu = 0;
//Set up the Model.
Model model;
for(unsigned int x = 0; x < SIZE_X; x++){
for(unsigned int y = 0; y < SIZE_Y; y++){
if(x+1 < SIZE_X){
model << HoppingAmplitude(
t,
{x+1, y},
{x, y}
) + HC;
}
if(y+1 < SIZE_Y){
model << HoppingAmplitude(
t,
{x, y+1},
{x, y}
) + HC;
}
}
}
model.construct();
//Set up the Solver.
const double SCALE_FACTOR = 5;
const unsigned int NUM_COEFFICIENTS = 500;
solver.setModel(model);
solver.setScaleFactor(SCALE_FACTOR);
solver.setNumCoefficients(NUM_COEFFICIENTS);
solver.setUseLookupTable(true);
//Set up the PropertyExtractor.
const unsigned int ENERGY_RESOLUTION = 1000;
PropertyExtractor::ChebyshevExpander propertyExtractor(solver);
propertyExtractor.setEnergyWindow(
-SCALE_FACTOR,
SCALE_FACTOR,
ENERGY_RESOLUTION
);
//Calculate the local density of states(LDOS).
Property::LDOS ldos = propertyExtractor.calculateLDOS({{_a_, _a_}});
//Plot the LDOS.
Plotter plotter;
plotter.plot({_a_, SIZE_Y/2}, ldos);
plotter.save("figures/LDOS.png");
}

Output

Plotter.h
Plots data.
TBTK::Solver::ChebyshevExpander::setCalculateCoefficientsOnGPU
void setCalculateCoefficientsOnGPU(bool calculateCoefficientsOnGPU)
Definition: ChebyshevExpander.h:565
TBTK::Model
Container of Model related information.
Definition: Model.h:57
TBTK::Solver::ChebyshevExpander::setScaleFactor
void setScaleFactor(double scaleFactor)
Definition: ChebyshevExpander.h:492
TBTK::Property::LDOS
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
TBTK::Model::setChemicalPotential
void setChemicalPotential(double chemicalPotential)
Definition: Model.h:347
TBTK::Solver::ChebyshevExpander::setUseLookupTable
void setUseLookupTable(bool useLookupTable)
Definition: ChebyshevExpander.h:585
TBTK::Initialize
void Initialize()
TBTK::Solver::Solver::setModel
virtual void setModel(Model &model)
Definition: Solver.h:69
ChebyshevExpander.h
Solves a Model using the Chebyshev method.
DOS.h
Property container for density of states (DOS).
TBTK::PropertyExtractor::ChebyshevExpander
Extracts physical properties from Solver::ChebyshevExpander.
Definition: ChebyshevExpander.h:51
TBTK::Solver::ChebyshevExpander
Solves a Model using the Chebyshev method.
Definition: ChebyshevExpander.h:69
TBTK::HoppingAmplitude
Hopping amplitude from state 'from' to state 'to'.
Definition: HoppingAmplitude.h:53
TBTK::Solver::ChebyshevExpander::setNumCoefficients
void setNumCoefficients(int numCoefficients)
Definition: ChebyshevExpander.h:505
ChebyshevExpander.h
Extracts physical properties from the ChebyshevExpander.
TBTK.h
TBTK initialization.
Smooth.h
Collection of functions for smoothing data.
TBTK::Model::construct
void construct()
TBTK::Solver::ChebyshevExpander::setGenerateGreensFunctionsOnGPU
void setGenerateGreensFunctionsOnGPU(bool generateGreensFunctionsOnGPU)
Definition: ChebyshevExpander.h:575