1 % Spectral density
function in superconductor-graphene-superconductor junctions.
2 % Copyright (C) 2015 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 Examples
20 %> @brief Example to calculate the spectral density
function in a superconductor-graphene-superconductor junction.
21 %> @
param filenum The identification number of the filenema
for the exported data (
default is 1).
23 %> EQuUs v4.7 or later
29 %> @brief Example to calculate the spectral density
function in a superconductor-graphene-superconductor junction.
30 %> @
param filenum The identification number of the filenema
for the exported data (
default is 1).
34 if ~exist(
'filenum',
'var')
38 filename = mfilename('fullpath');
39 [directory, fncname] = fileparts( filename );
41 % filename containing the input XML
42 inputXML = 'Basic_Input_zigzag_leads.xml';
43 % Parsing the input file and creating data
structures 46 % filename containing the output XML
47 outfilename = [fncname, '_',num2str( filenum )];
51 % The width of the unit cell
53 % The length of the graphene strip
56 % setting the output directory
59 % outfilename to export the running parameters
60 outputXML = fullfile(outputdir, [outfilename, '.xml']);
62 % carbon-carbon atom distance
64 % the phase difference between the superconducting contacts
66 % The Fermi energy in the scattering region
68 % imaginary part of the Fermi energy
70 % parameter for the doping profile
71 surfacePotential = 0.1; %in eV
73 % setting the phase of the superconducting pair potentials
78 % creating array containing the pair potentials in the leads
81 % setting the energy and tranverse momentum grids
for the calculations
84 % An instance of
class Ribbon describing the junction
87 % The calculated density of states
88 density_of_states = zeros( length(Evec), length(qvec));
90 % calculate the density of states
97 %> @brief Calculate the density of states
100 % determine indexes to be calculated
101 indexes = logical( density_of_states(1,:) );
102 index2calc = 1:length(indexes);
103 index2calc = index2calc( ~indexes );
106 % Do the calculations
107 for idx = 1:length(index2calc)
108 q = qvec(index2calc(idx));
112 disp(' ----------------------------------')
113 disp(['Calculating Greens
function for the transverse momentum
q=', num2str(
q)])
115 % temporary array to store the calculated
DOS 116 Rho = zeros( length(Evec), 1);
118 % Creating an instance of
Ribbon class with the current transverse momentum
q 122 for jdx=1:length(Evec)
125 % setting the current energy
128 % Calculates the
DOS for the given energy and transverse momentum quantum number
130 'gfininvfromHamiltonian', true, 'PotInScatter', @
SurfacePot, ...
131 'decimateDyson', false);
137 density_of_states(:,index2calc(idx)) = Rho;
139 % calculated data are plotted at each step
142 % exporting the calculated data
143 save( [outputdir,'/',outfilename, '.mat'], 'qvec', 'Evec', '
width', '
height', '
EF', 'density_of_states' );
145 % displaying the status of the calculations
146 disp([ num2str(index2calc(idx)/length(qvec)*100),' % calculated of the density of states.'])
155 %> @brief Sets the energy and transverse quantum number grid points
156 %> @return [1] 1D array of the energy points.
157 %> @return [2] 1D array of the transverse momentum points.
159 Evec = (0:max(abs(Delta))/70:1.1*max(abs(Delta)));
160 vargamma =
param.scatter.vargamma;
161 qmax = (abs(
EF)+max(abs(Evec)))/(vargamma/2)*1.7;
162 qvec = (-qmax:qmax/70:qmax); % in units of (3r_CC)^-1
167 %> @brief Potential in the scattering region (transversally translational invariant)
168 %> @
param An instance of structure
#coordinates containing the position of the sites 169 %> @
return An array of the on-site potential.
171 if isempty(surfacePotential)
176 lattice_const = norm(coordinates.a);
178 lambda = 15*lattice_const; %transition length of the pn potential in units of rCC
179 y1 = 0.15*
height*lattice_const;
180 y2 =
height*lattice_const - y1;
185 ret = surfacePotential*( tanh((y-y1)/lambda) - tanh((y-y2)/lambda) )/2;
189 %> @brief sets the output directory
191 resultsdir = 'results';
193 outputdir = resultsdir;
197 %> @brief plot the calculated data
200 % ********************** plot the
DOS ***********************
202 % determine points to be plotted
203 indexes = logical( density_of_states(1,:));
205 if length(qvec(indexes)) < 2
209 % creating figure in units of pixels
210 figure1 = figure( 'Units', 'Pixels', 'Visible', 'off', 'Colormap', ...
211 [0.0416666679084301 0 0;0.0833333358168602 0 0;0.125 0 0;0.16666667163372 0 0;0.20833332836628 0 0;0.25 0 0;0.291666656732559 0 0;0.333333343267441 0 0;0.375 0 0;0.416666656732559 0 0;0.458333343267441 0 0;0.5 0 0;0.541666686534882 0 0;0.583333313465118 0 0;0.625 0 0;0.666666686534882 0 0;0.708333313465118 0 0;0.75 0 0;0.791666686534882 0 0;0.833333313465118 0 0;0.875 0 0;0.916666686534882 0 0;0.958333313465118 0 0;1 0 0;1 0.0416666679084301 0;1 0.0833333358168602 0;1 0.125 0;1 0.16666667163372 0;1 0.20833332836628 0;1 0.25 0;1 0.291666656732559 0;1 0.333333343267441 0;1 0.375 0;1 0.416666656732559 0;1 0.458333343267441 0;1 0.5 0;1 0.541666686534882 0;1 0.583333313465118 0;1 0.625 0;1 0.666666686534882 0;1 0.708333313465118 0;1 0.75 0;1 0.791666686534882 0;1 0.833333313465118 0;1 0.875 0;1 0.916666686534882 0;1 0.958333313465118 0;1 1 0;1 1 0.0625;1 1 0.125;1 1 0.1875;1 1 0.25;1 1 0.3125;1 1 0.375;1 1 0.4375;1 1 0.5;1 1 0.5625;1 1 0.625;1 1 0.6875;1 1 0.75;1 1 0.8125;1 1 0.875;1 1 0.9375;1 1 1]);
213 % font size on the figure will be 16 points
216 % define the colorbar limits
217 colbarlimits = [min(min(log(density_of_states))) max(max(log(density_of_states)))];
219 % define the axis limits
220 x_lim = [min(qvec) max(qvec)];
221 y_lim = [min(Evec) max(Evec)]/min(abs(Delta));
224 axes_DOS = axes('Parent',figure1, ...
226 'FontSize', fontsize,...
229 'CLim', colbarlimits, ...
231 'Units', 'Pixels', ...
232 'FontName','Times New Roman');
236 [X,Y] = meshgrid( qvec(indexes), Evec );
238 density_of_states2plot = log(density_of_states(:,indexes));
240 contour(X(1:db:end,1:db:end), Y(1:db:end,1:db:end)/min(abs(Delta)), density_of_states2plot(1:db:end,1:db:end), levelnum ,'LineStyle','none','Fill','on',... 'LevelList',[0.2391 0.2866 0.3342 0.3817 0.4293 0.4769 0.5244 0.572 0.6195 0.6671 0.7147 0.7622 0.8098 0.8573 0.9049 0.9524],...
244 xlabel('
q [1/(3r_{CC})]
','FontSize
', fontsize,'FontName
','Times New Roman
', 'Parent
', axes_DOS); 247 ylabel('E [\Delta]
','FontSize
', fontsize,'FontName
','Times New Roman
', 'Parent
', axes_DOS); 253 % ********************** plot potential ************************ 254 coordinates = structures('coordinates
'); 255 coordinates.y = 0:0.01:height*sqrt(3); 256 coordinates.a = [0, sqrt(3)]; 258 % determine the potential across the svócattering region 259 pot = SurfacePot( coordinates ); 261 % position dependent local doping 262 lead_shift = param.Leads{1}.epsilon; 263 mu = EF - lead_shift - pot; 265 x_lim = [ min(coordinates.y-fix(height/4)*coordinates.a(2)) max(coordinates.y+fix(height/4)*coordinates.a(2))]*rCC*1e10; 266 y_lim = [ min(mu) max(mu)]; 268 axes_pot = axes('Parent
',figure1, ... 270 'FontSize
', fontsize,... 274 'Units
', 'Pixels
', ... 275 'FontName
','Times New Roman
'); 280 plot( coordinates.y*rCC*1e10, mu, 'LineWidth
', 2, 'parent
', axes_pot); 281 plot( [min(coordinates.y)*rCC*1e10, min(coordinates.y)*rCC*1e10], y_lim, 'LineStyle
', '--
', 'color
', [0 0 0], 'parent
', axes_pot ) 282 plot( [max(coordinates.y)*rCC*1e10, max(coordinates.y)*rCC*1e10], y_lim, 'LineStyle
', '--
', 'color
', [0 0 0], 'parent
', axes_pot ) 285 % setting the xlabel and ylabel 286 xlabel('x [A]
', 'FontSize
', fontsize,'FontName
','Times New Roman
', 'Parent
', axes_pot); 287 ylabel('doping level [ev]
' ,'FontSize
', fontsize,'FontName
','Times New Roman
', 'Parent
', axes_pot); 289 % det the position of the figure 290 figure_pos = get( figure1, 'Position
' ); 291 figure_pos(4) = figure_pos(4)/2; 292 set( figure1, 'Position
', figure_pos); 295 %set the position of the axes_DOS 296 OuterPosition = get(axes_DOS, 'OuterPosition
'); 297 OuterPosition(1) = 0; 298 OuterPosition(2) = 0; 299 OuterPosition(3) = figure_pos(3)/2; 300 OuterPosition(4) = figure_pos(4); 301 set(axes_DOS, 'OuterPosition
', OuterPosition); 302 Position_DOS = get(axes_DOS, 'OuterPosition
') - get(axes_DOS, 'TightInset
') * [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1]; 303 %set(axes_DOS, 'Position
', Position_DOS); 305 %set the position of the axes_pot 306 OuterPosition = get(axes_pot, 'OuterPosition
'); 307 OuterPosition(1) = figure_pos(3)/2; 308 OuterPosition(2) = 0; 309 OuterPosition(3) = figure_pos(3)/2; 310 OuterPosition(4) = figure_pos(4); 311 set(axes_pot, 'OuterPosition
', OuterPosition); 312 Position_pot = get(axes_pot, 'OuterPosition
') - get(axes_pot, 'TightInset
') * [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1]; 313 %set(axes_pot, 'Position
', Position_pot); 315 % set the paper position in releases greater than 2016 316 ver = version('-release
'); 317 if str2num(ver(1:4)) >= 2016 318 % setting the position and margins of the plot, removing white spaces 319 figure1.PaperPositionMode = 'auto'; 320 fig_pos = figure1.PaperPosition; 321 figure1.PaperSize = [fig_pos(3) fig_pos(4)/2]; 327 print('-depsc2
', fullfile(outputdir, [outfilename,'.eps
'])) 328 print('-dpdf
', fullfile(outputdir,[outfilename, '.pdf
'])) 330 disp('Failed to export figure
'); 331 disp( errCause.identifier ); 332 disp( errCause.stack(1) ); Property filenameOut
Output filename to export the computational parameters.
function setOutputDir()
sets the output directory
lead_param Leads
A list of structures lead_param containing the physical parameters for the scattering region.
Property G
Green operator of the scattering region.
function setEnergy(Energy)
Sets the energy for the calculations.
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 ...
function SpectralDensity(filenum)
Example to calculate the spectral density function in a superconductor-graphene-superconductor juncti...
Property EF
The Fermi energy. Attribute E is measured from this value. (Use for equilibrium calculations in the z...
Structure containg the energy resolved density of states.
Property height
height (length) of the scattering region (number of unit cells)
function setVectors()
Sets the energy and transverse quantum number grid points.
Property q
The transverse momentum quantum number.
Property width
width of the scattering region (number of the nonsingular atomic sites in the cross section)
function PlotFunction()
plot the calculated data
Structure param contains data structures describing the physical parameters of the scattering center ...
function CalculateSpectralDensity()
Calculate the density of states.
function SurfacePot(coordinates)
Potential in the scattering region (transversally translational invariant)
Property E
The energy used in the calculations.
function CalcSpectralFunction(Energy, varargin)
Calculates the spectral density and the Green operator.
function structures(name)