1 %
Transport through graphene ribbon in magnetic field - Based on EQuUs v4.7
2 % Copyright (C) 2016 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:
16 %> @brief Example to calculate the conductivity through a ribbon in a magnetic field.
17 %> @
param filenum The identification number of the filenema
for the exported data (
default is 1).
20 if ~exist(
'filenum',
'var')
24 filename = mfilename('fullpath');
25 [directory, fncname] = fileparts( filename );
27 %> filename containing the input XML
28 inputXML = 'Basic_Input_zigzag_leads.xml';
29 %> Parsing the input file and creating data
structures 32 %> filename containing the output XML
33 outfilename = [fncname, '_',num2str( filenum )];
37 %> length of the junction (number of unit cells)
39 % width of the junction
42 % creating 1D energy array (in units of eV)
43 % minimum of the energy array
45 % maximum of the energy array
47 %> number of energy points
50 Evec = Emin:(Emax-Emin)/(Enum+1):Emax;
52 % the strength of the magnetic field in Tesla
54 % the cyclotron frequency
59 % The charge of the electron
62 rCC = 1.42*1e-10; %In Angstrom
65 % preallocating the array for the calculated conductance values
66 Conductance = zeros(1,length(Evec));
67 % preallocating the array for the unitarity errors
68 DeltaC = zeros(1,length(Evec));
69 % preallocating the array for the difference between the calculations using the self energies and the surface Green function
70 Difference = zeros(1,length(Evec));
71 % class representing the two terminal ribbon structure
74 %> creating output directories
77 %> Calculate the transport through the magnetic barrier
80 %> plot the calculated results
87 %> @brief Calculates the conductance values
88 function CalculateTranspor()
90 for idx = 1:length(Evec)
91 % determine the current energy value
94 %> creating the
Ribbon class representing the twoterminal setup
95 cRibbon =
Ribbon('width', width, 'height', height, 'Opt', Opt, '
param', param, 'filenameOut', fullfile( outputdir, [outfilename, '.xml']) );
97 % calculating dimensionless magnetic field, and the cyclotron frequency
98 phi0 = h/qe; % magnetic flux quantum
99 eta_B = 2*pi/phi0*(rCC)^2*B;
101 homegac = 2.97*sqrt(9/2*eta_B);
104 % Plot the calculated results
105 disp(' ----------------------------------')
106 disp('Plotting conductivity:')
109 % calculating the current conductace
112 disp(' ----------------------------------')
113 disp('Calculating Conductance for the given magentic field')
117 [Conductance_tmp,DeltaC_tmp] =
Transport( Energy, B, false );
118 [Conductance_tmp_selfEnergy] =
Transport( Energy, B, true );
121 % storing the calculated data
122 Conductance(idx) = Conductance_tmp;
123 DeltaC(idx) = DeltaC_tmp;
124 Difference(idx) = Conductance_tmp - Conductance_tmp_selfEnergy;
127 % exporting the calculated data
128 save( fullfile(outputdir,[outfilename, '.mat']) );
129 disp([ num2str(idx/length(Evec)*100),' % calculated of the conductance.'])
137 %> @brief Calculates the conductance for a given energy
138 %> @param Energy The energy value.
139 %> @param B The magnetic field
140 %> @param selfEnergy Logical value. Set true to use the self energy in the calculations or false to use the surface Green operator.
141 function [Conductance,DeltaC] =
Transport( Energy, B, selfEnergy )
143 % creating funcfion handles for the magnetic vector potentials
146 % seeting the Energy value in the
Ribbon class
147 cRibbon.setEnergy( Energy )
149 % Calculates the surface Green operator of the scattering region
150 cRibbon.CalcFiniteGreensFunction();
152 % creating function
handle for the Dyson Eq.
153 Dysonfunc = @()cRibbon.CustomDysonFunc( 'constant_channels', false, 'SelfEnergy', selfEnergy );
155 % Evaluate the Dyson Eq.
156 cRibbon.FL_handles.DysonEq( 'CustomDyson', Dysonfunc );
158 % Calculating the Scattering matrix
161 % Calculate the unitarity error
164 if DeltaC >= 1e-3 || isnan(DeltaC)
165 disp( ['error of the unitarity of S-matrix: ',num2str(DeltaC)] )
168 if open_channels(1) ~= open_channels(2)
169 disp( 'openchannels do not match' )
172 % Calculate the conductance
174 conductance = cRibbon.FL_handles.Conduktance();
181 Conductance = conductance(1,2);
183 disp( ['E = ', num2str(Energy), ' conductance = ', num2str(Conductance)])
189 %> @brief Creates and set function handles of the magnetic vector potentials in the
Ribbon class
190 %> @param B The magnetic field
193 cRibbon.setHandlesForMagneticField('scatter', hLandauy, 'lead', hLandauy );
198 %> @brief Creates the function
handle of the magnetic vector potential
199 %> @param B The magnetic field
200 %> @return Returns with the function
handle.
204 eta_B = 2*pi/phi0*(rCC)^2*B;
206 % creting the funciton handles of the vector potential
207 hLandauy = @(x,y)([zeros(size(x,1),1),eta_B*x]);
214 %> @brief Sets output directory.
215 function setOutputDir()
216 resultsdir = 'results';
218 outputdir = fullfile( directory, resultsdir );
225 %> @brief Creates the plot
226 function PlotFunction( )
229 % creating figure in units of pixels
230 figure1 = figure( 'Units', 'Pixels');
232 % font size on the figure will be 16 points
235 % determine points to be plotted
236 indexek = logical( (abs(DeltaC) <= 0.5) & (Evec~=0) & ~isnan(DeltaC) );
238 % setting the limits of the x axis
239 x_lim = [min(Evec(indexek)) max(Evec(indexek))];
245 % creating axes of the plot
246 axes_cond = axes('Parent',figure1, ...
248 'FontSize', fontsize,...
251 'Units', 'Pixels', ...
252 'FontName','Times New Roman');
256 numerics = plot(Evec(indexek), Conductance(indexek), 'Linewidth', 2, 'color', [0 0 0], 'Parent', axes_cond);
258 plot(Evec(indexek), DeltaC(indexek), 'Linewidth', 1, 'color', [0 1 0], 'Parent', axes_cond);
259 plot(Evec(indexek), Difference(indexek), 'Linewidth', 1, 'color', [1 0 0], 'Parent', axes_cond);
261 disp('No DeltaC data present')
264 % setting the cyclotron frequencies in the plot
266 nmax = round( (Emax/homegac)^2 );
268 for idx = 1:length(nvec)
269 plot(sqrt([nvec(idx), nvec(idx)])*homegac, [0 max(Conductance(indexek))], 'Linewidth', 0.5, 'color', [0 0 1], 'Parent', axes_cond);
277 xlabel('E [ev]','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_cond);
280 ylabel('\sigma/\sigma_0','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_cond);
283 fig_legend = legend(axes_cond, {
'conductance',
'unitarity error',
'"Surface Green Func - Self energy"'});
284 set(fig_legend,
'FontSize', fontsize,
'FontName',
'Times New Roman',
'Box',
'off',
'Location',
'NorthEast')
286 % setting the position and margins of the plot, removing white
287 % spaces
for release dates greater than 2015
288 ver = version(
'-release');
289 if str2num(ver(1:4)) >= 2016
291 fig.PaperPositionMode =
'auto';
292 fig_pos = fig.PaperPosition;
293 fig.PaperSize = [fig_pos(3) fig_pos(4)];
295 set(gca, 'Position', get(gca, 'OuterPosition') - get(gca, 'TightInset') * [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1]);
296 Position_figure = get(axes_cond, 'OuterPosition');
297 set(figure1, 'Position', Position_figure);
301 print('-depsc2', fullfile(outputdir,[outfilename, '.eps']))
302 print('-dpdf', fullfile(outputdir,[outfilename, '.pdf']))
Structure Opt contains the basic computational parameters used in EQuUs.
Structure open_channels describes the open channel in the individual leads.
A class for calculations on a ribbon of finite width for equilibrium calculations mostly in the zero ...
function CreateHandlesForMagneticField(B)
Creates and set function handles of the magnetic vector potentials in the Ribbon class.
function Transport(Energy, B, selfEnergy)
creating the Ribbon class representing the twoterminal setup
function createVectorPotential(B)
Creates the function handle of the magnetic vector potential.
Structure param contains data structures describing the physical parameters of the scattering center ...
function magnetic_ribbon(filenum)
Example to calculate the conductivity through a ribbon in a magnetic field.
function setOutputDir()
Sets output directory.
function structures(name)
function CalculateTranspor()
filename containing the input XML
function PlotFunction()
Creates the plot.