Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
UtilsBase.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities - UtilsBase
2 % Copyright (C) 2009-2017 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 UtilsBase.m
20 %> @brief This class is a base class containing common properties and methods utilized in several other classes.
21 %> @}
22 %> @brief This class is a base class containing common properties and methods utilized in several other classes.
23 %> @Available
24 %> EQuUs v4.9 or later
25 %%
27 
28  properties ( Access = public )
29  %> An instance of class #NTerminal (or its subclass) representing the junction
30  junction
31  %>An instance of structure #BandWidth
32  BandWidth
33  %>logical value. Set true (default) for solve the Dyson equation with the self energies, or false otherwise.
34  useSelfEnergy
35  %>Function handle pot = f(#coordinates) for the additional potential to be applied in the scattering region
36  scatterPotential
37  %>logical value. Set true for calculate the Greens function of the scattering region from Hamiltonian, or false (default) otherwise.
38  gfininvfromHamiltonian
39  %> cell array of optional parameters. (For details see #InputParsing)
40  varargin
41  end
42 
43 
44  methods (Access=public)
45 
46 %% Contructor of the class
47 %> @brief Constructor of the class.
48 %> @param Opt an instance of class #Opt.
49 %> @param varargin Cell array of optional parameters. For details see #InputParsing.
50 %> @return An instance of the class
51  function obj = UtilsBase( Opt, varargin )
52 
53  obj = obj@Messages( Opt );
54 
55  obj.junction = [];
56  obj.BandWidth = [];
57  obj.useSelfEnergy = [];
58  obj.scatterPotential = [];
59  obj.gfininvfromHamiltonian = [];
60 
61  obj.varargin = varargin;
62 
63 
64 
65  if strcmpi(class(obj), 'UtilsBase')
66  obj.InputParsing( varargin{:} );
67  end
68 
69 
70 
71  end
72 
73 
74 %% setEnergy
75 %> @brief Sets the energy for the calculations
76 %> @param newE The value of the energy in the same units as the Hamiltonian.
77 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
78 %> @param 'junction' An instance of class #NTerminal (or its derived class) representing the junction.
79  function SetEnergy( obj, newE, varargin )
80  p = inputParser;
81  p.addParameter('junction', obj.junction);
82  p.parse(varargin{:});
83 
84  junction_loc = p.Results.junction;
85  junction_loc.setEnergy( newE )
86  end
87 
88 
89 
90  end % public methods
91 
92 
93  methods (Access=protected)
94 
95 %% InputParsing
96 %> @brief Parses the optional parameters for the class constructor.
97 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
98 %> @param 'T' The temperature in Kelvin (scalar or an array)
99 %> @param 'mu' The Chemical potential in the same unit as other energy scales in the Hamiltonians.
100 %> @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).
101 %> @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).
102 %> @param 'useSelfEnergy' 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.
103 %> @param 'junction' An instance of class #NTerminal (or its derived class) representing the junction.
104  function InputParsing( obj, varargin )
105 
106  p = inputParser;
107  p.addParameter('T', obj.T);
108  p.addParameter('mu', 0, @isscalar);
109  p.addParameter('scatterPotential', []);
110  p.addParameter('gfininvfromHamiltonian', false);
111  p.addParameter('useSelfEnergy', true);
112  p.addParameter('junction', []);
113 
114  p.parse(varargin{:});
115 
116  InputParsing@FermiDirac( obj, 'T', p.Results.T, ...
117  'mu', p.Results.mu);
118 
119  obj.scatterPotential = p.Results.scatterPotential;
120  obj.junction = p.Results.junction;
121  obj.gfininvfromHamiltonian = p.Results.gfininvfromHamiltonian;
122  obj.useSelfEnergy = p.Results.useSelfEnergy;
123 
124 
125  if ~strcmpi( class(obj.junction), 'NTerminal' )
126  supClasses = superclasses(obj.junction);
127  if sum( strcmp( supClasses, 'NTerminal' ) ) == 0
128  error(['EQuUs:Utils:', class(obj), ':InputParsing'], 'Element junction is not valid.');
129  end
130  end
131 
132 
133  end %
134 
135 
136 end % protected methods
137 
138 end
A class describing an N-terminal geometry for equilibrium calculations mostly in the zero temperature...
Definition: NTerminal.m:38
A class describing the Fermi Dirac distribution of fermionic particles.
Definition: FermiDirac.m:25
function setEnergy(Energy)
Create an instance of class CreateHamiltonians to create the Hamiltonian of the scattering region.
A class containing methodes for displaying several standard messages.
Definition: Messages.m:24
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
function Transport(Energy, B)
Calculates the conductance at a given energy value.
function Hamiltonians(varargin)
Function to create the custom Hamiltonians for the 1D chain.
A class containing common basic functionalities.
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
Structure BandWidth describes the bandwidth in the lead and in the scattering center.
Definition: structures.m:130
This class is a base class containing common properties and methods utilized in several other classes...
Definition: UtilsBase.m:26
function InputParsing(varargin)
Parses the optional parameters for the class constructor.
A class to create and store Hamiltonian of the scattering region.