Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
Lead_Keldysh.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities - Lead_Keldysh
2 % Copyright (C) 2009-2018 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 basic Basic Functionalities
18 %> @{
19 %> @file Lead_Keldysh.m
20 %> @brief A class to calculate the Keldysh lesser and greater Green functions and self energies of a translational invariant lead.
21 %> @}
22 %> @brief A class to calculate the Keldysh lesser and greater Green functions and self energies of a translational invariant lead.
23 %> The notations and the structure of the Hamiltonian is defined accroding to the following image:
24 %> @image html Lead_Hamiltonian.jpg
25 %> @image latex Lead_Hamiltonian.jpg
26 %> @Available
27 %> EQuUs v4.9 or later
28 %%
30 
31 
32 properties ( Access = protected )
33  %>The matrix of the lesser surface Greens function of the semi-infinite ribbon.
34  lessergsurf
35  %>The matrix of the lesser Greens function of the infinite ribbon.
36  lesserginf
37  %>The matrix of the lesser surface Greens function of a finite ribbon.
38  lessergfin
39  %>The lesser self-energy of the semi-infinite ribbon.
40  lesserSigma
41  %>The bias on the lead in units of the energy unit in the elements of the Hamiltonian
42  bias
43 end
44 
45 
46 
47 methods ( Access = public )
48 %% Lead_Keldysh
49 %> @brief Constructor of the class.
50 %> @param Opt An instance of the structure #Opt.
51 %> @param param An instance of structure #param.
52 %> @param varargin Cell array of optional parameters. For details see #InputParsing.
53 %> @return An instance of the class
54  function obj = Lead_Keldysh(Opt, param, varargin)
55  obj = obj@Lead( Opt, param, varargin{:} );
56 
57  obj.lessergsurf = [];
58  obj.lesserginf = [];
59  obj.lessergfin = [];
60  obj.lesserSigma = [];
61  obj.bias = [];
62  end
63 
64 
65 
66 %% LesserSurfaceGreenFunction
67 %> @brief Calculates the lesser Green function of a semi-infinite lead for eregy #E. The calculated Green function is stored by the attribute #lessergsurf.
68  function LesserSurfaceGreenFunction( obj, varargin )
69 
70  % Here we calculate the redarded Green function
71  obj.SurfaceGreenFunction( 'CalcInverse', false );
72 
73  % Here we calculate the lesser Green function from the retarted surface Green function.
74  if isempty( obj.E )
75  error(['EQuUs:', class(obj), ':LesserSurfaceGreenFunction: eigenvalue problem needs to be solved first.'])
76  end
77 
78  % the termal occupation number
79  if obj.Opt.BdG
80  % if the BdG model is enabled
81  if obj.isSuperconducting()
82  % in case the lead is superconducting
83  % working only for unbiased lead!!!!!!
84  occupation_num = obj.Fermi(obj.E);
85  else
86  % in case of normal lead in the BdG model
87  occupation_num_electron = obj.Fermi(obj.E - obj.bias); % occupation number for electrons
88  occupation_num_hole = obj.Fermi(obj.E + obj.bias); % occupation number for electrons
89  occupation_num = kron( [occupation_num_electron,0; 0, occupation_num_hole], eye(size(obj.Sigma)/2) );
90  end
91  else
92  % for normal systems
93  occupation_num = obj.Fermi(obj.E);
94  end
95 
96  % Eq (56) in Adv. Nat. Sci.: Nanosci. Nanotechnol. 5 (2014) 033001
97  obj.lessergsurf = (obj.gsurf' - obj.gsurf)*occupation_num;
98 
99 
100  end
101 
102 
103 %% LesserSelfEnergy
104 %> @brief Calculates the lesser self energy of a semi-infinite lead for energy #E according to Eq (41) in Adv. Nat. Sci.: Nanosci. Nanotechnol. 5 (2014) 033001. The calculated lesser self energy is stored by attribute #lesserSigma.
105 %> @return Returns with the calculated self energy.
106 function ret = LesserSelfEnergy( obj )
107 
108  % Here we calculate the lesser self energy from the effective coupling of the lead
109  if isempty( obj.E )
110  error(['EQuUs:', class(obj), ':LesserSelfEnergy: eigenvalue problem needs to be solved first.'])
111  end
112 
113  % calculate the retarded self-energy if it was not already calculated
114  if isempty( obj.Sigma )
115  obj.SelfEnergy();
116  end
117 
118  % the termal occupation number
119  if obj.Opt.BdG
120  % if the BdG model is enabled
121  if obj.isSuperconducting()
122  % in case the lead is superconducting
123  % working only for unbiased lead!!!!!!
124  occupation_num = obj.Fermi(obj.E);
125  else
126  % in case of normal lead in the BdG model
127  occupation_num_electron = obj.Fermi(obj.E - obj.bias); % occupation number for electrons
128  occupation_num_hole = obj.Fermi(obj.E + obj.bias); % occupation number for electrons
129  occupation_num = kron( [occupation_num_electron,0; 0, occupation_num_hole], eye(size(obj.Sigma)/2) );
130  end
131  else
132  % for normal systems
133  occupation_num = obj.Fermi(obj.E);
134  end
135 
136  %obj.display(['EQuUs:', class(obj), ':LesserSelfEnergy: Occupation number = ', num2str( occupation_num ), ', Energy: ', num2str(obj.E), ', temperature = ', num2str(obj.T)]);
137 
138  % Eq (41) in Adv. Nat. Sci.: Nanosci. Nanotechnol. 5 (2014) 033001
139  obj.lesserSigma = ((obj.Sigma)'-obj.Sigma)*occupation_num;
140 
141  ret = obj.lesserSigma;
142 
143 end
144 
145 
146 
147 
148 end % end public methods
149 
150 
151 
152 methods ( Access = protected )
153 
154 %% Initialize
155 %> @brief Initializes class attributes.
156  function Initialize(obj)
157  Initialize@Lead(obj);
158  end
159 
160 end
161 
162 
163 methods ( Access = public )
164 %% CreateClone
165 %> @brief Creates a clone of the present Lead object.
166 %> @return Returns with the cloned object.
167 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
168 %> @param 'empty' Set true to create an empty clone, or false (default) to clone all atributes.
169  function ret = CreateClone( obj, varargin )
170 
171  p = inputParser;
172  p.addParameter('empty', false );
173 
174  p.parse(varargin{:});
175  empty = p.Results.empty;
176 
177  ret = Lead_Keldysh(obj.Opt, obj.param,...
178  'Hanyadik_Lead', obj.Hanyadik_Lead,...
179  'Lead_Orientation', obj.Lead_Orientation, ...
180  'mu', obj.mu, ...
181  'bias', obj.bias, ...
182  'T', obj.T, ...
183  'q', obj.q);
184 
185  if empty
186  return
187  end
188 
189  meta_data = metaclass(obj);
190 
191  for idx = 1:length(meta_data.PropertyList)
192  prop_name = meta_data.PropertyList(idx).Name;
193  if strcmpi( prop_name, 'SelfEnergyCalc' ) || strcmpi( prop_name, 'GinfCalc' )
194  continue
195  elseif strcmpi( prop_name, 'next_SVD_cycle' )
196  if ~isempty( obj.next_SVD_cycle )
197  ret.next_SVD_cycle = obj.next_SVD_cycle.CreateClone();
198  end
199  else
200  ret.Write( prop_name, obj.(prop_name));
201  end
202  end
203 
204  end
205 
206 %% setTemperature
207 %> @brief Sets the temperature in the calculations
208 %> @param T The value of the temperature in Kelvins.
209  function setTemperature( obj, T )
210  setTemperature@FermiDirac( obj, T );
211 
212  % resetting the temperature dependent attributes
213  obj.lessergsurf = [];
214  obj.lesserginf = [];
215  obj.lessergfin = [];
216  obj.lesserSigma = [];
217  end
218 
219 %% Reset
220 %> @brief Resets all elements in the class.
221  function Reset( obj )
222 
223  if strcmpi( class(obj), 'Lead_Keldysh' )
224  meta_data = metaclass(obj);
225 
226  for idx = 1:length(meta_data.PropertyList)
227  prop_name = meta_data.PropertyList(idx).Name;
228  if strcmp(prop_name, 'Opt') || strcmp( prop_name, 'param') || strcmp(prop_name, 'varargin') || strcmp(prop_name, 'k_B') || strcmp(prop_name, 'T_treshold')
229  continue
230  end
231  obj.Clear( prop_name );
232  end
233  end
234 
235  obj.Initialize();
236 
237  end
238 
239 %% Write
240 %> @brief Sets the value of an attribute in the class.
241 %> @param MemberName The name of the attribute to be set.
242 %> @param input The value to be set.
243  function Write(obj, MemberName, input)
244 
245  if strcmpi(MemberName, 'param') || strcmpi(MemberName, 'params')
246  Write@CreateLeadHamiltonians( obj, MemberName, input );
247  return
248  elseif strcmpi(MemberName, 'T')
249  obj.setTemperature( input );
250  else
251  try
252  obj.(MemberName) = input;
253  catch
254  error(['EQuUs:', class(obj), ':Read'], ['No property to write with name: ', MemberName]);
255  end
256  end
257 
258  end
259 %% Read
260 %> @brief Query for the value of an attribute in the class.
261 %> @param MemberName The name of the attribute to be set.
262 %> @return Returns with the value of the attribute.
263  function ret = Read(obj, MemberName)
264 
265  if strcmp(MemberName, 'd_modusmtx_p')
266  obj.calcDualModes()
267  ret = obj.d_modusmtx_p;
268  return
269  elseif strcmp(MemberName, 'd_modusmtx_m')
270  obj.calcDualModes()
271  ret = obj.d_modusmtx_m;
272  return
273  else
274  try
275  ret = obj.(MemberName);
276  catch
277  error(['EQuUs:', class(obj), ':Read'], ['No property to read with name: ', MemberName]);
278  end
279  end
280 
281 
282  end
283 %% Clear
284 %> @brief Clears the value of an attribute in the class.
285 %> @param MemberName The name of the attribute to be cleared.
286  function Clear(obj, MemberName)
287  try
288  obj.(MemberName) = [];
289  catch
290  error(['EQuUs:', class(obj), ':Clear'], ['No property to clear with name: ', MemberName]);
291  end
292 
293  end
294 
295 end
296 
297 
298 methods (Access=protected)
299 
300 
301 %% InputParsing
302 %> @brief Parses the optional parameters for the class constructor.
303 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
304 %> @param 'Hanyadik_Lead' The ID number of the current lead. Set to empty (default) for using parameters of the scatter region.
305 %> @param 'Lead_Orientation' Orientation of the lead. Set +1 (default) is the "incoming" direction of the propagating states is defined in the +x or +y direction, and "-1" otherwise.
306 %> @param 'q' The transverse momentum. Set to empty (default) for computations without transverse momentums.
307 %> @param 'T' The absolute temperature in Kelvins.
308  function InputParsing( obj, varargin )
309  p = inputParser;
310  p.addParameter('Hanyadik_Lead', []);
311  p.addParameter('Lead_Orientation', 1);
312  p.addParameter('q', []);
313  p.addParameter('T', 0 );
314  p.addParameter('bias', 0, @isscalar);
315 
316  % keeping unmatched attributes that possibly comes from the derived classes
317  p.KeepUnmatched = true;
318 
319  p.parse(varargin{:});
320 
321  InputParsing@FermiDirac( obj, 'T', p.Results.T, 'mu', 0 );
322  InputParsing@Lead( obj, 'Hanyadik_Lead', p.Results.Hanyadik_Lead, ...
323  'Lead_Orientation', p.Results.Lead_Orientation, ...
324  'q', p.Results.q );
325 
326  obj.bias = p.Results.bias;
327 
328  end
329 
330 end % private methods
331 
332 
333 
334 %------------------------------------------------------------------
335 end % Global End
A class describing the Fermi Dirac distribution of fermionic particles.
Definition: FermiDirac.m:25
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
Class to create and store Hamiltonian of the translational invariant leads.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
A class to calculate the Green functions and self energies of a translational invariant lead The nota...
Definition: Lead.m:29
function()
A class to calculate the Keldysh lesser and greater Green functions and self energies of a translatio...
Definition: Lead_Keldysh.m:29
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
function SurfaceGreenFunction(varargin)
Calculates the surface Green function of a semi-infinite lead for eregy E.