Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
Ribbon.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities - Ribbon
2 % Copyright (C) 2009-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 utilities Utilities
18 %> @{
19 %> @file Ribbon.m
20 %> @brief A class for calculations on a ribbon of finite width for equilibrium calculations mostly in the zero temperature limit.
21 %> @image html Ribbon_structure.jpg
22 %> @image latex Ribbon_structure.jpg
23 %> @}
24 %> @brief A class for calculations on a ribbon of finite width for equilibrium calculations mostly in the zero temperature limit.
25 %> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="avail"></a>Structure described by the class</h2></td></tr>
26 %> @image html Ribbon_structure.jpg
27 %> @image latex Ribbon_structure.jpg
28 %> The drawing represents a two-terminal structure made of two leads, of a scattering region and of two interface regions between the leads and scattering center.
29 %> Each rectangle describes a unit cell including singular and non-singular sites.
30 %> The scattering center is also described by a set of identical unit cells, but arbitrary potential can be used.
31 %> Arrows indicate the hopping direction stored by the attributes in the corresponding classes (see attributes #CreateLeadHamiltonians.H1 and #InterfaceRegion.Hcoupling for details).
32 %> The orientation of the lead is +1 if the lead is terminated by the interface region in the positive direction, and -1 if the lead is terminated by the interface region in the negative direction.
33 %> (see attribute #CreateLeadHamiltonians.Lead_Orientation for details)
34 classdef Ribbon < NTerminal
35 
36 
37  properties ( Access = public )
38  %> An instance of class #Lead (or its subclass) describing the unit cell of the scattering region
39  Scatter_UC
40  %> A function handle pot = f( #coordinates ) or pot=f( #CreateLeadHamiltonians, Energy) of the transverse potential applied in the lead. (Instead of #CreateLeadHamiltonians can be used its derived class)
41  transversepotential
42  %> width of the scattering region (number of the nonsingular atomic sites in the cross section)
43  width
44  %> height (length) of the scattering region (number of unit cells)
45  height
46  %> the shift of the coordinates of the sites (two component vector)
47  shift
48  end
49 
50 
51 methods ( Access = public )
52 %% Contructor of the class
53 %> @brief Constructor of the class.
54 %> @param varargin Cell array of optional parameters. For details see #InputParsing.
55 %> @return An instance of the class
56  function obj = Ribbon( varargin )
57  obj = obj@NTerminal();
58 
59 
60  obj.param = [];
61  obj.Scatter_UC = [];
62  obj.transversepotential = [];
63  obj.width = [];
64  obj.height = [];
65  obj.shift = 0;
66 
67 
68  if strcmpi( class(obj), 'Ribbon')
69  % processing the optional parameters
70  obj.InputParsing(varargin{:})
71 
72 
73  obj.display(['EQuUs:Utils:', class(obj), ':Ribbon: Creating a Ribbon object'])
74 
75  % create the shape of the scattering region
76  obj.createShape();
77 
78  % set the Fermi level
79  obj.setFermiEnergy();
80 
81  % exporting calculation parameters into an XML format
82  createOutput( obj.filenameOut, obj.Opt, obj.param );
83 
84  % create class intances and initializing class attributes
85  obj.CreateHandles();
86 
87  % create Hamiltonians and coordinates of the unit cells
88  obj.CreateRibbon('justHamiltonians', true);
89  end
90 
91 
92 
93  end
94 
95 %% Transport
96 %> @brief Calculates the transport through the two terminal setup on two dimensional lattices. Use for development pupose only.
97 %> @param Energy The energy value.
98 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
99 %> @param 'constant_channels' Logical value. Set true (default) to keep constant the number of the open channels in the leads for each energy value, or false otherwise.
100 %> @param 'gfininvfromHamiltonian' Logical value. Set true calculate the surface Greens function of the scattering region from the Hamiltonaian of the scattering region, or false (default) to calculate it by the fast way (see Phys. Rev. B 90, 125428 (2014) for details).
101 %> @param 'decimateDyson' Logical value. Set true (default) to decimate the sites of the scattering region in the Dyson equation.
102 %> @param 'PotInScatter' Obsolete parameter. Use 'scatterPotential' instead.
103 %> @param 'scatterPotential' A function handle pot=f( #coordinates ) or pot=f( #CreateHamiltonians, Energy) for the potential to be applied in the Hamiltonian (used when FiniteGreensFunctionFromHamiltonian=true).
104 %> @param 'selfEnergy' Logical value. Set true to use the self energies of the leads in the Dyson equation, or false (default) to use the surface Green function instead.
105 %> @param 'Smatrix' Set true (default) to calculate the conductance by using the scattering matrix via #Transport_Interface.Conduktance, or false to use function #Transport_Interface.Conductance2. (The latter one also works with complex energies.)
106 %> @return [1] Conductivity The calculated conductivity.
107 %> @return [2] aspect_ratio The aspect ratio W/L of the junction.
108 %> @return [3] Conductance The conductance tensor
109 %> @return [4] ny Array of the open channel in the leads.
110 %> @return [5] DeltaC Error of the unitarity.
111 %> @return [6] S The scattering matrix.
112  function [Conductivity,aspect_ratio,Conductance,ny,DeltaC,S] = Transport(obj, Energy, varargin)
113 
114  p = inputParser;
115  p.addParameter('constant_channels', false);
116  p.addParameter('gfininvfromHamiltonian', false);
117  p.addParameter('decimateDyson', true);
118  p.addParameter('PotInScatter', []) %OBSOLETE use scatterPotential instead
119  p.addParameter('scatterPotential', []) %NEW overrides optional argument 'PotInScatter'
120  p.addParameter('selfEnergy', false)
121  p.addParameter('Smatrix', true) %logcal value to use the S-matrix method to calculate the conductance or not.
122  p.parse(varargin{:});
123  constant_channels = p.Results.constant_channels;
124  gfininvfromHamiltonian = p.Results.gfininvfromHamiltonian;
125 
126  scatterPotential = p.Results.PotInScatter;
127  if ~isempty( p.Results.scatterPotential )
128  scatterPotential = p.Results.scatterPotential;
129  end
130 
131  decimateDyson = p.Results.decimateDyson;
132  selfEnergy = p.Results.selfEnergy;
133  Smatrix = p.Results.Smatrix;
134 
135  obj.CalcSpectralFunction(Energy, 'constant_channels', constant_channels, 'gfininvfromHamiltonian', gfininvfromHamiltonian, ...
136  'decimateDyson', decimateDyson, 'scatterPotential', scatterPotential, 'SelfEnergy', selfEnergy);
137 
138  if strcmpi(obj.Opt.Lattice_Type, 'Graphene' ) && strcmp(obj.param.scatter.End_Type, 'A')
139  aspect_ratio = (obj.width*3/2)/((obj.height+3)*sqrt(3));
140  elseif strcmpi(obj.Opt.Lattice_Type, 'Graphene' ) && strcmp(obj.param.scatter.End_Type, 'Z')
141  aspect_ratio = ((obj.width-0.5)*sqrt(3))/((obj.height+3)*3);
142  elseif strcmpi(obj.Opt.Lattice_Type, 'Square' )
143  aspect_ratio = obj.width/obj.height;
144  else
145  aspect_ratio = 1;
146  end
147 
148  if Smatrix
149  [S,ny] = obj.FL_handles.SmatrixCalc();
150 
151  norma = norm(S*S'-eye(sum(ny)));
152 
153  if norma >= 1e-3
154  obj.display( ['error of the unitarity of S-matrix: ',num2str(norma)] )
155  end
156 
157  if ny(1) ~= ny(2)
158  obj.display( ['openchannels do not match: ',num2str(ny(1)), ' ', num2str(ny(2))] )
159  end
160 
161 
162 
163  conductance = obj.FL_handles.Conduktance();
164  conductance = abs([conductance(1,:), conductance(2,:)]);
165  DeltaC = std(conductance);
166 
167  C = mean(conductance);
168  Conductivity = C/aspect_ratio;
169  Conductance = C;
170 
171  obj.display( ['aspect ratio = ', num2str(aspect_ratio), ' conductance = ', num2str(C), ' open_channels= ', num2str(ny(1)), ' conductivity = ', num2str(Conductivity)])
172 
173  else
174  Conductance = obj.FL_handles.Conductance2();
175  DeltaC = NaN;
176  Conductivity = Conductance/aspect_ratio;
177  ny = NaN;
178  S = [];
179  obj.display( ['aspect ratio = ', num2str(aspect_ratio), ' conductance = ', num2str(Conductance), ' conductivity = ', num2str(Conductivity)])
180  end
181 
182  end
183 
184 %% getCoordinates
185 %> @brief Gets the coordinates of the central region
186 %> @return [1] Coordinates of the central region.
187 %> @return [2] Coordinates of the interface region.
188 function [coordinates, coordinates_interface] = getCoordinates( obj )
189  try
190  coordinates = obj.Scatter_UC.Read('coordinates');
191  H1 = obj.Scatter_UC.Read('H1');
192  [rows, cols] = find(H1);
193  rows = unique(rows);
194  cols = unique(cols);
195  fnames = fieldnames(coordinates);
196  for idx = 1:length( fnames )
197  fname = fnames{idx};
198  if strcmp( fname, 'a' ) || strcmp( fname, 'b' ) || strcmp( fname, 'LatticeConstant' )
199  continue
200  elseif strcmp( fname, 'x' )
201  coordinates.(fname) = [coordinates.(fname)(cols); coordinates.(fname)(rows) + (obj.height-1)*coordinates.a(1)];
202  elseif strcmp( fname, 'y' )
203  coordinates.(fname) = [coordinates.(fname)(cols); coordinates.(fname)(rows) + (obj.height-1)*coordinates.a(2)];
204  else
205  if ~isempty(coordinates.(fname))
206  coordinates.(fname) = [coordinates.(fname)(cols); coordinates.(fname)(rows)];
207  end
208  end
209  end
210 
211  catch errCause
212  err = MException('EQuUs:Utils:Ribbon:getCoordinatesFromRibbon', 'Error occured when retriving the coordinates of the ribbon.');
213  err = addCause(err, errCause);
214  save('Error_Ribbon_getCoordinatesFromRibbon.mat');
215  throw( err );
216  end
217 
218 
219  try
220  if isempty( obj.Interface_Regions )
221  coordinates_interface = [];
222  return
223  end
224 
225  coordinates_interface = cell( length(obj.Interface_Regions), 1);
226  for idx = 1:length( obj.Interface_Regions )
227  coordinates_interface{idx} = obj.Interface_Regions{idx}.Read('coordinates');
228  end
229 
230  catch errCause
231  err = MException('EQuUs:Utils:Ribbon:getCoordinatesFromRibbon', 'Error occured when retriving the coordinates of the interface region from a Ribbon interface');
232  err = addCause(err, errCause);
233  save('Error_Ribbon_getCoordinatesFromRibbon.mat');
234  throw( err );
235  end
236 
237 end
238 
239 %% ShiftCoordinates
240 %> @brief Shifts the coordinates of the sites in the ribbon by an integer multiple of the lattice vector. The coordinates of the Leads are automatically adjusted later
241 %> @param shift An integer value.
242  function ShiftCoordinates( obj, shift )
243  obj.Scatter_UC.ShiftCoordinates( shift );
244  if ~isempty( obj.Interface_Regions )
245  for idx = 1:length(obj.Interface_Regions)
246  obj.Interface_Regions{idx}.ShiftCoordinates( shift );
247  end
248  end
249 
250  obj.shift = obj.shift + shift;
251  end
252 
253 %% CreateScatter
254 %> @brief Initializes class #CreateHamiltonians for storing and manipulate the Hamiltonian of the the scattering region. The created object is stored in attribute #CreateH.
255  function Scatter_UC = CreateScatter( obj )
256  Scatter_UC = obj.Scatter_UC.CreateClone('empty', true);
257 
258  % create Hamiltonian of one unit cell of the scattering region
259  Scatter_UC.CreateHamiltonians( 'toSave', 0);
260  Scatter_UC.ShiftCoordinates( obj.shift );
261 
262  %applying transverse potential
263  obj.ApplyTransversePotential( Scatter_UC )
264 
265 
266  % apply magnetic field in the unit cell of the scattering region
267  % can be applied if the vector potential is identical in each unit cells
268  if ~isempty( obj.PeierlsTransform_Scatter ) && isempty(obj.q) && obj.Opt.magnetic_field_trans_invariant %for finite q the vector potential must be parallel to q, and perpendicular to the unit cell vector
269  obj.display(['EQuUs:Utils:',class(obj),':CreateScatter: Applying magnetic field in the unit cell of the scattering region']);
270  obj.PeierlsTransform_Scatter.PeierlsTransformLeads( Scatter_UC );
271  end
272 
273  % Create the Hamiltonian of the scattering region
274  createH = CreateHamiltonians(obj.Opt, obj.param, 'q', obj.q);
275  createH.CreateScatterH( 'Scatter_UC', Scatter_UC );
276 
277  % apply magnetic field in the whole HAmiltonian of the scattering region
278  % can be applied for non-translational invariant vector potentials
279  if ~isempty( obj.PeierlsTransform_Scatter ) && isempty(obj.q) && ~obj.Opt.magnetic_field_trans_invariant
280  obj.display(['EQuUs:Utils:',class(obj),':CreateScatter: Applying magnetic field in the whole Hamiltonian of the scattering region']);
281  obj.PeierlsTransform_Scatter.PeierlsTransform( createH );
282  end
283 
284 
285  obj.CreateH = createH;
286 
287  H0 = Scatter_UC.Read('H0');
288  H1 = Scatter_UC.Read('H1');
289 
290  [rows, cols] = find( H1 );
291  rows = unique(rows); % cols identical to non_singular_sites
292  cols = unique(cols); % cols identical to non_singular_sites
293 
294  % identify sites that would be directly connected to the leads
295  non_singular_sites = [reshape(cols, 1, length(cols)), (obj.height-1)*size(H0,1)+reshape(rows, 1, length(rows))];
296  createH.Write('kulso_szabfokok', non_singular_sites );
297 
298 
299  end
300 
301 %% setEnergy
302 %> @brief Sets the energy for the calculations
303 %> @param Energy The value of the energy in the same units as the Hamiltonian.
304  function setEnergy( obj, Energy )
305 
306  setEnergy@NTerminal( obj, Energy );
307 
308  if ~isempty( obj.Scatter_UC ) && strcmpi(class(obj.Scatter_UC), 'Lead')
309  obj.Scatter_UC.Reset();
310  end
311 
312  if ~isempty(obj.Scatter_UC)
313  obj.CreateRibbon('justHamiltonians', true);
314  end
315 
316  end
317 
318 
319 %% CustomDysonFunc
320 %> @brief Custom Dyson function for a two terminal arrangement on a two dimensional lattice.
321 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
322 %> @param 'gfininv' The inverse of the Greens function of the scattering region. For default the inverse of the attribute #G is used.
323 %> @param 'constant_channels' Logical value. Set true (default) to keep constant the number of the open channels in the leads for each energy value, or false otherwise.
324 %> @param 'onlyGinverz' Logical value. Set true to calculate only the inverse of the total Green operator, or false (default) to calculate #G as well.
325 %> @param 'recalculateSurface' A vector of the identification numbers of the lead surfaces to be recalculated.
326 %> @param 'decimate' Logical value. Set true (default) to eliminate all inner sites in the Greens function and keep only the selected sites. Set false to omit the decimation procedure.
327 %> @param 'kulso_szabfokok' Array of sites to be kept after the decimation procedure. (Use parameter 'keep_sites' instead)
328 %> @param 'selfEnergy' Logical value. Set true to use the self energies of the leads in the Dyson equation, or false (default) to use the surface Green function instead.
329 %> @param 'keep_sites' Name of sites to be kept in the resulted Green function (Possible values are: 'scatter', 'interface', 'lead').
330 %> @param 'UseHamiltonian' Set true if the interface region is matched to the whole Hamiltonian of the scattering center, or false (default) if the surface Green operator of the scattering center is used in the calculations.
331 %> @return [1] The calculated Greens function.
332 %> @return [2] The inverse of the Green operator.
333 %> @return [3] An instance of structure #junction_sites describing the sites in the calculated Green operator.
334  function [Gret, Ginverz, junction_sites] = CustomDysonFunc( obj, varargin ) %NEW output
335 
336  p = inputParser;
337  p.addParameter('gfininv', []);
338  p.addParameter('constant_channels', true);
339  p.addParameter('onlyGinverz', false );
340  p.addParameter('recalculateSurface', [1 2] );
341  p.addParameter('decimate', true );
342  p.addParameter('kulso_szabfokok', []); %The list of sites to be left after the decimation procedure
343  p.addParameter('SelfEnergy', false); %set true to calculate the Dyson equation with the self energy
344  p.addParameter('keep_sites', 'lead'); %Name of sites to be kept (scatter, interface, lead)
345  p.addParameter('UseHamiltonian', false); %true if the interface region is matched to the whole Hamiltonian of the scattering center, false if the surface Green operator of the scattering center is used in the calculations.
346  p.parse(varargin{:});
347  gfininv = p.Results.gfininv;
348  constant_channels = p.Results.constant_channels;
349  onlyGinverz = p.Results.onlyGinverz;
350  recalculateSurface = p.Results.recalculateSurface;
351  decimate = p.Results.decimate;
352  kulso_szabfokok = p.Results.kulso_szabfokok;
353  useSelfEnergy = p.Results.SelfEnergy;
354  keep_sites = p.Results.keep_sites;
355  UseHamiltonian = p.Results.UseHamiltonian;
356 
357 
358  if ~isempty(recalculateSurface)
359 
360  % creating interfaces for the Leads
361  if constant_channels
362  shiftLeads = ones(length(obj.param.Leads),1)*obj.E;
363  else
364  shiftLeads = ones(length(obj.param.Leads),1)*0;
365  end
366 
367  % creating Lead instaces and calculating the retarded surface Green operator/self-energy
368  coordinates_shift = [-2, obj.height+1] + obj.shift;
369  obj.FL_handles.LeadCalc('coordinates_shift', coordinates_shift, 'shiftLeads', shiftLeads, 'transversepotential', obj.transversepotential, ...
370  'SelfEnergy', useSelfEnergy, 'SurfaceGreensFunction', ~useSelfEnergy, 'gauge_field', obj.gauge_field, 'leads', recalculateSurface, 'q', obj.q, ...
371  'leadmodel', obj.leadmodel);
372 
373  for idx = 1:length(recalculateSurface)
374  obj.CreateInterface( recalculateSurface(idx), 'UseHamiltonian', UseHamiltonian );
375  end
376 
377  end
378 
379  [Gret, Ginverz, junction_sites] = CustomDysonFunc@NTerminal(obj, 'gfininv', gfininv, ...
380  'onlyGinverz', onlyGinverz, ...
381  'recalculateSurface', [], ...
382  'decimate', decimate, ...
383  'kulso_szabfokok', kulso_szabfokok, ...
384  'SelfEnergy', useSelfEnergy, ...
385  'keep_sites', keep_sites);
386 
387 
388  end
389 
390 %% CalcFiniteGreensFunction
391 %> @brief Calculates the Green operator of the scattering region by the fast way (see PRB 90, 125428 (2014)).
392 %> @param varargin Cell array of optional parameters identical to #NTerminal.CalcFiniteGreensFunction.
393  function CalcFiniteGreensFunction( obj, varargin )
394 
395  p = inputParser;
396  p.addParameter('gauge_trans', false); % logical: true if want to perform gauge transformation on the Green's function and Hamiltonians
397  p.addParameter('onlyGinv', false);
398  p.parse(varargin{:});
399  gauge_trans = p.Results.gauge_trans;
400  onlyGinv = p.Results.onlyGinv;
401 
402  if ~obj.Scatter_UC.Read('OverlapApplied')
403  obj.Scatter_UC.ApplyOverlapMatrices(obj.E);
404  end
405 
406  % getting the Hamiltonian for the edge slabs
407  K0 = obj.Scatter_UC.Read('K0');
408  K1 = obj.Scatter_UC.Read('K1');
409  K1adj = obj.Scatter_UC.Read('K1adj');
410 
411  q = obj.Scatter_UC.Read('q');
412  if ~isempty( q ) && ~obj.Scatter_UC.Read('HamiltoniansDecimated')
413  K1_transverse = obj.Scatter_UC.Read('K1_transverse');
414  K0 = K0 + K1_transverse*diag(exp(1i*q)) + K1_transverse'*diag(exp(-1i*q));
415  end
416 
417  obj.CreateRibbon();
418 
419  %> transforming the Hamiltonians by SVD if necessary
420  if obj.Scatter_UC.Read('is_SVD_transformed')
421  V = obj.Scatter_UC.Get_V();
422  K0 = V'*K0*V;
423  K1 = V'*K1*V;
424  K1adj = V'*K1adj*V;
425  end
426 
427 
428  %> the first two and last two slabs are added manualy at the end
429  if ~obj.Scatter_UC.Read('is_SVD_transformed')
430  z1 = 1;
431  z2 = obj.height-2;
432  else
433  z1 = 2;
434  z2 = obj.height-3;
435  end
436 
437  obj.G = [];
438  obj.Ginv = [];
439 
440  obj.Scatter_UC.FiniteGreenFunction(z1,z2, 'onlygfininv', true);
441  obj.Ginv = obj.Scatter_UC.Read( 'gfininv' );
442 
443  %> adding to the scattering region the first set of transition layers
444  Neff = obj.Scatter_UC.Get_Neff();
445  non_singular_sites = obj.Scatter_UC.Read( 'kulso_szabfokok' );
446  if isempty( non_singular_sites )
447  non_singular_sites = 1:Neff;
448  end
449 
450  non_singular_sites_edges = [non_singular_sites, size(K0,1)+1:2*size(K0,1)];
451  ginv_edges = -[K0, K1; K1adj, K0];
452  ginv_edges = obj.DecimationFunction( non_singular_sites_edges, ginv_edges );
453 
454  %Ginv = [first_slab, H1, 0;
455  % H1', invG, H1;
456  % 0 , H1', last_slab];
457 
458  obj.Ginv = [ginv_edges(1:Neff,1:Neff), [ginv_edges(1:Neff, Neff+non_singular_sites), zeros(Neff, Neff+size(K0,2))]; ...
459  [ginv_edges(Neff+non_singular_sites, 1:Neff); zeros(Neff, Neff)], obj.Ginv, [zeros(Neff, size(ginv_edges,2)-Neff); ginv_edges(1:Neff, Neff+1:end)]; ...
460  [zeros(size(K0,2),2*Neff), ginv_edges(Neff+1:end, 1:Neff)], ginv_edges(Neff+1:end, Neff+1:end)];
461 
462  [rows, cols] = find( K1 );
463  rows = unique(rows); % cols identical to non_singular_sites
464 
465  %non_singular_sites_Ginv = [1:length(non_singular_sites), size(obj.Ginv,1)-size(K0,1)+1:size(obj.Ginv,1)];
466  non_singular_sites_Ginv = [1:length(non_singular_sites), size(obj.Ginv,1)-size(K0,1)+reshape(rows, 1, length(rows))];
467  obj.Ginv = obj.DecimationFunction( non_singular_sites_Ginv, obj.Ginv );
468 
469 
470  %> terminate the scattering region by the first and last slabs and transform back to the normal space from the SVD representation
471  if obj.Scatter_UC.Read('is_SVD_transformed')
472  %> adding the first and last slab to
473  %Ginv = [first_slab, H1, 0;
474  % H1', invG, H1;
475  % 0 , H1', last_slab];
476 
477  obj.Ginv = [K0, [K1(:, 1:Neff), zeros(size(K0,1), 2*size(K0,2))]; ...
478  [K1adj(1:Neff,:); zeros(size(K0))], obj.Ginv, [zeros(Neff, size(K0,2)); K1]; ...
479  zeros(size(K0)), [zeros(size(K0,1), Neff), K1adj], K0];
480 
481 
482  non_singular_sites_Ginv = [1:size(K0,1), size(obj.Ginv,1)-size(K0,1)+1:size(obj.Ginv,1)];
483  obj.Ginv = obj.DecimationFunction( non_singular_sites_Ginv, obj.Ginv );
484 
485  % transform back to the normal space
486  V_tot = [V, zeros(size(K0)); zeros(size(K0)), V];
487  obj.Ginv = V_tot*obj.Ginv*V_tot';
488  end
489 
490 
491 %disp( obj.Ginv )
492  %> gauge transformation of the vector potential in the effective Hamiltonians
493  if gauge_trans
494  try
495  % gauge transformation on Green's function
496  if ~isempty(obj.Ginv) && ~isempty(obj.PeierlsTransform_Scatter) && isempty(obj.q) && ~isempty(obj.gauge_field)
497  coordinates_scatter = obj.getCoordinates();
498  %> gauge transformation on the inverse Green's function
499  obj.Ginv = obj.PeierlsTransform_Scatter.gaugeTransformation( obj.Ginv, coordinates_scatter, obj.gauge_field );
500  end
501  catch errCause
502  err = MException('EQuUs:Utils:Ribbon:CalcFiniteGreensFunction', 'Unable to perform gauge transformation');
503  err = addCause(err, errCause);
504  save('Error_Ribbon_CalcFiniteGreensFunction.mat')
505  throw(err);
506  end
507  end
508 
509  if ~onlyGinv
510  rcond_Ginv = rcond(obj.Ginv);
511  if isnan(rcond_Ginv ) || abs( rcond_Ginv ) < 1e-15
512  obj.display( 'EQuUs:Utils:Ribbon::CalcFiniteGreensFunction: Regularizing Ginv by SVD', 1);
513  obj.G = obj.inv_SVD( obj.Ginv );
514  else
515  obj.G = inv(obj.Ginv);
516  end
517  obj.Ginv = [];
518  else
519  obj.G = [];
520  end
521 
522  end
523 
524 %% CalcFiniteGreensFunctionFromHamiltonian
525 %> @brief Calculates the Green operator of the scattering region from the whole Hamiltonian.
526 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
527 %> @param 'gauge_trans' Logical value. Set true to perform gauge transformation on the Green operator and on the Hamiltonians.
528 %> @param 'onlyGinv' Logical value. Set true to calculate only the inverse of the surface Greens function #Ginv, or false (default) to calculate #G as well. In the latter case the attribute #Ginv is set to empty at the end.
529 %> @param 'PotInScatter' Obsolete parameter. Use 'scatterPotential' instead.
530 %> @param 'scatterPotential' A function handle pot=f( #coordinates ) or pot=f( #CreateHamiltonians, Energy) for the potential to be applied in the Hamiltonian (used when FiniteGreensFunctionFromHamiltonian=true).
531  function CalcFiniteGreensFunctionFromHamiltonian( obj, varargin )
532 
533  p = inputParser;
534  p.addParameter('gauge_trans', false); % logical: true if want to perform gauge transformation on the Green's function and Hamiltonians
535  p.addParameter('onlyGinv', false);
536  p.addParameter('PotInScatter', []) %OBSOLETE use scatterPotential instead
537  p.addParameter('scatterPotential', []) %NEW overrides optional argument 'PotInScatter', might be a cell array of function handles
538  p.parse(varargin{:});
539  gauge_trans = p.Results.gauge_trans;
540  onlyGinv = p.Results.onlyGinv;
541 
542  scatterPotential = p.Results.PotInScatter;
543  if ~isempty( p.Results.scatterPotential )
544  scatterPotential = p.Results.scatterPotential;
545  end
546 
547  obj.CreateScatter();
548  CreateH = obj.CreateH.CreateClone();
549 
550  Hscatter = CreateH.Read('Hscatter');
551  Hscatter_transverse = CreateH.Read('Hscatter_transverse');
552 
553 
554  %> apply magnetic field in scatter for finite q
555  if ~isempty( obj.PeierlsTransform_Scatter ) && ~isempty(obj.q)
556  obj.display('EQuUs:Utils:Ribbon:CalcFiniteGreensFunctionFromHamiltonian: Applying magnetic field in the scattering region')
557  obj.PeierlsTransform_Scatter.PeierlsTransform( CreateH );
558  end
559 
560  %> apply custom potential in the scattering center
561  if ~isempty(scatterPotential)
562  if iscell( scatterPotential )
563  for idx = 1:length( scatterPotential )
564  obj.ApplyPotentialInScatter( CreateH, scatterPotential{idx} );
565  end
566  else
567  obj.ApplyPotentialInScatter( CreateH, scatterPotential);
568  end
569  Hscatter = CreateH.Read('Hscatter');
570  end
571 
572  non_singular_sites_Ginv = CreateH.Read('kulso_szabfokok');
573 
574 
575  q = CreateH.Read('q');
576  if ~isempty( q ) && ~CreateH.Read('HamiltoniansDecimated')
577  Hscatter = Hscatter + Hscatter_transverse*diag(exp(1i*q)) + Hscatter_transverse'*diag(exp(-1i*q));
578  end
579 
580  obj.display('EQuUs:Utils:Ribbon:CalcFiniteGreensFunctionFromHamiltonian: Calculating the surface Green function of the scattering region.')
581  Hscatter = (sparse(1:size(Hscatter,1), 1:size(Hscatter,1), obj.E, size(Hscatter,1),size(Hscatter,1)) - Hscatter);
582  indexes = false( size(Hscatter,1), 1);
583  indexes(non_singular_sites_Ginv) = true;
584  Hscatter = [ Hscatter( ~indexes, ~indexes) , Hscatter(~indexes, indexes);
585  Hscatter(indexes, ~indexes), Hscatter(indexes, indexes)];
586 
587  obj.G = obj.partialInv( Hscatter, length(non_singular_sites_Ginv) );
588 
589  obj.CreateRibbon('justHamiltonians', true);
590 
591 %disp( inv(obj.G) )
592  %> gauge transformation of the vector potential in the effective Hamiltonians
593  if gauge_trans
594  try
595  % gauge transformation on Green's function
596  if ~isempty(obj.G) && ~isempty(obj.PeierlsTransform_Scatter) && isempty(obj.q) && ~isempty(obj.gauge_field)
597  surface_coordinates = obj.getCoordinates();
598  %> gauge transformation on the inverse Green's function
599  obj.G = obj.PeierlsTransform_Scatter.gaugeTransformation( obj.G, surface_coordinates, obj.gauge_field );
600  end
601  catch errCause
602  err = MException('EQuUs:Utils:Ribbon:CalcFiniteGreensFunctionFromHamiltonian', 'Unable to perform gauge transformation');
603  err = addCause(err, errCause);
604  save('Error_Ribbon_CalcFiniteGreensFunctionFromHamiltonian.mat')
605  throw(err);
606  end
607  end
608 
609  if onlyGinv
610  rcond_G = rcond(obj.G);
611  if isnan(rcond_G ) || abs( rcond_G ) < 1e-15
612  obj.display( 'EQuUs:Utils:Ribbon:CalcFiniteGreensFunctionFromHamiltonian: Regularizing Ginv by SVD',1);
613  obj.Ginv = obj.inv_SVD( obj.G );
614  else
615  obj.Ginv = inv(obj.G);
616  end
617  obj.G = [];
618  else
619  obj.Ginv = [];
620  end
621  end
622 
623 %% CreateRibbon
624 %> @brief Creates the Hamiltonians for the ribbon shaped scattering region.
625 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
626 %> @param 'justHamiltonians' Logical value. Set true to create the Hamiltonian of the unit cell without performing any further calculations. (default value is 'false')
627  function CreateRibbon( obj, varargin )
628 
629  p = inputParser;
630  p.addParameter('justHamiltonians', false);
631  p.parse(varargin{:});
632  justHamiltonians = p.Results.justHamiltonians;
633 
634 
635  if ~obj.Scatter_UC.Read( 'HamiltoniansCreated' )
636  obj.display( 'EQuUs:Utils:Ribbon:CreateRibbon: Creating ribbon Hamiltonian.' )
637  obj.Scatter_UC.CreateHamiltonians( 'toSave', 0);
638  obj.Scatter_UC.ShiftCoordinates( obj.shift );
639 
640  %applying transverse potential
641  obj.ApplyTransversePotential( obj.Scatter_UC )
642  end
643 
644 
645 
646 
647  % apply magnetic field in scatter
648  if ~isempty( obj.PeierlsTransform_Scatter ) && ~obj.Scatter_UC.Read('MagneticFieldApplied') && obj.Opt.magnetic_field_trans_invariant
649  obj.display('EQuUs:Utils:Ribbon:CreateRibbon: Applying magnetic field in ribbon Hamiltonians')
650  obj.PeierlsTransform_Scatter.PeierlsTransformLeads( obj.Scatter_UC );
651  end
652 
653  if justHamiltonians
654  return
655  end
656 
657  if ~obj.Scatter_UC.Read('HamiltoniansDecimated' )
658  obj.display( 'EQuUs:Utils:Ribbon:CreateRibbon: Solving the eigenproblem in the scattering region' )
659 
660  %> Trukkos sajatertek
661  obj.display(['EQuUs:Utils:Ribbon:CreateRibbon: Eigenvalues of the scattering region'])
662  obj.Scatter_UC.TrukkosSajatertekek(obj.E);
663  %> group velocity
664  obj.display(['EQuUs:Utils:Ribbon:CreateRibbon: Group velocity for the scattering region'])
665  obj.Scatter_UC.Group_Velocity();
666  end
667 
668  end
669 
670 
671 %% CreateInterface
672 %> @brief Creates the Hamiltonians for the interface regions between the leads and scattering center.
673 %> @param idx Identification number of the interface region.
674 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
675 %> @param 'UseHamiltonian' Logical value. Set true if the interface region should be created to match to the whole Hamiltonian of the scattering center, false (default) if only the surface Green operator of the scattering center is used in the calculations.
676  function CreateInterface( obj, idx, varargin )
677 
678  p = inputParser;
679  p.addParameter('UseHamiltonian', false); %true if the interface region is matched to the whole Hamiltonian of the scattering center, false if the surface Green operator of the scattering center is used in the calculations.
680  p.parse(varargin{:});
681  UseHamiltonian = p.Results.UseHamiltonian;
682 
683  %> Hamiltoninans of the interface region
684  Interface_Region = obj.Interface_Regions{idx};
685 
686  % The regularization of the interface is performed according to the Leads
687  Leads = obj.FL_handles.Read( 'Leads' );
688  Lead = Leads{idx};
689 
690  Interface_Region.Write( 'coordinates2', obj.getCoordinates() );
691  Interface_Region.Write( 'K0', Lead.Read('K0'));
692  Interface_Region.Write( 'K1', Lead.Read('K1'));
693  Interface_Region.Write( 'K1adj', Lead.Read('K1adj'));
694  Interface_Region.Write( 'K1_transverse', Lead.Read('K1_transverse'));
695  Interface_Region.Write( 'coordinates', Lead.Read('coordinates'));
696  Interface_Region.Write( 'kulso_szabfokok', Lead.Read('kulso_szabfokok'));
697  Interface_Region.Write( 'OverlapApplied', true);
698 
699  coordinates_shift = [1, -1 ]; %relative to the leads
700  Interface_Region.ShiftCoordinates( coordinates_shift(idx) );
701 
702  %> coupling between the interface and the scattering region
703  Surface_sc = obj.createSurface_sc( idx );
704  Surface_sc.ApplyOverlapMatrices(obj.E);
705 
706 
707  Lead_Orientation = Surface_sc.Read('Lead_Orientation');
708  K1 = Surface_sc.Read('K1');
709  K1adj = Surface_sc.Read('K1adj');
710  [rows, cols] = find( K1 );
711  rows = unique(rows);
712  cols = unique(cols); % identical as non_singular_sites
713  if Lead_Orientation == 1
714 
715  if UseHamiltonian
716  Hscatter = obj.CreateH.Read('Hscatter');
717  if isempty( Hscatter)
718  error('EQuUs:utils:Ribbon:CreateInterface: Hamiltonian of the scattering region needs to be constructed first.')
719  end
720  Neff = size(Hscatter,1)-size(K1,2);
721  if ~Lead.Read('is_SVD_transformed')
722  % simple decimation
723  Kcoupling = [K1, sparse([], [], [], size(K1,1), Neff )];
724  Kcouplingadj = [K1adj; sparse([], [], [], Neff, size(K1,1))];
725  else
726  % regularization with SVD
727  Kcoupling = [K1, sparse([], [], [], size(K1,1), Neff )];
728  Kcouplingadj = [K1adj; sparse([], [], [], Neff, size(K1,1))];
729  end
730  else
731  Neff = length(rows); %number of coupling sites at Lead_Oriantation=-1
732  if ~Lead.Read('is_SVD_transformed')
733  % simple decimation
734  Kcoupling = [K1(:,cols), zeros( size(K1,1), Neff )];
735  Kcouplingadj = [K1adj(cols,:); zeros(Neff, size(K1,1))];
736  else
737  % regularization with SVD
738  Kcoupling = [K1(:,cols), zeros(size(K1,1), Neff )];
739  Kcouplingadj = [K1adj(cols,:); zeros(Neff, size(K1,1))];
740  end
741  end
742 
743 
744 
745  elseif Lead_Orientation == -1
746 
747  if UseHamiltonian
748  Hscatter = obj.CreateH.Read('Hscatter');
749  if isempty( Hscatter)
750  error('EQuUs:utils:Ribbon:CreateInterface: Hamiltonian of the scattering region needs to be constructed first.')
751  end
752  Neff = size(Hscatter,1)-size(K1adj,2);
753  if ~Lead.Read('is_SVD_transformed')
754  % simple decimation
755  Kcoupling = [sparse([], [], [], length(cols), Neff ), K1adj(cols,:)];
756  Kcouplingadj = [sparse([], [], [], Neff, length(cols)); K1(:,cols)];
757  else
758  % regularization with SVD
759  Kcoupling = [sparse([], [], [], size(K1adj,1), Neff ), K1adj];
760  Kcouplingadj = [sparse([], [], [], Neff, size(K1,1) ); K1];
761  end
762  else
763  Neff = length(cols); %number of coupling sites at Lead_Oriantation=1
764  if ~Lead.Read('is_SVD_transformed')
765  % simple decimation
766  Kcoupling = [zeros(length(cols), Neff), K1adj(cols,rows)];
767  Kcouplingadj = [zeros(Neff, length(cols)); K1(rows,cols)];
768  else
769  % regularization with SVD
770  Kcoupling = [zeros(size(K1,1), Neff), K1adj(:,rows)];
771  Kcouplingadj = [zeros(Neff, size(K1,2)); K1(rows,:)];
772  end
773  end
774 
775 
776  else
777  error('EQuUs:Utils:Ribbon:CreateInterface', 'Unknown lead orientation');
778  end
779 
780 
781 
782  Interface_Region.Write('Kcoupling', Kcoupling);
783  Interface_Region.Write('Kcouplingadj', Kcouplingadj);
784 
785  % method to adjust the interface region and coupling to the scattering region by an external function.
786  if ~isempty( obj.interfacemodel )
787  obj.interfacemodel( Interface_Region );
788  end
789 
790  Interface_Region.Calc_Effective_Hamiltonians( 0, 'Lead', Lead );
791 
792  end
793 
794 %% CreateClone
795 %> @brief Creates a clone of the present object.
796 %> @return Returns with the cloned object.
797  function ret = CreateClone( obj )
798 
799  ret = Ribbon( 'width', obj.width, ...
800  'height', obj.height, ...
801  'filenameIn', obj.filenameIn, ...
802  'filenameOut', obj.filenameOut, ...
803  'E', obj.E, ...
804  'EF', 0, ...
805  'phi', obj.phi, ...
806  'silent', obj.silent, ...
807  'transversepotential', obj.transversepotential, ...
808  'Opt', obj.Opt, ...
809  'param', obj.param, ...
810  'q', obj.q, ...
811  'leadmodel', obj.leadmodel, ...
812  'interfacemodel', obj.interfacemodel);
813 
814  ret.EF = obj.EF;
815  ret.CreateH = obj.CreateH.CreateClone();
816  ret.FL_handles = obj.FL_handles.CreateClone();
817  ret.Scatter_UC = obj.Scatter_UC.CreateClone();
818  ret.Interface_Regions = cell(size(obj.Interface_Regions));
819  for idx = 1:length(obj.Interface_Regions)
820  ret.Interface_Regions{idx} = obj.Interface_Regions{idx}.CreateClone();
821  end
822  if ~isempty( obj.PeierlsTransform_Scatter )
823  ret.PeierlsTransform_Scatter = obj.PeierlsTransform_Scatter.CreateClone();
824  end
825 
826  if ~isempty( obj.PeierlsTransform_Leads )
827  ret.PeierlsTransform_Leads = obj.PeierlsTransform_Leads.CreateClone();
828  end
829  ret.gauge_field = obj.gauge_field; % function handle for the scalar field to transform the vector potential from Landauy to Landaux
830 
831  end
832 
833 
834 end % methods public
835 
836 methods ( Access = protected )
837 
838 %% setFermiEnergy
839 %> @brief Sets the Fermi energy on the atomic sites for the calculations (use the same units as the elements of the Hamiltonian).
840  function setFermiEnergy( obj )
841  if ~isempty(obj.EF)
842  obj.param.scatter.epsilon = obj.param.scatter.epsilon - obj.EF;
843  for idx = 1:length(obj.param.Leads)
844  obj.param.Leads{idx}.epsilon = obj.param.Leads{idx}.epsilon - obj.EF;
845  end
846  end
847  end
848 
849 %% createSurface_sc
850 %> @brief Creates the copuling Hamiltonians between the scattering and interface region
851 %> @param idx The identification number of the interface region. (Integer value.)
852 %> @return An instance of class #Lead describing the copuling between the scattering and interface region
853  function Surface_sc = createSurface_sc( obj, idx )
854  Surface_sc = obj.Scatter_UC.CreateClone('empty', true);
855 
856  if ~isempty( obj.param.Leads{idx}.vargamma_sc )
857  params = Surface_sc.Read( 'params' );
858  params.vargamma = obj.param.Leads{idx}.vargamma_sc;
859  Surface_sc.Write( 'params', params );
860  end
861 
862  Surface_sc.CreateHamiltonians( 'toSave', 0);
863  if idx == 1
864  coordinates_shift = 0 + obj.shift ;
865  elseif idx == 2
866  coordinates_shift = obj.height-1 + obj.shift;
867  end
868  Surface_sc.ShiftCoordinates( coordinates_shift )
869  Surface_sc.Write('Hanyadik_Lead', idx);
870  Surface_sc.Write('Lead_Orientation', obj.Interface_Regions{idx}.Read('Lead_Orientation'));
871 
872  %> applying transverse potential
873  obj.ApplyTransversePotential( Surface_sc )
874 
875  %> applying magnetic field
876  if ~isempty( obj.PeierlsTransform_Leads )
877  %> In superconducting lead one must not include nonzero magnetic
878  %> field.
879  %> Hamiltonians in transverse computations must remain
880  %> traslational invariant.
881  if ~Surface_sc.isSuperconducting()
882  obj.display('EQuUs:Utils:Ribbon:createSurface_sc: Applying magnetic field in the Hamiltonians')
883  obj.PeierlsTransform_Leads.PeierlsTransformLeads( Surface_sc );
884  else
885  obj.display('EQuUs:Utils:Ribbon:createSurface_sc: Applying gauge transformation in the Hamiltonians')
886  obj.PeierlsTransform_Leads.gaugeTransformationOnLead( Surface_sc, obj.gauge_field );
887  end
888  end
889 
890 
891  end
892 
893 %% ApplyTransversePotential
894 %> @brief Apply the tranvesre potential in the Hamiltonians
895 %> @param Scatter_UC An instance of class #Lead containing the Hamiltonians.
896  function ApplyTransversePotential( obj, Scatter_UC )
897  if ~isempty(obj.transversepotential) && isempty(obj.q) %In transverse computations no transverse potential can be applied
898  coordinates = Scatter_UC.Read('coordinates');
899  if nargin( obj.transversepotential ) == 1
900  potential2apply = obj.transversepotential( coordinates );
901  elseif nargin( obj.transversepotential ) == 2
902  potential2apply = obj.transversepotential( Scatter_UC, obj.E );
903  else
904  error('EQuUs:Utils:Ribbon:ApplyTransversePotential', 'To many input arguments in function handle scatterpotential');
905  end
906 
907  if isprop(coordinates, 'BdG_u')
908  if size( potential2apply, 1) == 1 || size( potential2apply, 2) == 1
909  potential2apply(~coordinates.BdG_u) = -potential2apply(~coordinates.BdG_u);
910  else
911  potential2apply(~coordinates.BdG_u, ~coordinates.BdG_u) = -conj(potential2apply(~coordinates.BdG_u, ~coordinates.BdG_u));
912  end
913  end
914  Scatter_UC.AddPotential( potential2apply );
915  end
916  end
917 
918 
919 
920 
921 %% CreateHandles
922 %> @brief Initializes the attributes of the class.
923  function CreateHandles( obj )
924 
925  CreateHandles@NTerminal( obj )
926 
927  obj.Scatter_UC = obj.FL_handles.SurfaceGreenFunctionCalculator([], 'createCore', 1, 'q', obj.q);
928 
929  end
930 
931 %% calculate_lead_attach_points
932 %> @brief Determines the site indexes at which the leads are connected to the scattering center.
933  function calculate_lead_attach_points( obj )
934  for idx = 1:length(obj.param.Leads)
935  obj.param.Leads{idx}.M = obj.param.scatter.shape.width;
936  end
937  end
938 
939 %% createShape
940 %> @brief Creates the geometry data of the ribbon shaped scattering region.
941  function createShape( obj )
942 
943  if ~isempty( obj.width ) && ~isempty( obj.height )
944  obj.param.scatter.shape.width = obj.width;
945  obj.param.scatter.shape.height = obj.height;
946  end
947 
948  if ~isempty(obj.param.scatter.shape.width)
949  obj.width = obj.param.scatter.shape.width;
950  else
951  err = MException(['EQuUs:utils:', class(obj), ':createShape'], 'Shape is not given correctly, width is missing');
952  throw(err)
953  end
954 
955  if ~isempty(obj.param.scatter.shape.height)
956  obj.height = obj.param.scatter.shape.height;
957  else
958  err = MException(['EQuUs:utils:', class(obj), ':createShape'], 'Shape is not given correctly, height is missing');
959  throw(err)
960  end
961 
962  obj.calculate_lead_attach_points();
963 
964  end
965 
966 end % protected methods
967 
968 
969 methods (Access=protected)
970 
971 
972 %% InputParsing
973 %> @brief Parses the optional parameters for the class constructor.
974 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
975 %> @param 'width' Integer. The number of the nonsingular atomic sites in the cross section of the ribbon.
976 %> @param 'height' Integer. The height of the ribbon in units of the lattice vector.
977 %> @param 'filenameIn' The input filename containing the computational parameters. (Use parameters 'Op' and 'param' instead)
978 %> @param 'filenameOut' The output filename to export the computational parameters.
979 %> @param 'WorkingDir' The absolute path to the working directoy.
980 %> @param 'E' The energy value used in the calculations (in the same units as the Hamiltonian).
981 %> @param 'EF' The Fermi energy in the same units as the Hamiltonian. Attribute #E is measured from this value. (Use for equilibrium calculations in the zero temperature limit. Overrides the one comming from the external source)
982 %> @param 'silent' Set true to suppress output messages.
983 %> @param 'transversepotential' A function handle pot = f( #coordinates ) or pot=f( #CreateLeadHamiltonians, Energy) of the transverse potential applied in the lead. (Instead of #CreateLeadHamiltonians can be used its derived class)
984 %> @param 'leadmodel' A function handle #Lead=f( idx, E, varargin ) of the alternative lead model with equivalent inputs and return values as #Transport_Interface.SurfaceGreenFunctionCalculator and with E standing for the energy.
985 %> @param 'interfacemodel' A function handle f( #InterfaceRegion ) to manually adjus the interface regions. (Usefull when 'leadmodel' is also given. For example see @InterfaceModel)
986 %> @param 'Opt' An instance of the structure #Opt.
987 %> @param 'param' An instance of the structure #param.
988 %> @param 'q' The transverse momentum quantum number.
989  function InputParsing( obj, varargin )
990 
991  p = inputParser;
992  p.addParameter('width', obj.width);
993  p.addParameter('height', obj.height);
994  p.addParameter('filenameIn', obj.filenameIn, @ischar);
995  p.addParameter('filenameOut', obj.filenameOut, @ischar);
996  p.addParameter('WorkingDir', obj.WorkingDir, @ischar);
997  p.addParameter('E', obj.E, @isscalar);
998  p.addParameter('EF', obj.EF);
999  p.addParameter('silent', obj.silent);
1000  p.addParameter('transversepotential', obj.transversepotential);
1001  p.addParameter('leadmodel', obj.leadmodel); %individual physical model for the contacts
1002  p.addParameter('interfacemodel', obj.interfacemodel); %individual physical model for the interface regions
1003  p.addParameter('Opt', obj.Opt);
1004  p.addParameter('param', obj.param);
1005  p.addParameter('q', obj.q);
1006 
1007  p.parse(varargin{:});
1008 
1009  InputParsing@NTerminal( obj, 'filenameIn', p.Results.filenameIn, ...
1010  'filenameOut', p.Results.filenameOut, ...
1011  'WorkingDir', p.Results.WorkingDir, ...
1012  'E', p.Results.E, ...
1013  'EF', p.Results.EF, ...
1014  'silent', p.Results.silent, ...
1015  'leadmodel', p.Results.leadmodel, ...
1016  'interfacemodel', p.Results.interfacemodel, ...
1017  'Opt', p.Results.Opt, ...
1018  'param', p.Results.param, ...
1019  'q', p.Results.q);
1020 
1021 
1022  obj.width = p.Results.width;
1023  obj.height = p.Results.height;
1024  obj.transversepotential = p.Results.transversepotential;
1025 
1026  end
1027 
1028 end % methdos private
1029 
1030 
1031 
1032 end
A class describing an N-terminal geometry for equilibrium calculations mostly in the zero temperature...
Definition: NTerminal.m:38
function isSuperconducting()
Test, whether the lead is in the superconducting phase or not.
function InputParsing(varargin)
Parses the optional parameters for the class constructor.
lead_param Leads
A list of structures lead_param containing the physical parameters for the scattering region.
Definition: structures.m:49
function Landaux(x, y, eta_B, Aconst, height, lattice_constant)
Vector potential in the Landau gauge parallel to the x direction.
Property q
The tranverse momentum for transverse computations.
function CreateClone(varargin)
Creates a clone of the present class.
Property params
An instance of the structure lead_param.
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
Structure open_channels describes the open channel in the individual leads.
Definition: structures.m:159
function Conduktance()
Calculates the conductance matrix from the scattering matrix.
Structure shape contains data about the geometry of the scattering region.
Definition: structures.m:106
function Write(MemberName, input)
Sets the value of an attribute in the class.
Class to create and store Hamiltonian of the translational invariant leads.
Property Interface_Regions
A cell array of classes InterfaceRegion to describe the interface region between the leads and the sc...
Definition: NTerminal.m:77
A class for calculations on a ribbon of finite width for equilibrium calculations mostly in the zero ...
Definition: Ribbon.m:34
Property H1
The coupling Hamiltonian between the unit cells.
function CalcFiniteGreensFunction(varargin)
Calculates the Green operator of the scattering region.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
function createShape(theNode, param_structure)
This function creates structure shape for the scattering region.
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 varargin
list of optional parameters (see http://www.mathworks.com/help/matlab/ref/varargin....
function createOutput(filename, Opt, param)
This function creates an output file containing the running parameters.
function Landauy(x, y, eta_B)
Vector potential in the Landau gauge parallel to the y direction.
function CreateHamiltonians(Opt, param, varargin)
Constructor of the class.
function CreateHamiltonians(varargin)
Creates the Hamiltonians H_0 and H_1 of the lead.
Property q
A transverse momentum.
function Reset()
Resets all elements in the class.
Property Hcoupling
Coupling Hamiltonian from the interface region to the scattering region.
A class describing the interface region between the scattering region and a lead.
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()
function InterfaceModel(Interface_Region)
Method to adjust the Hamiltonians of the interface regions.
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
Property Lead_Orientation
The orientation of the lead. Set +1 is the "incoming" direction of the propagating states is defined ...
scatter_param scatter
An instance of the structure scatter_param containing the physical parameters for the scattering regi...
Definition: structures.m:47
Structure sites contains data to identify the individual sites in a matrix.
Definition: structures.m:187
function ShiftCoordinates(shift)
Shifts the coordinates of the sites by an integer multiple of the lattice vector Coordinates....
function Read(MemberName)
Query for the value of an attribute in the class.
Property Opt
An instance of structure Opt.
Definition: Messages.m:31
function CreateClone(varargin)
Creates a clone of the present Lead object.
function SurfaceGreenFunctionCalculator(idx, varargin)
Calculates the surface Green's function or the self energy of a Lead.
function gauge_field(x, y, eta_B, Aconst, height, lattice_constant)
Scalar gauge field connecting Landaux and Landauy gauges.
function Conductance2()
Conductance calculated by Eq (19) in PRB 73 085414.
Property E
The energy value for which the TrukkosSajatertekek eigenvalue problem was solved.
Structure containing the coordinates and other quantum number identifiers of the sites in the Hamilto...
Definition: Coordinates.m:24
function AddPotential(V)
Adds on-site potential to the Hamiltonian H0.
function Read(MemberName)
Query for the value of an attribute in the class.
Structure junction_sites contains data to identify the individual sites of the leads,...
Definition: structures.m:176
Property coordinates
An instance of the structure coordinates.
A class to create and store Hamiltonian of the scattering region.