Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
test_Nambu.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_Nambu.m
20 %> @brief Testfile to check functionalities related to Nambu space representation
21 %> @Available
22 %> EQuUs v4.9 or later
23 %> @}
24 %> @brief Testfile to check functionalities related to Nambu space representation
25 function test_Nambu()
26 
27 filename = mfilename('fullpath');
28 [directory, fncname] = fileparts( filename );
29 
30  % create input structures
31  [Opt, param] = parseInput( 'Input_Ribbon.xml');
32 
33  % defining the width of the lead 1
34  param.Leads{1}.M = 10;
35 
36  param.Leads{1}.epsilon = 0.3;
37 
38  % number of bands in the calculated spectra
39  bandNum = param.Leads{1}.M*2;
40 
41  % logival value deciding whether to plot the calculated spctra or not
42  PlotSpectra = false;
43 
44  % The temperature in Kelvins
45  T = 10;
46 
47  %% test of the class Lead_Keldysh
48  disp( '***** test of functionalities related to Nambu space calculations *****' );
49 
50  % turning off Bogoliubov de Gennes model
51  Opt.BdG = false;
52 
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 );
55 
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);
59 
60 
61  % turning on Bogoliubov de Gennes model
62  Opt.BdG = true;
63 
64  % setting the superconducting pair potential in lead 1 to zero
65  param.Leads{1}.pair_potential = 0.4;
66 
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);
69 
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);
73 
74 
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];
78 
79  spectrum_manual = [ [spectrum_normal(:,1); spectrum_normal(:,1)], spectrum_manual ];
80 
81 % figure
82 % hold on
83 % plot( spectrum_manual(:,1), spectrum_manual(:,2), '.')
84 % plot( spectrum_BdG(:,1), spectrum_BdG(:,2), 'r.')
85 
86  checkpoint = norm(sort( spectrum_BdG(:,2) ) - sort(spectrum_manual(:,2)));
87  if checkpoint > 1e-10
88  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
89  end
90 
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))
95 %
96 %
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))
101 
102 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
Property T
The temperature in Kelvin.
Definition: FermiDirac.m:35
Property Hanyadik_Lead
The id number of the current lead.
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
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...
Definition: Lead_Keldysh.m:29
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
Property H0
The Hamiltonian of a unit cell.
function parseInput(filename)
This function parses the input file containing the input parameters.
function structures(name)