2 % Copyright (C) 2018 Peter Rakyta, Ph.D
4 % This program is free software: you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation, either
version 3 of the License, or
7 % (at your option) any later
version.
9 % This program is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License
for more details.
14 % You should have received a copy of the GNU General Public License
15 % along with
this program. If not, see http:
17 %> @addtogroup unit_tests Unit Tests
20 %> @brief Testfile to check functionalities related to calculations performed on triangle lattice
22 %> EQuUs v4.9 or later
24 %> @brief Testfile to check functionalities related to calculations performed on triangle lattice
27 filename = mfilename('fullpath');
28 [directory, fncname] = fileparts( filename );
30 % creating the
shape of the scattering region
44 %cCreateLeadHamiltonians.CalcSpektrum('ka_min', -1, 'ka_max', 1, 'ka_num', 100, 'toPlot', true)
46 % getting lattice vectors of the triangle lattice
47 cCoordinates = cCreateLeadHamiltonians.Read('coordinates');
48 a1 = cCoordinates.a*cCoordinates.LatticeConstant;
49 a2 = cCoordinates.b*cCoordinates.LatticeConstant;
51 % nearest neighbour hopping vectors according to Table III in PRB 92 205108
56 % reciprocal lattice vectors
57 b1 = 2*pi/cCoordinates.LatticeConstant * [1; 1/sqrt(3)];
58 b2 = 2*pi/cCoordinates.LatticeConstant * [0; 2/sqrt(3)];
62 KPoint_p = (2*b1-b2)/3;
63 KPoint_m = -(2*b1-b2)/3;
67 disp( '*****
test the energy eigenvalues at specific k-points *****' );
69 % Calculate the energy eigenvalue at a specific K-point
72 Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
74 % using the Fourier-transformed Hamiltonian
77 checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
79 warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
82 % Calculate the energy eigenvalue at a specific K-point
85 Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
87 % using the Fourier-transformed Hamiltonian
90 checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
92 warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
96 % Calculate the energy eigenvalue at a specific K-point
99 Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
101 % using the Fourier-transformed Hamiltonian
104 checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
105 if checkpoint > 1e-10
106 warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
110 % Calculate the energy eigenvalue at a specific K-point
113 Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
115 % using the Fourier-transformed Hamiltonian
118 checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
119 if checkpoint > 1e-10
120 warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
124 %%
test of the energy eigenvalues for lead of width M>1
125 disp( '*****
test of the energy eigenvalues for lead of width M>1 *****' );
127 % Calculate the energy eigenvalue at a specific K-point
128 kvector = 0.3*KPoint_p + 0.7*MPoint;
131 % setting the width of the first lead
132 param.Leads{1}.M = 3;
140 % Creating the Hamiltonian of the
M width lead.
143 % Creating the Hamiltonian of the
M=1 width lead.
144 Hamiltonian_M1 = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector
'*a1, kvector'*a2);
146 difference = eig(full(Hamiltonian_M3)) - ones(
param.
Leads{1}.M,1)*eig(full(Hamiltonian_M1));
147 difference = sort( abs(difference),
'ascend' );
149 checkpoint = abs( difference(1) );
150 if checkpoint > 1e-10
151 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
156 %> @brief Calculates the spectrum on a triangle lattice from Fourier-transformed Hamiltonian
157 %> @
param kvector a two-component column vector of the momentum vector in the BZ.
158 %> @
return Returns with the calculated energy eigenvalue at a specific point determined by kvector.
161 epsilon = parameters.epsilon;
162 vargamma = parameters.vargamma;
164 ret = epsilon + 2*vargamma*( cos(kvector
'*delta1) + cos(kvector'*delta2) + cos(kvector
'*delta3) ); function test(arg1, arg2)
Brief description of the function.
lead_param Leads
A list of structures lead_param containing the physical parameters for the scattering region.
Structure Opt contains the basic computational parameters used in EQuUs.
Structure shape contains data about the geometry of the scattering region.
Class to create and store Hamiltonian of the translational invariant leads.
Property version
The current version of the package.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
Property M
The number of the sites in the cross section.
function Hamiltonians(varargin)
Function to create the custom Hamiltonians for the 1D chain.
function MomentumDependentHamiltonian(k, q)
Construct a momentum dependent (Fourier-transformed) Hamiltonian.
function CreateHamiltonians(varargin)
Creates the Hamiltonians H_0 and H_1 of the lead.
function CreateLeadHamiltonians(Opt, param, varargin)
Constructor of the class.
Structure param contains data structures describing the physical parameters of the scattering center ...
function test_LatticeTriangle()
Testfile to check functionalities related to calculations performed on triangle lattice.
scatter_param scatter
An instance of the structure scatter_param containing the physical parameters for the scattering regi...
function SpectrumCalc(kvector)
Calculates the spectrum on a triangle lattice from Fourier-transformed Hamiltonian.
function structures(name)
A class to create and store Hamiltonian of the scattering region.