2 % Copyright (C) 2016 Peter Rakyta, Ph.D.
4 % This program is free software: you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation, either version 3 of the License, or
7 % (at your option) any later version.
9 % This program is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License
for more details.
14 % You should have received a copy of the GNU General Public License
15 % along with
this program. If not, see http:
17 %> @addtogroup utilities Utilities
20 %> @brief A
class describing an N-terminal geometry
for steady state non-equilibrium calculations.
21 %> @image html two_terminal_structure.jpg
22 %> @image latex two_terminal_structure.jpg
24 %> @brief A
class describing an N-terminal geometry for steady state non-equilibrium calculations.
26 %> EQuUs v4.9 or later
27 %> <tr
class=
"heading"><td colspan=
"2"><h2
class=
"groupheader"><a name=
"avail"></a>Structure described by the
class</h2></td></tr>
28 %> @image html two_terminal_structure.jpg
29 %> @image latex two_terminal_structure.jpg
30 %> 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.
31 %> However, additional lead can be added to the structure.
32 %> Each rectangle describes a unit cell including singular and non-singular
sites.
33 %> The scattering center is, on the other hand, represented by a larger rectangle corresponding to the Hamiltonian of the scattering region.
35 %> 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.
40 properties (Access =
protected)
41 %> An array containing the bias of the leads in the same unit as other energy scales in the
Hamiltonians.
43 %> Lesser Green
operator projected onto the scattering region
47 properties (Access =
public)
53 methods ( Access = public )
56 %% Contructor of the class
57 %> @brief Constructor of the class.
58 %> @
param varargin Cell array of optional parameters. For details see
#InputParsing. 59 %> @
return An instance of the
class 69 if strcmpi(
class(obj),
'NTerminal_Keldysh')
70 obj.InputParsing( varargin{:} );
72 obj.cCustom_Hamiltonians = [];
74 obj.display([
'EQuUs:Utils:',
class(obj),
':Creating NTerminal_Keldysh class.'])
76 % exporting calculation parameters into an XML format
79 % initializing attributes
82 % create Hamiltonian of the scattering region (or load from external source)
83 obj.CreateNTerminalHamiltonians();
92 %> @brief Custom Dyson
function for a two terminal arrangement on a two dimensional lattice.
93 %> @
param varargin Cell array of optional parameters (https:
94 %> @
param 'gfininv' The inverse of the Greens
function of the scattering region. For
default the inverse of the attribute #G is used.
95 %> @
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.
96 %> @
param 'onlyGinverz' Logical value. Set
true to calculate only the inverse of the total Green
operator, or false (
default) to calculate #G as well.
97 %> @
param 'recalculateSurface' A vector of the identification numbers of the lead surfaces to be recalculated.
98 %> @
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.
99 %> @
param 'kulso_szabfokok' Array of
sites to be kept after the decimation procedure. (Use parameter
'keep_sites' instead)
100 %> @
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.
101 %> @
param 'keep_sites' Name of
sites to be kept in the resulted Green
function (Possible values are:
'scatter',
'interface',
'lead').
102 %> @
return [1] The calculated Greens
function.
103 %> @
return [2] The inverse of the Green
operator.
104 %> @
return [3] An instance of structure #
junction_sites describing the
sites in the calculated Green
operator.
105 function [Gret, Ginverz,
junction_sites] = CustomDysonFunc( obj, varargin ) %NEW output
108 p.addParameter(
'gfininv', []);
109 p.addParameter(
'constant_channels',
true);
110 p.addParameter(
'onlyGinverz',
false );
111 p.addParameter(
'recalculateSurface', 1:length(obj.param.Leads) );
112 p.addParameter(
'decimate',
true );
113 p.addParameter(
'kulso_szabfokok', []); %The list of
sites to be left after the decimation procedure
114 p.addParameter(
'SelfEnergy',
false); %set
true to calculate the Dyson equation with the
self energy
115 p.addParameter(
'keep_sites',
'lead'); %Name of
sites to be kept (scatter, interface, lead)
117 p.parse(varargin{:});
118 gfininv = p.Results.gfininv;
119 constant_channels = p.Results.constant_channels;
120 onlyGinverz = p.Results.onlyGinverz;
121 recalculateSurface = p.Results.recalculateSurface;
122 decimate = p.Results.decimate;
123 kulso_szabfokok = p.Results.kulso_szabfokok;
124 useSelfEnergy = p.Results.SelfEnergy;
125 keep_sites = p.Results.keep_sites;
128 if ~isempty(recalculateSurface)
130 % creating interfaces
for the Leads
132 shiftLeads = ones(length(obj.param.Leads),1)*obj.E;
134 shiftLeads = ones(length(obj.param.Leads),1)*0;
137 % creating
Lead instaces and calculating the retarded surface Green
operator/
self-energy
138 obj.FL_handles.LeadCalc(
'shiftLeads', shiftLeads, ...
139 'SelfEnergy', useSelfEnergy,
'SurfaceGreensFunction', ~useSelfEnergy,
'gauge_field', obj.gauge_field,
'leads', recalculateSurface,
'q', obj.q, ...
140 'leadmodel', obj.leadmodel,
'bias_leads', obj.bias_leads,
'T', obj.T,
'CustomHamiltonian', obj.cCustom_Hamiltonians);
142 for idx = 1:length(recalculateSurface)
143 obj.CreateInterface( recalculateSurface(idx) );
149 'onlyGinverz', onlyGinverz, ...
150 'recalculateSurface', [], ...
151 'decimate', decimate, ...
152 'kulso_szabfokok', kulso_szabfokok, ...
153 'SelfEnergy', useSelfEnergy, ...
154 'keep_sites', keep_sites);
159 %% LesserGreenFunction
160 %> @brief Calculates the lesser Green
function projected to the surface
sites of the central device and the
interface regions for eregy given #E.
161 %> (Surface
sites of the central device are directly connected to the
interface regions.) The calculated Green
function is stored by attributes #lesserG and #lesserGinv.
162 %> @
param varargin Cell array of optional parameters (https:
163 %> @
param 'gfininv' The inverse of the Greens
function of the scattering region. For
default the inverse of the attribute #G is used.
164 %> @
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.
165 %> @
param 'recalculateSurface' A vector of the identification numbers of the lead surfaces to be recalculated.
166 %> @
return [1] The calculated lesser Greens
operator.
167 %> @
return [2] An instance of structure #
junction_sites describing the
sites in the calculated Green
operator.
168 function [Gret,
junction_sites] = LesserGreenFunction( obj, varargin )
171 p.addParameter(
'gfininv', []);
172 p.addParameter(
'constant_channels',
false);
173 p.addParameter(
'recalculateSurface', 1:length(obj.param.Leads) );
174 p.parse(varargin{:});
175 gfininv = p.Results.gfininv;
176 constant_channels = p.Results.constant_channels;
177 recalculateSurface = p.Results.recalculateSurface;
179 % evaluate the Dyson equation
for the retarded Green
operator 180 Dysonfunc = @()(obj.CustomDysonFunc( ...
181 'decimate',
false,
'constant_channels', constant_channels, ...
182 'gfininv', gfininv,
'recalculateSurface', recalculateSurface, ...
183 'SelfEnergy',
true));
184 [retardedG,
junction_sites] = obj.FL_handles.DysonEq(
'CustomDyson', Dysonfunc );
186 % create a global matrix containing the lesser
self-energies
187 % and obtaining the lesser
self energies of the leads
188 lesser_self_energy = zeros( size(retardedG) );
189 Leads = obj.FL_handles.Read(
'Leads' );
190 leadnum = length( Leads );
193 lesser_self_energy( indexes, indexes ) = Leads{idx}.LesserSelfEnergy();
196 % Calculate the lesser Green
operator via
197 % Eq (61) in Adv. Nat. Sci.: Nanosci. Nanotechnol. 5 (2014) 033001
198 Gret = retardedG*lesser_self_energy*retardedG';
204 %> @brief Sets the energy for the calculations
205 %> @
param Energy The value of the energy in the same units as the Hamiltonian.
209 % resetting the class describing the N-terminal geometry
211 obj.FL_handles.setEnergy( obj.E );
214 % recreate the Hamiltonian of the scattering region
216 obj.CreateNTerminalHamiltonians();
223 %> @brief Sets the temperature in the calculations
224 %> @
param T The value of the temperature in Kelvins.
228 % setting the temperature in class describing the N-terminal geometry
230 obj.FL_handles.setTemperature( obj.T );
238 end % end methods public
242 methods (Access=protected)
245 %> @brief Initializes the attributes of the class.
248 % creating classes for managing the magnetic field
249 obj.setHandlesForMagneticField();
251 % create class storing the Hamiltonian of the scattering region
254 % create class for transport calculations specific for steady state non-equilibrium calculations
257 % read out structure
Opt containing the computational parameters
258 obj.
Opt = obj.FL_handles.Read( '
Opt' );
260 % creating classes of the interface regions
261 obj.Interface_Regions = cell(length(obj.
param.Leads),1);
262 for idx = 1:length(obj.Interface_Regions)
263 Lead_Orientation = obj.
param.Leads{idx}.Lead_Orientation;
264 obj.Interface_Regions{idx} =
InterfaceRegion(obj.Opt, obj.param,
'Hanyadik_Lead', idx,
'q', obj.q,
'Lead_Orientation', Lead_Orientation);
271 %> @brief Parses the optional parameters
for the
class constructor.
272 %> @
param varargin Cell array of optional parameters (https:
273 %> @
param 'filenameIn' The input filename containing the computational parameters. (Use parameters
'Op' and
'param' instead)
274 %> @
param 'filenameOut' The output filename to export the computational parameters.
275 %> @
param 'WorkingDir' The absolute path to the working directoy.
277 %> @
param 'E' The energy value used in the calculations (in the same units as the Hamiltonian).
278 %> @
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)
279 %> @
param 'silent' Set
true to suppress output messages.
282 %> @
param 'Opt' An instance of the structure #
Opt.
283 %> @
param 'param' An instance of the structure #
param.
284 %> @
param 'q' The transverse momentum quantum number.
285 %> @
param 'T' The absolute temperature in Kelvins.
286 %> @
param 'mu' The Chemical potential in the same unit as other energy scales in the
Hamiltonians.
287 %> @
param 'mu_leads' An array containing the chemical potentials of the leads in the same unit as other energy scales in the
Hamiltonians.
288 function InputParsing( obj, varargin)
291 p.addParameter(
'filenameIn', obj.filenameIn, @ischar);
292 p.addParameter(
'filenameOut', obj.filenameOut, @ischar);
293 p.addParameter(
'WorkingDir', obj.WorkingDir, @ischar);
294 p.addParameter(
'CustomHamiltoniansHandle', obj.CustomHamiltoniansHandle); %
function handle for the custom
Hamiltonians 295 p.addParameter(
'E', obj.E, @isscalar);
296 p.addParameter(
'silent', obj.silent);
297 p.addParameter(
'leadmodel', obj.leadmodel); %individual physical model
for the contacts
298 p.addParameter(
'interfacemodel', obj.interfacemodel); %individual physical model
for the
interface regions
299 p.addParameter('
Opt', obj.
Opt);
300 p.addParameter(
'param', obj.param);
301 p.addParameter(
'q', obj.q);
302 p.addParameter(
'T', obj.T);
303 p.addParameter(
'EF', obj.EF);
304 p.addParameter(
'bias_leads', obj.bias_leads);
306 p.parse(varargin{:});
309 InputParsing@
NTerminal( obj,
'filenameIn', p.Results.filenameIn, ...
310 'filenameOut', p.Results.filenameOut, ...
311 'WorkingDir', p.Results.WorkingDir, ...
312 'CustomHamiltoniansHandle', p.Results.CustomHamiltoniansHandle, ...
313 'E', p.Results.E, ...
314 'EF', p.Results.EF, ...
315 'silent', p.Results.silent, ...
316 'leadmodel', p.Results.leadmodel, ...
317 'interfacemodel', p.Results.interfacemodel, ...
318 'q', p.Results.q, ...
319 'Opt', p.Results.Opt, ...
320 'param', p.Results.param);
322 InputParsing@
FermiDirac( obj,
'T', p.Results.T, ...
326 % setting the bias in the leads
327 if isempty( p.Results.bias_leads )
328 obj.bias_leads = zeros( size( obj.
param.Leads ) );
330 obj.bias_leads = p.Results.bias_leads;
335 end % methods private
A class describing an N-terminal geometry for equilibrium calculations mostly in the zero temperature...
function LoadHamiltonians(varargin)
Obtain the Hamiltonians from the external source.
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.
Property H1
The coupling Hamiltonian between the unit cells.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
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.
A class to evaluate the Dyson equation derived from class Transport_Interface with specific modificat...
function createOutput(filename, Opt, param)
This function creates an output file containing the running parameters.
A class to import custom Hamiltonians provided by other codes or created manually
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...
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 ...
Property Lead_Orientation
The orientation of the lead. Set +1 is the "incoming" direction of the propagating states is defined ...
A class describing an N-terminal geometry for steady state non-equilibrium calculations.
site_indexes
An array containing the site indexes of the given system part.
Structure sites contains data to identify the individual sites in a matrix.
sites Leads
Structure sites describing the geometry of the leads.
function SurfaceGreenFunctionCalculator(idx, varargin)
Calculates the surface Green's function or the self energy of a Lead.
A class to handle the Hamiltonian of the central region in Keldysh formalism.
Structure junction_sites contains data to identify the individual sites of the leads,...