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:
17 %> @addtogroup Examples
20 %> @brief Example to calculate the conductivity through a ribbon in a magnetic field.
21 %> @
param filenum The identification number of the filenema
for the exported data (
default is 1).
23 %> EQuUs v4.8 or later
30 %> @brief Example to calculate the conductivity through a ribbon in a magnetic field.
31 %> @
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 %> length of the junction (number of unit cells)
53 % width of the junction
56 % creating 1D energy array (in units of eV)
57 % minimum of the energy array
59 % maximum of the energy array
61 %> number of energy points
64 Evec = Emin:(Emax-Emin)/(Enum+1):Emax;
66 % the strength of the magnetic field in Tesla
68 % the cyclotron frequency
73 % The charge of the electron
76 rCC = 1.42*1e-10; %In Angstrom
79 % preallocating the array for the calculated conductance values
80 Conductance = zeros(1,length(Evec));
81 % preallocating the array for the unitarity errors
82 DeltaC = zeros(1,length(Evec));
83 % preallocating the array for the difference between the calculations using the self energies and the surface Green
function 84 Difference = zeros(1,length(Evec));
85 % class representing the two terminal ribbon structure
88 %> creating output directories
91 %> Calculate the transport through the magnetic barrier
94 %> plot the calculated results
101 %> @brief Calculates the conductance values
104 for idx = 1:length(Evec)
105 % determine the current energy value
108 %> creating the
Ribbon class representing the twoterminal setup
109 cRibbon =
Ribbon('width', width, 'height', height, '
Opt',
Opt, '
param',
param, 'filenameOut', fullfile( outputdir, [outfilename, '.xml']) );
111 % calculating dimensionless magnetic field, and the cyclotron frequency
112 phi0 = h/qe; % magnetic flux quantum
113 eta_B = 2*pi/phi0*(rCC)^2*B;
115 homegac = 2.97*sqrt(9/2*eta_B);
118 % Plot the calculated results
119 disp(' ----------------------------------')
120 disp('Plotting conductivity:')
123 % calculating the current conductace
126 disp(' ----------------------------------')
127 disp('Calculating Conductance for the given magentic field')
131 [Conductance_tmp,DeltaC_tmp] =
Transport( Energy, B, false );
132 [Conductance_tmp_selfEnergy] =
Transport( Energy, B, true );
135 % storing the calculated data
136 Conductance(idx) = Conductance_tmp;
137 DeltaC(idx) = DeltaC_tmp;
138 Difference(idx) = Conductance_tmp - Conductance_tmp_selfEnergy;
141 % exporting the calculated data
142 save( fullfile(outputdir,[outfilename, '.mat']) );
143 disp([ num2str(idx/length(Evec)*100),' % calculated of the conductance.'])
151 %> @brief Calculates the conductance for a given energy
152 %> @
param Energy The energy value.
153 %> @
param B The magnetic field
154 %> @
param selfEnergy Logical value. Set true to use the self energy in the calculations or false to use the surface Green operator.
157 % creating funcfion handles for the magnetic vector potentials
160 % seeting the Energy value in the
Ribbon class
161 cRibbon.setEnergy( Energy )
163 % Calculates the surface Green operator of the scattering region
164 cRibbon.CalcFiniteGreensFunction();
167 Dysonfunc = @()cRibbon.CustomDysonFunc( 'constant_channels', false, 'SelfEnergy', selfEnergy );
169 % Evaluate the Dyson Eq.
170 cRibbon.FL_handles.DysonEq( 'CustomDyson', Dysonfunc );
172 % Calculating the Scattering matrix
175 % Calculate the unitarity error
178 if DeltaC >= 1e-3 || isnan(DeltaC)
179 disp( ['error of the unitarity of S-matrix: ',num2str(DeltaC)] )
183 disp( 'openchannels do not match' )
186 % Calculate the conductance
188 conductance = cRibbon.FL_handles.Conduktance();
195 Conductance = conductance(1,2);
197 disp( ['E = ', num2str(Energy), ' conductance = ', num2str(Conductance)])
203 %> @brief Creates and set
function handles of the magnetic vector potentials in the
Ribbon class
204 %> @
param B The magnetic field
207 cRibbon.setHandlesForMagneticField('scatter', hLandauy, 'lead', hLandauy );
212 %> @brief Creates the
function handle of the magnetic vector potential
213 %> @
param B The magnetic field
218 eta_B = 2*pi/phi0*(rCC)^2*B;
220 % creting the funciton handles of the vector potential
221 hLandauy = @(x,y)([zeros(size(x,1),1),eta_B*x]);
228 %> @brief Sets output directory.
230 resultsdir = 'results';
232 outputdir = fullfile( directory, resultsdir );
239 %> @brief Creates the plot
243 % creating figure in units of pixels
244 figure1 = figure( 'Units', 'Pixels', 'Visible', 'off');
246 % font size on the figure will be 16 points
249 % determine points to be plotted
250 indexek = logical( (abs(DeltaC) <= 0.5) & (Evec~=0) & ~isnan(DeltaC) );
252 % setting the limits of the x axis
253 x_lim = [min(Evec(indexek)) max(Evec(indexek))];
259 % creating axes of the plot
260 axes_cond = axes('Parent',figure1, ...
262 'FontSize', fontsize,...
265 'Units', 'Pixels', ...
266 'FontName','Times New Roman');
270 numerics = plot(Evec(indexek), Conductance(indexek), 'Linewidth', 2, 'color', [0 0 0], 'Parent', axes_cond);
272 plot(Evec(indexek), DeltaC(indexek), 'Linewidth', 1, 'color', [0 1 0], 'Parent', axes_cond);
273 plot(Evec(indexek), Difference(indexek), 'Linewidth', 1, 'color', [1 0 0], 'Parent', axes_cond);
275 disp('No DeltaC data present')
278 % setting the cyclotron frequencies in the plot
280 nmax = round( (Emax/homegac)^2 );
282 for idx = 1:length(nvec)
283 plot(sqrt([nvec(idx), nvec(idx)])*homegac, [0 max(Conductance(indexek))], 'Linewidth', 0.5, 'color', [0 0 1], 'Parent', axes_cond);
291 xlabel('E [ev]','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_cond);
294 ylabel('\sigma/\sigma_0','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_cond);
297 fig_legend = legend(axes_cond, {
'conductance',
'unitarity error',
'"Surface Green Func - Self energy"'});
298 set(fig_legend,
'FontSize', fontsize,
'FontName',
'Times New Roman',
'Box',
'off',
'Location',
'NorthEast')
300 % setting the position and margins of the plot, removing white
301 % spaces
for release dates greater than 2015
302 ver = version(
'-release');
303 if str2num(ver(1:4)) >= 2016
305 fig.PaperPositionMode =
'auto';
306 fig_pos = fig.PaperPosition;
307 fig.PaperSize = [fig_pos(3) fig_pos(4)];
309 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]);
310 Position_figure = get(axes_cond, 'OuterPosition');
311 set(figure1, 'Position', Position_figure);
315 print('-depsc2', fullfile(outputdir,[outfilename, '.eps']))
316 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.