Eötvös Quantum Utilities  v5.0.144
Providing the Horsepowers in the Quantum Realm
NS_NEGF.m
Go to the documentation of this file.
1 %% Energy resolved current density across a biased normal-superconductor interface
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 Examples
18 %> @{
19 %> @file NS_NEGF.m
20 %> @brief Example to calculate the energy resolved current density across a biased normal-superconductor interface
21 %> @param filenum The identification number of the filenema for the exported data (default is 1).
22 %> @Available
23 %> EQuUs v4.9 or later
24 %> @expectedresult
25 %> @image html NS_NEGF.jpg
26 %> @image latex NS_NEGF.jpg
27 %> @}
28 %
29 %> @brief Example to calculate the energy resolved current density across a biased normal-superconductor interface
30 %> @param filenum The identification number of the filenema for the exported data (default is 1).
31 function NS_NEGF( filenum )
32 
33 if ~exist('filenum', 'var')
34  filenum = 1;
35 end
36 
37 filename = mfilename('fullpath');
38 [directory, fncname] = fileparts( filename );
39 
40 % filename containing the output XML
41 outfilename = [fncname, '_',num2str( filenum )];
42 % the output folder
43 outputdir = [];
44 
45 % filename of the input parametersubuntu download usb installer
46 filenameIn = [fncname, '.xml'];
47 
48 % The width of the junction
49 width = 40;
50 
51 % The length of the junction
52 height = 4;
53 
54 % number of energy points on the energy contour
55 Edb = 111;
56 % the superconducting pair potential
57 pair_potential = 0.1;
58 
59 % loading data structures from the input XML
60 [Opt, param] = parseInput( fullfile( pwd, filenameIn) );
61 
62 % set the width and length of the junction
63 setShape()
64 
65 % creating the output directory
67 
68 % the energy array
69 Evec = [];
70 % the calculated current through the contacts
71 currentsurf = [];
72 
73 % calculate the Josephson current
75 
76 % Plot the calculated results
77 PlotFunction( );
78 
79 
80 %% setWidth
81 %> @brief setting the width and length of the junction
82  function setShape()
83 
84  for idx = 1:length( param.Leads )
85  param.Leads{idx}.M = width;
86  end
87 
88  param.scatter.shape.width = width;
89  param.scatter.shape.height = height;
90 
91  end
92 
93 %% CalculateJosephson
94  function CalculateNSCurrent()
95 
96  % turning on the BdG model
97  Opt.BdG = 1;
98 
99  % bias leads
100  bias_leads = [0.00 0.15];
101 
102  % chemical potential in the central device
103  EF = 0;
104 
105  % set new temperature value
106  T = 0;
107 
108  % setting the superconducting pair potentials in the leads
109  param.Leads{1}.pair_potential = pair_potential;
110  param.Leads{2}.pair_potential = 0;
111 
112  param.scatter.pair_potential = pair_potential;
113 
114  % creating the NTerminal class
115  cRibbon_K = Ribbon_Keldysh('Opt', Opt, 'param', param, 'filenameOut', fullfile( outputdir, [outfilename, 'xml']), ...
116  'EF', EF, 'bias_leads', bias_leads, 'T', T);
117 
118  % creating class to calculate the Josephson effect
119  cCurrent_NEGF = Current_NEGF(Opt, 'junction', cRibbon_K, 'T', T, 'gfininvfromHamiltonian', true );
120 
121  % calculating the Josephson current
122  DeltaPhi_vec = 0;
123  [currentvec, currentsurf, Evec] = cCurrent_NEGF.CurrentCalc_discrete( DeltaPhi_vec, 'Emin', EF-0.9*pair_potential, 'Emax', EF+1.45*pair_potential, 'Edb', Edb );
124 
125 
126  end
127 
128 
129 %% PlotFunction
130 %> @brief Creates the plot
131  function PlotFunction( )
132 
133 
134  % creating figure in units of pixels
135  figure1 = figure( 'Units', 'Pixels', 'Visible', 'off');
136 
137  % font size on the figure will be 16 points
138  fontsize = 16;
139 
140  %************** conductance **********************
141 
142  % creating axes of the plot
143  axes_cond = axes('Parent',figure1, ...
144  'Visible', 'on',...
145  'FontSize', fontsize,...
146  'Box', 'on',...
147  'Units', 'Pixels', ...
148  'FontName','Times New Roman');
149  hold on;
150 
151  % plot the data
152  plot(Evec*1000, real(currentsurf(:,2)), 'Linewidth', 2, 'color', [0 0 0], 'Parent', axes_cond);
153 
154 
155 
156  % Create xlabel
157  xlabel('$$E\;[meV]$$','FontSize', fontsize, 'Interpreter', 'latex', 'FontName','Times New Roman', 'Parent', axes_cond);
158 
159  % Create ylabel
160  ylabel('$$I\;[2e^2\Delta/\hbar]$$','FontSize', fontsize, 'Interpreter', 'latex', 'FontName','Times New Roman', 'Parent', axes_cond);
161 
162  figure_pos = get( figure1, 'Position' );
163 
164  %set the position of the axis
165  OuterPosition = get(axes_cond, 'OuterPosition');
166  OuterPosition(1) = 0;
167  OuterPosition(2) = 0;
168  OuterPosition(3) = figure_pos(3);
169  OuterPosition(4) = figure_pos(4);
170  set(axes_cond, 'OuterPosition', OuterPosition);
171  Position_cond = get(axes_cond, 'OuterPosition') - get(axes_cond, 'TightInset') * [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1];
172  set(axes_cond, 'Position', Position_cond);
173 
174  % setting the position and margins of the plot, removing white
175  % spaces for release dates greater than 2015
176  ver = version('-release');
177  if str2num(ver(1:4)) >= 2016
178  % setting the position and margins of the plot, removing white spaces
179  figure1.PaperPositionMode = 'auto';
180  fig_pos = figure1.PaperPosition;
181  figure1.PaperSize = [fig_pos(3) fig_pos(4)];
182  end
183 
184 
185  % export the figures
186  print('-depsc2', fullfile(outputdir,[outfilename, '.eps']))
187  print('-dpdf', fullfile(outputdir,[outfilename, '.pdf']))
188  close(figure1)
189 
190 
191  end
192 
193 
194 
195 
196 
197 
198 
199 %% sets the output directory
200  function setOutputDir()
201 
202  % determine the directory for the results
203  resultsdir = fullfile(pwd, 'results');
204  % determine the working directory
205  workingdir = fullfile(pwd);
206 
207  % creating the working directory
208  mkdir(workingdir);
209  % creating the results directory
210  mkdir(resultsdir );
211  outputdir = resultsdir;
212 
213  end
214 
215 
216 
217 
218  end
A class representing a two-terminal structure defined on a preprogrammed lattices for steady state no...
A class describing an N-terminal geometry for equilibrium calculations mostly in the zero temperature...
Definition: NTerminal.m:38
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
function CalculateNSCurrent()
function setOutputDir()
function PlotFunction()
Creates the plot.
BdG
Set 1 to use the Bogoliubov de Gennes model, 0 (default) for normal systems.
Definition: structures.m:64
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
scatter_param scatter
An instance of the structure scatter_param containing the physical parameters for the scattering regi...
Definition: structures.m:47
function setShape()
setting the width and length of the junction
function parseInput(filename)
This function parses the input file containing the input parameters.
An example to calculate the DC current at a non-equilibrium normal-superconductor interface.
Definition: Current_NEGF.m:23
function structures(name)
function NS_NEGF(filenum)
Example to calculate the energy resolved current density across a biased normal-superconductor interf...