2 % Copyright (C) 2019 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 the skew coupling matrix elements in the transport calculations.
22 %> EQuUs v5.0.144 or later
24 %> @brief Testfile to check the skew coupling matrix elements in the transport calculations. (Constant vector potential and transverse momentum included in the
test)
28 filename = mfilename(
'fullpath');
29 [directory, fncname] = fileparts( filename );
31 % filename containing the input XML
32 inputXML =
'Basic_Input_Graphene_SOC_Lattice.xml';
33 % Parsing the input file and creating data
structures 37 % setting the on-site potentials
42 % staggered A-B potential
47 % setting the Rashba-type SOC
52 % setting the Intrinsic SOC
57 % setting the Valley Zeeman SOC
63 %> length of the junction (number of unit cells)
67 % setting the transverse momentum
70 %% Testing the transport
using the whole Hamiltonian of the scattering region without the vector potential
71 disp(
'***** Testing the transport using the whole Hamiltonian of the scattering region without the vector potential *****' );
73 % turning off the vector potential
77 % creating the
Ribbon class representing the twoterminal setup
78 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
82 %
Transport through the connected leds without the scattering region)
84 conductance_leads =
Transport_q( cRibbon_Leads, [],
false );
87 checkpoint = norm( conductance - conductance_leads );
89 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
92 %% Testing the transport
using the whole Hamiltonian of the scattering region including the vector potential
93 disp(
'***** Testing the transport using the whole Hamiltonian of the scattering region including the vector potential *****' );
95 % turning off the vector potential
99 % creating the
Ribbon class representing the twoterminal setup
100 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
104 %
Transport through the connected leds without the scattering region)
105 cRibbon_Leads =
Ribbon_Leads(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
106 conductance_leads =
Transport_q( cRibbon_Leads, [],
false );
108 checkpoint = norm( conductance - conductance_leads );
110 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
114 %% Testing the transport
using the translational invariant method without the vector potential
115 disp(
'***** Testing the transport using the translational invariant method without the vector potential *****' );
117 % turning off the vector potential
121 % creating the
Ribbon class representing the twoterminal setup
122 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
123 conductance =
Transport_q( cRibbon,
false,
false );
126 %
Transport through the connected leds without the scattering region)
127 cRibbon_Leads =
Ribbon_Leads(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
128 conductance_leads =
Transport_q( cRibbon_Leads, [],
false );
130 checkpoint = norm( conductance - conductance_leads );
132 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
135 %% Testing the transport
using the translational invariant method including the vector potential
136 disp(
'***** Testing the transport using the translational invariant method including the vector potential *****' );
138 % turning off the vector potential
142 % creating the
Ribbon class representing the twoterminal setup
143 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
144 conductance =
Transport_q( cRibbon,
false,
false );
147 %
Transport through the connected leds without the scattering region)
148 cRibbon_Leads =
Ribbon_Leads(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
149 conductance_leads =
Transport_q( cRibbon_Leads, [],
false );
151 checkpoint = norm( conductance - conductance_leads );
153 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
159 %% Testing the transport
using the whole Hamiltonian of the scattering region including the vector potential, comapring to the
self-energy results
160 disp(
'***** Testing the transport using the whole Hamiltonian of the scattering region including the vector potential, comapring to the self-energy results *****' );
162 % turning off the vector potential
166 % creating the
Ribbon class representing the twoterminal setup
167 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
168 conductance_self_energy =
Transport_q( cRibbon,
true,
true );
171 % creating the
Ribbon class representing the twoterminal setup
172 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
175 checkpoint = norm( conductance - conductance_self_energy );
177 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
182 %% Testing the transport
using the whole Hamiltonian of the scattering region including the vector potential, comapring to the
self-energy results
183 disp(
'***** Testing the transport using the translational invariant method including the vector potential, comapring to the self-energy results *****' );
185 % turning off the vector potential
189 % creating the
Ribbon class representing the twoterminal setup
190 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
191 conductance_self_energy =
Transport_q( cRibbon,
false,
true );
194 % creating the
Ribbon class representing the twoterminal setup
195 cRibbon =
Ribbon(
'width', 2,
'height', height,
'Opt',
Opt,
'param',
param,
'q', q );
196 conductance =
Transport_q( cRibbon,
false,
false );
198 checkpoint = norm( conductance - conductance_self_energy );
200 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
205 %> @brief Calculates the transvere momemntum resolved conductance
for a given energy
206 %> @
param Energy The energy value.
207 %> @
param B The magnetic field
208 %> @
param selfEnergy Logical value. Set
true to use the
self energy in the calculations or
false to use the surface Green
operator.
209 function Conductance =
Transport_q( cRibbon_loc, gfininvfromHamiltonian, useSelfEnergy )
211 % creating funcfion handles
for the constant vector potentials
214 % creting the funciton handles of the vector potentials
215 hLandauy = @(x,y)([zeros(size(x)), ones(size(x))*Aconst] );
217 cRibbon_loc.setHandlesForMagneticField(
'scatter', hLandauy,
'lead', hLandauy );
219 % seeting the Energy value in the
Ribbon class 222 % Calculates the surface Green
operator of the scattering region
223 if gfininvfromHamiltonian
224 cRibbon_loc.CalcFiniteGreensFunctionFromHamiltonian();
225 elseif ~gfininvfromHamiltonian
226 cRibbon_loc.CalcFiniteGreensFunction();
229 % creating
function handle for the Dyson Eq.
230 Dysonfunc = @()cRibbon_loc.CustomDysonFunc(
'constant_channels',
false,
'SelfEnergy', useSelfEnergy );
232 % Evaluate the Dyson Eq.
233 cRibbon_loc.FL_handles.DysonEq(
'CustomDyson', Dysonfunc );
235 % Calculating the Scattering matrix
236 cRibbon_loc.FL_handles.SmatrixCalc();
238 % Calculate the conductance
239 Conductance = cRibbon_loc.FL_handles.Conduktance();
241 Conductance = Conductance(1,2);
243 %disp( [
'E = ', num2str(Energy),
' conductance = ', num2str(Conductance)])
function test(arg1, arg2)
Brief description of the function.
function test_skew_coupling()
Testfile to check the skew coupling matrix elements in the transport calculations....
lead_param Leads
A list of structures lead_param containing the physical parameters for the scattering region.
function setEnergy(Energy)
Sets the energy for the calculations.
Property q
The tranverse momentum for transverse computations.
magnetic_field_trans_invariant
Set true (default) if a magnetic field is translational invariant along the scattering center,...
Structure Opt contains the basic computational parameters used in EQuUs.
A class for calculations on a ribbon of finite width for equilibrium calculations mostly in the zero ...
Property version
The current version of the package.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
function Transport_q(cRibbon_loc, gfininvfromHamiltonian, useSelfEnergy)
length of the junction (number of unit cells)
Property param
An instance of the structure param.
Structure param contains data structures describing the physical parameters of the scattering center ...
scatter_param scatter
An instance of the structure scatter_param containing the physical parameters for the scattering regi...
Property Opt
An instance of structure Opt.
function test_CreateHamiltonians()
Testfile to check functionalities of the class CreateHamiltonians.
magnetic_field
Set true if a magnetic field is involved in the calculations, false (default) otherwise.
function structures(name)