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 Nambu space representation
22 %> EQuUs v4.9 or later
24 %> @brief Testfile to check functionalities related to Nambu space representation
27 filename = mfilename('fullpath');
28 [directory, fncname] = fileparts( filename );
33 % defining the width of the lead 1
34 param.Leads{1}.M = 10;
38 % number of bands in the calculated spectra
41 % logival value deciding whether to plot the calculated spctra or not
44 % The temperature in Kelvins
48 disp( '*****
test of functionalities related to Nambu space calculations *****
' ); 50 % turning off Bogoliubov de Gennes model 53 % create an instance of class Lead_Keldysh of a normal system 54 cLead_K_normal = Lead_Keldysh(Opt, param, 'Hanyadik_Lead', 1, 'T', T ); 56 % create normal Hamiltonians 57 cLead_K_normal.CreateHamiltonians(); 58 spectrum_normal = cLead_K_normal.CalcSpektrum('ka_min
', 1.8, 'ka_max
', 2.5, 'ka_num
', 100, 'toPlot
', PlotSpectra, 'offset
', 0, 'db
', bandNum); 61 % turning on Bogoliubov de Gennes model 64 % setting the superconducting pair potential in lead 1 to zero 65 param.Leads{1}.pair_potential = 0.4; 67 % create an instance of class Lead_Keldysh of a BdG model 68 cLead_K_BdG = Lead_Keldysh(Opt, param, 'Hanyadik_Lead', 1, 'T', T); 70 % create BdG Hamiltonians 71 cLead_K_BdG.CreateHamiltonians(); 72 spectrum_BdG = cLead_K_BdG.CalcSpektrum('ka_min
', 1.8, 'ka_max
', 2.5, 'ka_num
', 100, 'toPlot
', PlotSpectra, 'offset
', 0, 'db
', 2*bandNum); 75 % calculating manually the spectrum in the BdG model from the normal spectrum 76 spectrum_manual = sqrt((spectrum_normal(:,2)).^2 + abs(param.Leads{1}.pair_potential)^2); 77 spectrum_manual = [spectrum_manual; -spectrum_manual]; 79 spectrum_manual = [ [spectrum_normal(:,1); spectrum_normal(:,1)], spectrum_manual ]; 83 % plot( spectrum_manual(:,1), spectrum_manual(:,2), '.
') 84 % plot( spectrum_BdG(:,1), spectrum_BdG(:,2), 'r.
') 86 checkpoint = norm(sort( spectrum_BdG(:,2) ) - sort(spectrum_manual(:,2))); 88 warning(['EQuUs:Tests:
', fncname, ':checkpoint failed with error
', num2str( checkpoint)]); 91 % H0_normal = cLead_K_normal.Read('H0'); 92 % H0_manual = [H0_normal, eye(size(H0_normal))*param.Leads{1}.pair_potential; eye(size(H0_normal))*param.Leads{1}.pair_potential, -H0_normal]; 93 % H0_BdG = cLead_K_BdG.Read('H0'); 94 % norm(full(H0_manual-H0_BdG)) 97 % H1_normal = cLead_K_normal.Read('H1'); 98 % H1_manual = [H1_normal, zeros(size(H1_normal)); zeros(size(H1_normal)), -H1_normal]; 99 % H1_BdG = cLead_K_BdG.Read('H1'); 100 % norm(full(H1_manual-H1_BdG)) 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.
Property T
The temperature in Kelvin.
Property Hanyadik_Lead
The id number of the current lead.
Structure Opt contains the basic computational parameters used in EQuUs.
Property H1
The coupling Hamiltonian between the unit cells.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
function test_Nambu()
Testfile to check functionalities related to Nambu space representation.
A class to calculate the Keldysh lesser and greater Green functions and self energies of a translatio...
Structure param contains data structures describing the physical parameters of the scattering center ...
Property H0
The Hamiltonian of a unit cell.
function structures(name)