TBTK
Need a break? Support the development by playing Polarity Puzzles
Superconducting vortex (Caroli-de Gennes-Matricon)

Hamiltonian

\(H = -\mu\sum_{\mathbf{i}}\left(c_{\mathbf{i}\uparrow}^{\dagger}c_{\mathbf{i}\uparrow} - c_{\mathbf{i}\downarrow}c_{\mathbf{i}\downarrow}^{\dagger}\right) + t\sum_{\langle\mathbf{i}\mathbf{j}\rangle}\left(c_{\mathbf{i}\uparrow}^{\dagger}c_{\mathbf{j}\uparrow} - c_{\mathbf{i}\downarrow}c_{\mathbf{j}\downarrow}^{\dagger}\right) + \sum_{\mathbf{i}}\left(\Delta(\mathbf{i}) c_{\mathbf{i}\uparrow}^{\dagger}c_{\mathbf{i}\downarrow}^{\dagger} + \Delta^{*}(\mathbf{i})c_{\mathbf{i}\downarrow}c_{\mathbf{i}\uparrow}\right)\)

Code

#include "TBTK/PropertyExtractor/Diagonalizer.h"
#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 = 31;
const unsigned int SIZE_Y = 31;
const double t = -1;
const double mu = -2;
const double Delta = 0.5;
//Set up the Model.
Model model;
for(unsigned int x = 0; x < SIZE_X; x++){
for(unsigned int y = 0; y < SIZE_Y; y++){
for(unsigned int ph = 0; ph < 2; ph++){
model << HoppingAmplitude(
-mu*(1. - 2*ph),
{x, y, ph},
{x, y, ph}
);
if(x+1 < SIZE_X){
model << HoppingAmplitude(
t*(1. - 2*ph),
{x+1, y, ph},
{x, y, ph}
) + HC;
}
if(y+1 < SIZE_Y){
model << HoppingAmplitude(
t*(1. - 2*ph),
{x, y+1, ph},
{x, y, ph}
) + HC;
}
}
double X = x - SIZE_X/2.;
double Y = y - SIZE_Y/2.;
double R = sqrt(X*X + Y*Y);
model << HoppingAmplitude(
Delta*exp(i*atan2(Y, X))*tanh(R),
{x, y, 1},
{x, y, 0}
) + HC;
}
}
model.construct();
//Set up the Solver.
solver.setModel(model);
solver.run();
//Set up the PropertyExtractor.
const double LOWER_BOUND = -1.5;
const double UPPER_BOUND = 1.5;
const unsigned int RESOLUTION = 1000;
PropertyExtractor::Diagonalizer propertyExtractor(solver);
propertyExtractor.setEnergyWindow(
LOWER_BOUND,
UPPER_BOUND,
RESOLUTION
);
//Calculate the density of states (DOS).
Property::LDOS ldos = propertyExtractor.calculateLDOS({
{_a_, SIZE_Y/2, IDX_SUM_ALL}
});
//Smooth the LDOS.
const double SMOOTHING_SIGMA = 0.01;
const unsigned int SMOOTHING_WINDOW = 201;
ldos = Smooth::gaussian(ldos, SMOOTHING_SIGMA, SMOOTHING_WINDOW);
//Plot the DOS.
Plotter plotter;
plotter.setNumContours(100);
plotter.plot(
{_a_, SIZE_Y/2, IDX_SUM_ALL},
ldos
);
plotter.save("figures/LDOS.png");
}

Output

Plotter.h
Plots data.
TBTK::Model
Container of Model related information.
Definition: Model.h:57
TBTK::Solver::Diagonalizer
Solves a Model using diagonalization.
Definition: Diagonalizer.h:52
TBTK::Property::LDOS
Property container for the local density of states (LDOS).
Definition: LDOS.h:48
TBTK::PropertyExtractor::Diagonalizer
Extracts physical properties from the Solver::Diagonalizer.
Definition: Diagonalizer.h:55
TBTK::Solver::Diagonalizer::run
void run()
Diagonalizer.h
Solves a Model using diagonalization.
TBTK::Initialize
void Initialize()
TBTK::Solver::Solver::setModel
virtual void setModel(Model &model)
Definition: Solver.h:69
DOS.h
Property container for density of states (DOS).
TBTK::Math::sqrt
Array< DataType > sqrt(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:831
TBTK::Math::tanh
Array< DataType > tanh(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:676
TBTK::HoppingAmplitude
Hopping amplitude from state 'from' to state 'to'.
Definition: HoppingAmplitude.h:53
TBTK::Math::exp
Array< DataType > exp(const Array< DataType > &array)
Definition: ArrayAlgorithms.h:757
TBTK.h
TBTK initialization.
Smooth.h
Collection of functions for smoothing data.
TBTK::Model::construct
void construct()