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
22 %> EQuUs v5.0 or later
28 filename = mfilename('fullpath');
29 [directory, fncname] = fileparts( filename );
37 % setting the width of the lead 1
44 % getting lattice vectors of the triangle lattice
45 cCoordinates = HLead_1.
Read(
'coordinates');
46 a1 = cCoordinates.a*cCoordinates.LatticeConstant;
47 a2 = cCoordinates.b*cCoordinates.LatticeConstant;
49 % nearest neighbour hopping vectors according to Table III in PRB 92 205108
54 % Calculate the energy eigenvalue at a specific K-point
59 %
using the Fourier-transformed Hamiltonian in PRB 92 205108
62 checkpoint = norm( full(H_EQuUs) - full(H_Fourier) );
64 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
67 %%
test of the energy eigenvalues
for lead of width
M>1
68 disp(
'***** test of the energy eigenvalues for lead of width M>1 *****' );
73 % setting the width of the first and second leads
77 % Calculate the energy eigenvalue at a specific K-point
87 % Creating the Hamiltonian of the
M width lead.
90 % Creating the Hamiltonian of the
M=1 width lead.
93 % calculate the eigenvector of Hamiltonai M1
94 eigenvalues_M1 = real(eig(full(Hamiltonian_M1)));
97 eigval = eigenvalues_M1(jdx);
99 difference = eig(full(Hamiltonian_M3)) - ones(size(Hamiltonian_M3,1),1)*eigval;
100 difference = sort( abs(difference),
'ascend' );
102 checkpoint = abs( difference(1) );
103 if checkpoint > 1e-10
104 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
113 % create input structures 114 [Opt, param] = parseInput( 'TMDC_Input_SOC.xml
'); 116 % setting the width of the lead 1 117 param.Leads{1}.M = 1; 119 % create an instance of class CreateLeadHamiltonians to create Hamiltonians 120 HLead_1 = CreateLeadHamiltonians(Opt, param, 'Hanyadik_Lead
',1); 121 HLead_1.CreateHamiltonians(); 123 % getting lattice vectors of the triangle lattice 124 cCoordinates = HLead_1.Read('coordinates
'); 125 a1 = cCoordinates.a*cCoordinates.LatticeConstant; 126 a2 = cCoordinates.b*cCoordinates.LatticeConstant; 128 % reciprocal lattice vectors 129 b1 = 2*pi/cCoordinates.LatticeConstant * [1; 1/sqrt(3)]; 130 b2 = 2*pi/cCoordinates.LatticeConstant * [0; 2/sqrt(3)]; 132 % special points in the BZ 136 % Calculate the Hamiltonian at a specific K-point 137 kvector = 0.36*(Mpoint - GammaPoint); 139 H_EQuUs = HLead_1.MomentumDependentHamiltonian( kvector'*a1, kvector
'*a2); 141 % The spin splitting along the Gamma - M direction is zero. 142 EigenValues = sort(real(eig(full(H_EQuUs)))); 143 DiffEigenValues = diff(EigenValues); 144 DiffEigenValues = DiffEigenValues(1:2:end); 146 checkpoint = norm( DiffEigenValues ); 147 if checkpoint > 1e-10 148 warning(['EQuUs:Tests:
', fncname, ':checkpoint failed with error
', num2str( checkpoint)]); 153 %% test of the energy eigenvalues for lead of width M>1 154 disp( '*****
test of the energy eigenvalues
for lead of width M>1 *****
' ); 156 % create input structures 157 [Opt, param] = parseInput( 'TMDC_Input_SOC.xml
'); 159 % setting the width of the first and second leads 160 param.Leads{1}.M = 1; 161 param.Leads{2}.M = 3; 163 % Calculate the energy eigenvalue at a specific K-point 164 kvector = [0.5; 0.3]; 167 % creating class CreateLeadHamiltonians 168 HLead_2 = CreateLeadHamiltonians(Opt, param, 'Hanyadik_Lead
',2); 170 % creating Hamiltonians 171 HLead_2.CreateHamiltonians(); 173 % Creating the Hamiltonian of the M width lead. 174 Hamiltonian_M3 = HLead_2.MomentumDependentHamiltonian( kvector'*a1, kvector
'*a2*param.Leads{2}.M); 176 % Creating the Hamiltonian of the M=1 width lead. 177 Hamiltonian_M1 = HLead_1.MomentumDependentHamiltonian( kvector'*a1, kvector
'*a2); 179 % calculate the eigenvector of Hamiltonai M1 180 eigenvalues_M1 = real(eig(full(Hamiltonian_M1))); 183 eigval = eigenvalues_M1(jdx); 185 difference = eig(full(Hamiltonian_M3)) - ones(size(Hamiltonian_M3,1),1)*eigval; 186 difference = sort( abs(difference), 'ascend
' ); 188 checkpoint = abs( difference(1) ); 189 if checkpoint > 1e-10 190 warning(['EQuUs:Tests:
', fncname, ':checkpoint failed with error
', num2str( checkpoint)]); 202 %> @brief Calculates the spectrum on a triangle lattice from Fourier-transformed Hamiltonian 203 %> @param kvector a two-component column vector of the momentum vector in the BZ. 204 %> @return Returns with the calculated energy eigenvalue at a specific point determined by kvector. 205 function ret = CalcHamiltonian_k( kvector ) 208 ret = zeros( orbitals_num ); 210 % obtaining derived hopping parameters t_2__i_i 211 t_2__hoppings = param.Leads{1}.Calc_t_2__i_i(); 213 % ******* EQ (4) in <a href="https://journals.aps.org/prb/abstract/10.1103/PhysRevB.92.205108">PRB 92 205108</a> ********* 214 for idx = 1:orbitals_num 216 parameter_extension = ['__
', num2str(idx), '_
', num2str(idx)]; 217 epsilon = param.Leads{1}.(['epsilon
', num2str(idx)]); 218 t_1 = param.Leads{1}.(['t_1
', parameter_extension]); 219 t_2 = t_2__hoppings.(['t_2
', parameter_extension]); 220 ret( idx, idx) = ret( idx, idx) + epsilon + 2*t_1*cos(kvector'*delta1) + 2*t_2*(cos(kvector
'*delta2) + cos(kvector'*delta3));
225 % ******* EQ (5) in <a href="https:
226 % obtaining derived hopping parameters t_2__i_j
227 t_2__hoppings =
param.Leads{1}.Calc_t_2__i_j();
229 % obtaining derived hopping parameters t_3__i_j
230 t_3__hoppings =
param.
Leads{1}.Calc_t_3__i_j();
233 orbital_indexes1 = [3, 6, 9];
234 orbital_indexes2 = [5, 8, 11];
235 for idx = 1:length( orbital_indexes1 )
236 orbital_index1 = orbital_indexes1(idx);
237 orbital_index2 = orbital_indexes2(idx);
239 t_1 =
param.Leads{1}.([
't_1__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
240 t_2 = t_2__hoppings.([
't_2__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
241 t_3 = t_3__hoppings.([
't_3__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
242 ret(orbital_index1, orbital_index2) = ret(orbital_index1, orbital_index2) + 2*t_1*cos(kvector
'*delta1) + ... 243 t_2*( exp(-1i*kvector'*delta2) + exp(-1i*kvector
'*delta3) ) +... 244 t_3*( exp(1i*kvector'*delta2) + exp(1i*kvector
'*delta3) ); 246 ret(orbital_index2, orbital_index1) = ret(orbital_index2, orbital_index1) + 2*t_1*cos(kvector'*delta1) + ...
247 t_2*( exp(1i*kvector
'*delta2) + exp(1i*kvector'*delta3) ) +...
248 t_3*( exp(-1i*kvector
'*delta2) + exp(-1i*kvector'*delta3) );
254 % ******* EQ (6) in <a href="https:
255 % obtaining derived hopping parameters t_2__i_j
256 t_2__hoppings =
param.Leads{1}.Calc_t_2__i_j();
258 % obtaining derived hopping parameters t_3__i_j
259 t_3__hoppings =
param.
Leads{1}.Calc_t_3__i_j();
262 orbital_indexes1 = [1, 3, 4, 6, 7, 9, 10];
263 orbital_indexes2 = [2, 4, 5, 7, 8, 10, 11];
264 for idx = 1:length( orbital_indexes1 )
265 orbital_index1 = orbital_indexes1(idx);
266 orbital_index2 = orbital_indexes2(idx);
268 t_1 =
param.Leads{1}.([
't_1__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
269 t_2 = t_2__hoppings.([
't_2__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
270 t_3 = t_3__hoppings.([
't_3__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
271 ret(orbital_index1, orbital_index2) = ret(orbital_index1, orbital_index2) - 2*1i*t_1*sin(kvector
'*delta1) + ... 272 t_2*( exp(-1i*kvector'*delta2) - exp(-1i*kvector
'*delta3) ) +... 273 t_3*( -exp(1i*kvector'*delta2) + exp(1i*kvector
'*delta3) ); 275 ret(orbital_index2, orbital_index1) = ret(orbital_index2, orbital_index1) + 2*1i*t_1*sin(kvector'*delta1) + ...
276 t_2*( exp(1i*kvector
'*delta2) - exp(1i*kvector'*delta3) ) +...
277 t_3*( -exp(-1i*kvector
'*delta2) + exp(-1i*kvector'*delta3) );
282 % ******* EQ (7) in <a href="https:
283 % obtaining derived hopping parameters t_4__i_j
284 t_4__hoppings =
param.Leads{1}.Calc_t_4__i_j();
288 orbital_indexes1 = [3, 5, 4, 10, 9, 11, 10];
289 orbital_indexes2 = [1, 1, 2, 6, 7, 7, 8];
290 for idx = 1:length( orbital_indexes1 )
291 orbital_index1 = orbital_indexes1(idx);
292 orbital_index2 = orbital_indexes2(idx);
294 t_4 = t_4__hoppings.(['t_4__', num2str(orbital_index1), '_', num2str(orbital_index2)]);
296 ret(orbital_index1, orbital_index2) = ret(orbital_index1, orbital_index2) + t_4*( 1 - exp(1i*kvector'*delta1) );
297 ret(orbital_index2, orbital_index1) = ret(orbital_index2, orbital_index1) + t_4*( 1 - exp(-1i*kvector'*delta1) );
302 % ******* EQ (8) in <a href="https:
305 orbital_indexes1 = [4, 3, 5, 9, 11, 10, 9, 11];
306 orbital_indexes2 = [1, 2, 2, 6, 6, 7, 8, 8];
307 for idx = 1:length( orbital_indexes1 )
308 orbital_index1 = orbital_indexes1(idx);
309 orbital_index2 = orbital_indexes2(idx);
311 t_4 = t_4__hoppings.(['t_4__', num2str(orbital_index1), '_', num2str(orbital_index2)]);
312 t_5 =
param.Leads{1}.([
't_5__', num2str(orbital_index1),
'_', num2str(orbital_index2)]);
314 ret(orbital_index1, orbital_index2) = ret(orbital_index1, orbital_index2) + t_4*( 1 + exp(1i*kvector
'*delta1) ) + ... 315 t_5*exp(1i*kvector'*delta2);
316 ret(orbital_index2, orbital_index1) = ret(orbital_index2, orbital_index1) + t_4*( 1 + exp(-1i*kvector
'*delta1) ) + ... 317 t_5*exp(-1i*kvector'*delta2);
function Read(MemberName)
Query for the value of an attribute in the interface.
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.
Class to create and store Hamiltonian of the translational invariant leads.
function test_TMDC_Monolayer()
Testfile to check the lattice construction of monolayer TMDC by classes TMDC_Monolayer_Lead_Hamiltoni...
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.
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of TMDC_Monol...
Property param
An instance of the structure param.
function CreateLeadHamiltonians(Opt, param, varargin)
Constructor of the class.
Structure param contains data structures describing the physical parameters of the scattering center ...
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of TMDC_Monol...
Property Opt
An instance of structure Opt.
function CalcHamiltonian_k(kvector)
Calculates the spectrum on a triangle lattice from Fourier-transformed Hamiltonian.
function structures(name)