2 % Copyright (C) 2009-2018 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 basic Basic Functionalities
20 %> @brief A
class to calculate the Keldysh lesser and greater Green functions and
self energies of a translational invariant lead.
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
27 %> EQuUs v4.9 or later
32 properties ( Access =
protected )
33 %>The matrix of the lesser surface Greens
function of the semi-infinite ribbon.
35 %>The matrix of the lesser Greens
function of the infinite ribbon.
37 %>The matrix of the lesser surface Greens
function of a finite ribbon.
39 %>The lesser
self-energy of the semi-infinite ribbon.
41 %>The bias on the lead in units of the energy unit in the elements of the Hamiltonian
47 methods ( Access =
public )
49 %> @brief Constructor of the
class.
52 %> @
param varargin Cell array of optional parameters. For details see #InputParsing.
53 %> @
return An instance of the
class 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 )
70 % Here we calculate the redarded Green
function 73 % Here we calculate the lesser Green
function from the retarted surface Green
function.
75 error(['EQuUs:', class(obj), ':LesserSurfaceGreenFunction: eigenvalue problem needs to be solved first.'])
78 % the termal occupation number
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);
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) );
93 occupation_num = obj.Fermi(obj.E);
96 % Eq (56) in Adv. Nat. Sci.: Nanosci. Nanotechnol. 5 (2014) 033001
97 obj.lessergsurf = (obj.gsurf' - obj.gsurf)*occupation_num;
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 )
108 % Here we calculate the lesser
self energy from the effective coupling of the lead
110 error(['EQuUs:', class(obj), ':LesserSelfEnergy: eigenvalue problem needs to be solved first.'])
113 % calculate the retarded self-energy if it was not already calculated
114 if isempty( obj.Sigma )
118 % the termal occupation number
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);
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) );
133 occupation_num = obj.Fermi(obj.E);
136 %obj.display(['EQuUs:', class(obj), ':LesserSelfEnergy: Occupation number = ', num2str( occupation_num ), ', Energy: ', num2str(obj.E), ', temperature = ', num2str(obj.T)]);
138 % Eq (41) in Adv. Nat. Sci.: Nanosci. Nanotechnol. 5 (2014) 033001
139 obj.lesserSigma = ((obj.Sigma)'-obj.Sigma)*occupation_num;
141 ret = obj.lesserSigma;
148 end % end public methods
152 methods ( Access = protected )
155 %> @brief Initializes class attributes.
157 Initialize@
Lead(obj);
163 methods ( Access = public )
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:
168 %> @
param 'empty' Set true to create an empty clone, or false (default) to clone all atributes.
169 function ret = CreateClone( obj, varargin )
172 p.addParameter('empty', false );
174 p.parse(varargin{:});
175 empty = p.Results.empty;
178 'Hanyadik_Lead', obj.Hanyadik_Lead,...
179 'Lead_Orientation', obj.Lead_Orientation, ...
181 'bias', obj.bias, ...
189 meta_data = metaclass(obj);
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' )
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();
200 ret.Write( prop_name, obj.(prop_name));
207 %> @brief Sets the temperature in the calculations
208 %> @
param T The value of the temperature in Kelvins.
212 % resetting the temperature dependent attributes
213 obj.lessergsurf = [];
216 obj.lesserSigma = [];
220 %> @brief Resets all elements in the class.
224 meta_data = metaclass(obj);
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')
231 obj.Clear( prop_name );
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)
245 if strcmpi(MemberName, '
param') || strcmpi(MemberName, 'params')
248 elseif strcmpi(MemberName, 'T')
249 obj.setTemperature( input );
252 obj.(MemberName) = input;
254 error(['EQuUs:', class(obj), ':Read'], ['No property to write with name: ', MemberName]);
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)
265 if strcmp(MemberName, 'd_modusmtx_p')
267 ret = obj.d_modusmtx_p;
269 elseif strcmp(MemberName, 'd_modusmtx_m')
271 ret = obj.d_modusmtx_m;
275 ret = obj.(MemberName);
277 error(['EQuUs:', class(obj), ':Read'], ['No property to read with name: ', MemberName]);
284 %> @brief Clears the value of an attribute in the class.
285 %> @
param MemberName The name of the attribute to be cleared.
288 obj.(MemberName) = [];
290 error(['EQuUs:', class(obj), ':Clear'], ['No property to clear with name: ', MemberName]);
298 methods (Access=protected)
302 %> @brief Parses the optional parameters for the class constructor.
303 %> @
param varargin Cell array of optional parameters (https:
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 )
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);
316 % keeping unmatched attributes that possibly comes from the derived classes
317 p.KeepUnmatched = true;
319 p.parse(varargin{:});
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, ...
326 obj.bias = p.Results.bias;
330 end %
private methods
334 %------------------------------------------------------------------
A class describing the Fermi Dirac distribution of fermionic particles.
Structure Opt contains the basic computational parameters used in EQuUs.
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...
A class to calculate the Keldysh lesser and greater Green functions and self energies of a translatio...
Structure param contains data structures describing the physical parameters of the scattering center ...
function SurfaceGreenFunction(varargin)
Calculates the surface Green function of a semi-infinite lead for eregy E.