Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
Self_Consistent_Transport.m
Go to the documentation of this file.
1 %% Transport calculation through a graphene QD using self-consistent potential - based on EQuUs v4.8
2 % Copyright (C) 2015 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 %> @{
20 %> @brief Example to calculate transport through a graphene quantum dot using self-consistent potential. Compare results to Fig.3 in 2014 Nanotechnology 25 465201. In these calculations we use a leads defined on a square lattice and do the self-consistent potential iterations only for \f$E_F =0\f$.
21 %> @param filenum The identification number of the filenema for the exported data (default is 1).
22 %> @reference
23 %> S. Krompiewski, Nanotechnology 25 465201 (2014).
24 %> @Available
25 %> EQuUs v4.9 or later
26 %> @expectedresult
27 %> @image html Self_Consistent_Transport.jpg
28 %> @image latex Self_Consistent_Transport.jpg
29 %> @}
30 %
31 %> @brief Example to calculate transport through a graphene quantum dot using self-consistent potential. Compare results to Fig.3 in 2014 Nanotechnology 25 465201. In these calculations we use a leads defined on a square lattice and do the self-consistent potential iterations only for \f$E_F =0\f$.
32 %> @param filenum The identification number of the filenema for the exported data (default is 1).
33 function Self_Consistent_Transport( filenum )
34 
35 if ~exist('filenum', 'var')
36  filenum = 1;
37 end
38 
39 filename = mfilename('fullpath');
40 [directory, fncname] = fileparts( filename );
41 
42  % filename containing the input XML
43  inputXML = 'Input_Transport.xml';
44  % Parsing the input file and creating data structures
45  [Opt, param] = parseInput( fullfile( directory, inputXML ) );
46  vargamma = param.scatter.vargamma;
47 
48  % Strength of the self-consitent intercation in the Stoner model
49  U = -0.6*vargamma;
50  % Zeeman energy for the initial iteration to bring the system out of the trivial nonmagnetic solution
51  Zeeman_energy = 0.1*vargamma;
52  % The Fermi energy
53  EF = 1e-6; % in eV
54  % number of energy point on the contour
55  Edb = 51;
56  % temperature in K
57  T = 0;
58  % width of the junction
59  width = 22;
60  % length of the junction
61  height = 9;
62  % filename containing the output XML
63  outfilename = [fncname,'_',num2str( filenum )];
64  % the output folder
65  outputdir = [];
66  % false to supress output messages
67  silent = false;
68  % Using self energy in the transport calculations
69  useselfEnergy = true;
70 
71 
72  % noninteracting transport results
73  Evec_non_interacting = [];
74  Conductance_non_interacting = [];
75 
76  % self_consistent transport results
77  Conductance_self_consistent = [];
78  Evec_self_consistent = [];
79 
80  % Class for self_consistent iterations
81  cSelfConsistent = [];
82 
83  % creating output directories
84  setOutputDir();
85 
86  % Calculates the non-interacting transport through a graphene island
88 
89  % Calculates the self-consistent transport through a graphene island
91 
92  % creates the plot
93  CreatePlot()
94 
95  % export the calculetd data
96  save( [outputdir,'/',outfilename,'.mat']);
97 
99 %> @brief calculates the transport with self-consistent potential
101 
102  display('****** Calculating self-consistent transport ******')
103  display(' ')
104 
105  % Creates the class for self-consistent iterations for magnetization up
106  cSelfConsistent = SelfConsistent( Opt, 'magnetizaion_direction', [], 'tolerance', 2e-3, 'newIterationWeight', 0.3, 'outFileName', 'test.mat', 'MaxIter', 500, 'plotIterations', false, 'resume', false ) ;
107 
108  Enum = 100;
109  Emin = -0.3;
110  Emax = 0.3;
111  Evec_self_consistent = Emin:(Emax-Emin)/Enum:Emax;
112  Conductance_self_consistent = zeros(size(Evec_self_consistent));
113 
114  % calcualting the self-consistent potential
115 
116  % opening the parallel pool
117  Opt.workers = 2;
118  poolmanager = Parallel( Opt );
119  poolmanager.openPool();
120 
121  % running the self-consistent iterations
123 
124  % closing the parallel pool
125  poolmanager.closePool();
126 
127  for idx = 1:length(Evec_self_consistent)
128 
129  Conductance_self_consistent(idx) = Transport(Evec_self_consistent(idx), true);
130 
131  display(['Energy = ', num2str(Evec_self_consistent(idx)), ', conductance = ', num2str(Conductance_self_consistent(idx))]);
132 
133 
134  end
135 
136 
137  end
138 
139 
140 %% CalcTransport
141 %> @brief calculates the non-interacting transport
143 
144  display('****** Calculating transport in the non-interacting case ******')
145  display(' ')
146 
147  % oreallocating arrays for the results
148  Enum = 100;
149  Emin = -0.3;
150  Emax = 0.3;
151  Evec_non_interacting = Emin:(Emax-Emin)/Enum:Emax;
152  Conductance_non_interacting = zeros(size(Evec_self_consistent));
153 
154  for idx = 1:length(Evec_non_interacting)
155  Conductance_non_interacting(idx) = Transport(Evec_non_interacting(idx), false);
156  display(['Energy = ', num2str(Evec_non_interacting(idx)), ', conductance = ', num2str(Conductance_non_interacting(idx))])
157  end
158 
159  % creates the plot
160  CreatePlot()
161 
162 
163  end
164 
165 
166 %% Transport
167 %> @brief Calculates the conductance for a given energy for both self-consistent and non-interacting cases.
168 %> @param Energy The enrgy value
169 %> @param self_consistent Logical value. Set true to use the self-consistent potential, or false to do the non-interacting calculations.
170 %> @return Returns with the calculated conductance in units of \f$e^2/\hbar \f$.
171  function ret = Transport( Energy, self_consistent )
172 
173 
174 
175  % creating the Ribbon interface for the SNS structure
176  cRibbon = Ribbon('width', width, 'height', height, 'EF', EF, 'silent', silent, 'Opt', Opt, 'param', param, 'filenameOut', fullfile(outputdir, [outfilename, '.xml']), ...
177  'leadmodel', @Square_leads, 'interfacemodel', @InterfaceModel);
178 
179  % setting the energy value
180  cRibbon.setEnergy( Energy )
181 
182  % calculating the Green function of the scattering reigon
183  cRibbon.CalcFiniteGreensFunctionFromHamiltonian('PotInScatter', @(CreateH,E)Pot_Self_Consistent(CreateH, E, self_consistent), 'onlyGinv', true);
184 
185  % calculating the leads
186  coordinates_shift = [-2, height+1];
187  recalculateLeads = [1 2];
188  cRibbon.FL_handles.LeadCalc('coordinates_shift', coordinates_shift, 'SelfEnergy', useselfEnergy, 'SurfaceGreensFunction', ~useselfEnergy, 'leads', recalculateLeads, 'leadmodel', @Square_leads);
189 
190  % creating interface regions
191  for idx = 1:length(cRibbon.Interface_Regions)
192  cRibbon.CreateInterface( idx );
193 
194  end
195 
196  % setting the function handle for the Dyson Equation
197  Dysonfunc = @()(cRibbon.CustomDysonFunc( 'recalculateSurface', [], 'constant_channels', true, 'decimate', true, 'SelfEnergy', useselfEnergy ));
198  cRibbon.FL_handles.DysonEq( 'CustomDyson', Dysonfunc );
199 
200  % calculating the conductance
201  ret = cRibbon.FL_handles.Conductance2();
202 
203 
204  end
205 
206 
208 %> @brief Calculates the self-consistent potential
210  % reset the self-consistent class to forget previous iterations, but keep the last calculated density
211  cSelfConsistent.Reset();
212 
213  % Do the self-consistent iterations
214  cSelfConsistent.runSelfConsistentIterations( @DensityCalc );
215  end
216 
217 
218 
219 %% DensityCalc
220 %> @brief Calculates the density using the predefined graphene lattice framework (Ribbon class)
221 %> @return [1] The calculated density data
222 %> @return [2] An instance of structure #junction_sites describing the sites in the calculated density
223  function [density_data, junction_sites] = DensityCalc()
224 
225  % creating the Ribbon interface for the SNS structure
226  cRibbon = Ribbon('width', width, 'height', height, 'EF', EF, 'silent', silent, 'Opt', Opt, 'param', param, 'filenameOut', fullfile(outputdir, [outfilename, '.xml']), ...
227  'leadmodel', @Square_leads, 'interfacemodel', @InterfaceModel);
228 
229  % create Density class
230  cDensity = Density(Opt, 'T', T, 'scatterPotential', @(CreateH, E)(Pot_Self_Consistent(CreateH, E, true)), 'junction', cRibbon, 'useSelfEnergy', useselfEnergy);
231 
232  % Calculate the density
233  [density_data, junction_sites] = cDensity.DensityCalc( 'Edb', Edb, 'Emin', -11.0286 );
234 
235  end
236 
237 
239 %> @brief Create a potential from a self-consistent data, and removing unecessary sites from the scattering region
240 %> @param CreateH An instance of class #CreateHamiltonians storing the Hamiltonian.
241 %> @param E The energy value
242 %> @param SelfConsistent Logical value. Set true to calculate the self-consistent potential, or false otherwise
243  function ret = Pot_Self_Consistent(CreateH, E, SelfConsistent)
244 
245  coordinates = CreateH.Read('coordinates');
246  y = coordinates.y;
247  max_y = max(y);
248 
249  % determine sites to be removed to reproduce the scattering region in 2014 Nanotechnology 25 465201
250  indexes2remove = ~(y<max_y);
251 
252  CreateH.Write('kulso_szabfokok', []);
253 
254  y( indexes2remove ) = max_y/2;
255  max_y = max(y);
256  min_y = min(y);
257 
258  % creating new kulso_szabfokok
259  kulso_szabfokok_logical = ~(y<max_y & y>min_y);
260  kulso_szabfokok = 1:length(y);
261  kulso_szabfokok = kulso_szabfokok(kulso_szabfokok_logical);
262  CreateH.Write('kulso_szabfokok', kulso_szabfokok);
263 
264 
265  % removing sites from the scattering region
266  CreateH.RemoveSites( indexes2remove )
267 
268  coordinates = CreateH.Read('coordinates');
269  ret = zeros(size(coordinates.x));
270 
271  if ~SelfConsistent
272  ret = zeros(size(coordinates.x));
273  return
274  end
275 
276 
277  % adding the self-consistent interaction
278  coordinates = CreateH.Read('coordinates');
279  ret = zeros(size(coordinates.x));
280 
281  if isempty( cSelfConsistent.density)
282  coordinates = CreateH.Read('coordinates');
283 
284  % adding Zeeman term at the edges the first iteration to bring the
285  %system put of the trivial solution
286  x = coordinates.x;
287  min_x = min(x);
288  max_x = max(x);
289  lattice_constant = norm(coordinates.a);
290  %ret = (exp(-(x-min_x).^2/(2*lattice_constant^2)) - exp(-(x-max_x).^2/(2*lattice_constant^2)) )*Zeeman_energy;
291  ret = -ones(size(x))*Zeeman_energy;
292  ret(~coordinates.spinup) = -ret(~coordinates.spinup);
293  return
294  end
295 
296  % Stoner interaction model of Nanotechnology 25 (2014) 465201
297  scatter_density = cSelfConsistent.density(cSelfConsistent.junction_sites.Scatter.site_indexes);
298 
299  density_scatter_spinup = scatter_density(cSelfConsistent.junction_sites.Scatter.coordinates.spinup);
300  density_scatter_spindown = scatter_density(~cSelfConsistent.junction_sites.Scatter.coordinates.spinup);
301 
302  ret(coordinates.spinup) = 0.5*U*(density_scatter_spinup-density_scatter_spindown);
303  ret(~coordinates.spinup) = -0.5*U*(density_scatter_spinup-density_scatter_spindown);
304 
305 
306  end
307 
308 
309 %% Square lead
310 %> @brief Create square leads Hamiltonians with the same inputs and output as #Transport_Interface.SurfaceGreenFunctionCalculator.
311  function Lead_ret = Square_leads( idx, E, varargin )
312  p_inner = inputParser;
313 
314  p_inner.addParameter('createCore', 0);
315  p_inner.addParameter('Just_Create_Hamiltonians', 0);
316  p_inner.addParameter('shiftLead', 0);
317  p_inner.addParameter('coordinates_shift', 0);
318  p_inner.addParameter('transversepotential', []);
319  p_inner.addParameter('Lead',[]);
320  p_inner.addParameter('gauge_field', [] );% gauge field for performing gauge transformation
321  p_inner.addParameter('SelfEnergy',false); % set true to calculate the self energy of the semi-infinite lead
322  p_inner.addParameter('SurfaceGreensFunction', true );% set true to calculate the surface Greens function of the semi-infinite lead
323  p_inner.addParameter('q', [] ) %transverse momentum
324 
325  p_inner.parse(varargin{:});
326 
327  createCore = p_inner.Results.createCore;
328  Just_Create_Hamiltonians = p_inner.Results.Just_Create_Hamiltonians;
329  shiftLead = p_inner.Results.shiftLead;
330  coordinates_shift = p_inner.Results.coordinates_shift;
331  transversepotential = p_inner.Results.transversepotential;
332  Lead = [];%p_inner.Results.Surface_tmp;
333  gauge_field = p_inner.Results.gauge_field; % gauge field for performing gauge transformation
334  SelfEnergy = p_inner.Results.SelfEnergy;
335  SurfaceGreensFunction = p_inner.Results.SurfaceGreensFunction;
336  q = p_inner.Results.q;
337 
338  Opt2 = Opt;
339  Opt2.Lattice_Type = 'Square';
340  Opt2.Silent = true;
341 
342  param2 = param;
343  param2.Leads{idx} = param_Square_Lead();
344  param2.Leads{idx}.epsilon = param.Leads{idx}.epsilon;
345  param2.Leads{idx}.vargamma = param.Leads{idx}.vargamma;
346  param2.Leads{idx}.M = width;
347 
348 
349  FL_handles = Transport_Interface(E, Opt2, param2);
350 
351  Lead_ret = FL_handles.SurfaceGreenFunctionCalculator(idx, 'createCore', createCore, ...
352  'Just_Create_Hamiltonians', Just_Create_Hamiltonians, ...
353  'shiftLead', shiftLead, ...
354  'coordinates_shift', coordinates_shift, ...
355  'transversepotential', transversepotential, ...
356  'gauge_field', gauge_field, ...
357  'SelfEnergy', SelfEnergy, ...
358  'SurfaceGreensFunction', SurfaceGreensFunction, ...
359  'q', q);
360 
361  end
362 
363 
365 %> @brief Method to adjust the Hamiltonians of the interface regions
366 %> @param Interface_Region An instance of class #Interface_Region.
367  function InterfaceModel( Interface_Region )
368 
369  Kcoupling = Interface_Region.Read('Kcoupling');
370  Kcouplingadj = Interface_Region.Read('Kcouplingadj');
371 
372 
373  [rows, cols] = find( Kcoupling );
374  rows = unique(rows);
375 
376  Kcoupling = Kcoupling(rows, :);
377  Kcouplingadj = Kcouplingadj(:, rows);
378 
379  Interface_Region.Write('Kcoupling', Kcoupling);
380  Interface_Region.Write('Kcouplingadj', Kcouplingadj);
381 
382 
383  end
384 
385 %% CreatePlot
386 % creates the plot
387  function CreatePlot()
388 
389  % creating figure in units of pixels
390  figure1 = figure( 'Units', 'Pixels', 'Visible', 'off');
391 
392  % font size on the figure will be 16 points
393  fontsize = 16;
394 
395  % setting the limits of the axis
396  x_lim = [-0.3 0.3];
397 
398  % creating axes of the plot
399  axes1 = axes('Parent',figure1, ...
400  'Visible', 'on',...
401  'FontSize', fontsize,...
402  'xlim', x_lim,...
403  'Box', 'on',...
404  'Units', 'Pixels', ...
405  'FontName','Times New Roman');
406  hold on;
407 
408  % Create xlabel
409  xlabel('E [eV]','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes1);
410 
411  % Create ylabel
412  ylabel('G [e^2/h]','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes1);
413 
414  % reserve a variable for legend titles
415  legend_labels = [];
416 
417  % plot the non-interacting and self-consistent data
418  if ~isempty( Conductance_non_interacting )
419  plot(Evec_non_interacting, real(Conductance_non_interacting), 'b', 'LineWidth', 2, 'Parent', axes1)
420  legend_labels{end+1} = 'U = 0';
421  end
422 
423  if ~isempty( Conductance_self_consistent )
424  plot(Evec_self_consistent, real(Conductance_self_consistent), 'rx', 'Parent', axes1)
425  plot(Evec_self_consistent, real(Conductance_self_consistent), 'r', 'LineWidth', 1.5, 'Parent', axes1)
426  legend_labels{end+1} = ['U = ', num2str(U/vargamma), '\gamma'];
427  end
428 
429 
430 
431  % plot the non-interacting and self-consistent dat
432  fig_legend = legend(axes1, legend_labels);
433  set(fig_legend, 'FontSize', fontsize*0.8, 'FontName','Times New Roman', 'Box', 'off', 'Location', 'NorthEast')
434 
435  % set the paper position in releases greater than 2016
436  ver = version('-release');
437  if str2num(ver(1:4)) >= 2016
438  % setting the position and margins of the plot, removing white spaces
439  figure1.PaperPositionMode = 'auto';
440  fig_pos = figure1.PaperPosition;
441  figure1.PaperSize = [fig_pos(3) fig_pos(4)];
442  end
443 
444  set(axes1, 'Position', get(axes1, 'OuterPosition') - get(axes1, 'TightInset') * [-1 0 1 0; 0 -1 0 1; 0 0 1 0; 0 0 0 1]);
445  Position_figure = get(axes1, 'OuterPosition');
446  set(figure1, 'Position', Position_figure);
447 
448 
449  % export the figures
450  print('-depsc2', fullfile(outputdir,[outfilename, '.eps']))
451  print('-dpdf', fullfile(outputdir,[outfilename, '.pdf']))
452  close(figure1)
453 
454 
455 
456 
457  end
458 
459 
460 
461 %% setOutputDir
462 % sets the output directory
464  resultsdir = 'results';
465  mkdir(fullfile(directory, resultsdir) );
466  outputdir = resultsdir;
467  end
468 
469 
470 
471 
472 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
function Transport(Energy, self_consistent)
Calculates the conductance for a given energy for both self-consistent and non-interacting cases.
Property width
The number of sites in the cross section.
A class for controlling the parallel pool for paralell computations.
Definition: Parallel.m:26
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
function Square_leads(idx, E, varargin)
Create square leads Hamiltonians with the same inputs and output as Transport_Interface....
A class for calculations on a ribbon of finite width for equilibrium calculations mostly in the zero ...
Definition: Ribbon.m:34
Property coordinates
An instance of the structure coordinates.
function CalcSelfConsistentTransport()
calculates the transport with self-consistent potential
A class to evaluate self-consistent potentials depending on electron (spin resolved) densities.
A class to evaluate the Dyson equation and to calculate the scattering matrix for equilibrium process...
function Hamiltonians(varargin)
Function to create the custom Hamiltonians for the 1D chain.
Property q
A transverse momentum.
function DensityCalc()
Calculates the density using the predefined graphene lattice framework (Ribbon class)
Property kulso_szabfokok
A list of the sites to be kept after decimation.
function CalcSelfconsistentPotential()
Calculates the self-consistent potential.
A class to calculate the Green functions and self energies of a translational invariant lead The nota...
Definition: Lead.m:29
Property varargin
list of optional parameters (see http://www.mathworks.com/help/matlab/ref/varargin....
function()
A class to calculate the onsite desnity useful for self-consistent calculations.
Definition: Density.m:26
Class containing physical parameters of a particular lead defined on a square lattice.
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
Structure sites contains data to identify the individual sites in a matrix.
Definition: structures.m:187
function InterfaceModel(Interface_Region)
Method to adjust the Hamiltonians of the interface regions.
Property Opt
An instance of structure Opt.
Definition: Messages.m:31
function CalcTransport()
calculates the non-interacting transport
Property param
An instance of structure param.
function setOutputDir()
function gauge_field(x, y, eta_B, Aconst, height, lattice_constant)
Scalar gauge field connecting Landaux and Landauy gauges.
function parseInput(filename)
This function parses the input file containing the input parameters.
function Read(MemberName)
Query for the value of an attribute in the class.
function CreatePlot()
function Self_Consistent_Transport(filenum)
Example to calculate transport through a graphene quantum dot using self-consistent potential.
function structures(name)
function Pot_Self_Consistent(CreateH, E, SelfConsistent)
Create a potential from a self-consistent data, and removing unecessary sites from the scattering reg...
Structure junction_sites contains data to identify the individual sites of the leads,...
Definition: structures.m:176
A class to create and store Hamiltonian of the scattering region.