Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
test_LatticeTriangle.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities
2 % Copyright (C) 2018 Peter Rakyta, Ph.D
3 %
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.
8 %
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.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with this program. If not, see http://www.gnu.org/licenses/.
16 %
17 %> @addtogroup unit_tests Unit Tests
18 %> @{
19 %> @file test_LatticeTriangle.m
20 %> @brief Testfile to check functionalities related to calculations performed on triangle lattice
21 %> @Available
22 %> EQuUs v4.9 or later
23 %> @}
24 %> @brief Testfile to check functionalities related to calculations performed on triangle lattice
25 function test_LatticeTriangle()
26 
27 filename = mfilename('fullpath');
28 [directory, fncname] = fileparts( filename );
29 
30  % creating the shape of the scattering region
32  shape.width=1;
33  shape.height=10;
34 
35  % create input structures
36  [Opt, param] = parseInput( 'Basic_Input_Triangle_Lattice.xml');
37  param.scatter.shape=shape;
38 
39  % creating class CreateLeadHamiltonians
40  cCreateLeadHamiltonians = CreateLeadHamiltonians(Opt, param, 'Hanyadik_Lead',[]);
41 
42  % creating Hamiltonians
43  cCreateLeadHamiltonians.CreateHamiltonians();
44  %cCreateLeadHamiltonians.CalcSpektrum('ka_min', -1, 'ka_max', 1, 'ka_num', 100, 'toPlot', true)
45 
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;
50 
51  % nearest neighbour hopping vectors according to Table III in PRB 92 205108
52  delta1 = a1;
53  delta2 = a1 + a2;
54  delta3 = a2;
55 
56  % reciprocal lattice vectors
57  b1 = 2*pi/cCoordinates.LatticeConstant * [1; 1/sqrt(3)];
58  b2 = 2*pi/cCoordinates.LatticeConstant * [0; 2/sqrt(3)];
59 
60  % special points
61  GammaPoint = [0;0];
62  KPoint_p = (2*b1-b2)/3;
63  KPoint_m = -(2*b1-b2)/3;
64  MPoint = b1/2;
65 
66  %% test of the Fourier transformed Hamiltonians
67  disp( '***** test the energy eigenvalues at specific k-points *****' );
68 
69  % Calculate the energy eigenvalue at a specific K-point
70  kvector = GammaPoint;
71  % using EQuUs
72  Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
73 
74  % using the Fourier-transformed Hamiltonian
75  Spectrum_Fourier = SpectrumCalc( kvector );
76 
77  checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
78  if checkpoint > 1e-10
79  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
80  end
81 
82  % Calculate the energy eigenvalue at a specific K-point
83  kvector = KPoint_p;
84  % using EQuUs
85  Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
86 
87  % using the Fourier-transformed Hamiltonian
88  Spectrum_Fourier = SpectrumCalc( kvector );
89 
90  checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
91  if checkpoint > 1e-10
92  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
93  end
94 
95 
96  % Calculate the energy eigenvalue at a specific K-point
97  kvector = KPoint_m;
98  % using EQuUs
99  Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
100 
101  % using the Fourier-transformed Hamiltonian
102  Spectrum_Fourier = SpectrumCalc( kvector );
103 
104  checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
105  if checkpoint > 1e-10
106  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
107  end
108 
109 
110  % Calculate the energy eigenvalue at a specific K-point
111  kvector = MPoint;
112  % using EQuUs
113  Spectrum_EQuUs = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
114 
115  % using the Fourier-transformed Hamiltonian
116  Spectrum_Fourier = SpectrumCalc( kvector );
117 
118  checkpoint = abs( Spectrum_EQuUs - Spectrum_Fourier );
119  if checkpoint > 1e-10
120  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
121  end
122 
123 
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 *****' );
126 
127  % Calculate the energy eigenvalue at a specific K-point
128  kvector = 0.3*KPoint_p + 0.7*MPoint;
129 
130 
131  % setting the width of the first lead
132  param.Leads{1}.M = 3;
133 
134  % creating class CreateLeadHamiltonians
135  cCreateLeadHamiltonians_Lead = CreateLeadHamiltonians(Opt, param, 'Hanyadik_Lead',1);
136 
137  % creating Hamiltonians
138  cCreateLeadHamiltonians_Lead.CreateHamiltonians();
139 
140  % Creating the Hamiltonian of the M width lead.
141  Hamiltonian_M3 = cCreateLeadHamiltonians_Lead.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2*param.Leads{1}.M);
142 
143  % Creating the Hamiltonian of the M=1 width lead.
144  Hamiltonian_M1 = cCreateLeadHamiltonians.MomentumDependentHamiltonian( kvector'*a1, kvector'*a2);
145 
146  difference = eig(full(Hamiltonian_M3)) - ones(param.Leads{1}.M,1)*eig(full(Hamiltonian_M1));
147  difference = sort( abs(difference), 'ascend' );
148 
149  checkpoint = abs( difference(1) );
150  if checkpoint > 1e-10
151  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
152  end
153 
154 
155 %% SpectrumCalc
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.
159  function ret = SpectrumCalc( kvector )
160  parameters = param.scatter;
161  epsilon = parameters.epsilon;
162  vargamma = parameters.vargamma;
163 
164  ret = epsilon + 2*vargamma*( cos(kvector'*delta1) + cos(kvector'*delta2) + cos(kvector'*delta3) );
165 
166  end
167 
168 end
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.
Definition: structures.m:49
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
Structure shape contains data about the geometry of the scattering region.
Definition: structures.m:106
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 ...
Definition: structures.m:45
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...
Definition: structures.m:47
function SpectrumCalc(kvector)
Calculates the spectrum on a triangle lattice from Fourier-transformed Hamiltonian.
function parseInput(filename)
This function parses the input file containing the input parameters.
function structures(name)
A class to create and store Hamiltonian of the scattering region.