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:
18 %> @addtogroup basic Basic Functionalities
21 %> @brief A
class describing the Fermi Dirac distribution of fermionic particles.
23 %> @brief A
class describing the Fermi Dirac distribution of fermionic particles.
27 properties (Access =
protected)
28 %> Boltzmann constant in eV/K
30 %> The temperature in Kelvin
32 %> \f$\beta = 1/(k_BT)\f$
34 %> treshold temperature (makes difference between T=0 and T>0)
36 %> The Chemical potential in the same unit as other energy scales in the
Hamiltonians.
41 methods (Access=
public)
44 %> @brief A constructor of the
class 45 %> @
param varargin Cell array of optional parameters (https:
46 %> @
return Returns with an instance of the
class.
49 obj.
k_B = 8.6173324e-5; % Boltzmann constant in eV/K
50 obj.T_treshold = 1e-10;
55 if strcmpi(
class(obj),
'FermiDirac')
56 obj.InputParsing( varargin{:});
64 %> @brief A
function of the Fermi-Dirac statistics
65 %> @
param E The energy value in eV (scalar or an array of energy values).
66 %> @
return Returns with the occupation number (numbers).
67 function ret = Fermi(obj, E)
69 E = reshape(E, 1, numel(E));
71 ret = zeros( length(obj.beta), length(E) );
72 indexes = logical( abs(obj.T) <= obj.T_treshold);
74 ret( indexes, E-obj.mu<0 ) = 1;
75 ret( indexes ,E-obj.mu==0 ) = 0.5;
76 ret( indexes, E-obj.mu>0) = 0;
78 if ~isempty(obj.beta(~indexes))
79 ret( ~indexes, :) = 1./(1+exp(obj.beta(~indexes)*(E-obj.mu)));
85 %> @brief Sets the temperature
for the calculations.
86 %> @
param T The temperature in Kelvin (scalar or an array)
87 function setTemperature(obj, T)
88 obj.T = reshape( T, numel(T), 1);
89 obj.beta = 1./(obj.k_B*T);
97 methods (Access=
protected)
100 %> @brief Parses the optional parameters
for the
class constructor.
101 %> @
param varargin Cell array of optional parameters (https:
102 %> @
param 'T' The absolute temperature in Kelvins.
103 %> @
param 'mu' The Chemical potential in the same unit as other energy scales in the
Hamiltonians.
104 function InputParsing( obj, varargin )
108 p.addParameter(
'T', obj.T);
109 p.addParameter(
'mu', obj.mu, @isscalar);
111 p.parse(varargin{:});
113 obj.mu = p.Results.mu;
115 obj.setTemperature(p.Results.T);
121 end %
protected methods
A class describing the Fermi Dirac distribution of fermionic particles.
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.
Property k_B
Boltzmann constant in eV/K.
Structure param contains data structures describing the physical parameters of the scattering center ...