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
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
52 if strcmpi(
class(obj),
'FermiDirac')
53 obj.InputParsing( varargin{:});
61 %> @brief A
function of the Fermi-Dirac statistics
62 %> @
param E The energy value in eV (scalar or an array of energy values).
63 %> @
return Returns with the occupation numbers (numbers).
64 function ret = Fermi(obj, E)
66 E = reshape(E, 1, numel(E));
68 ret = zeros( length(obj.beta), length(E) );
69 indexes = logical( abs(obj.T) <= obj.T_treshold);
71 ret( indexes, E-obj.mu<0 ) = 1;
72 ret( indexes ,E-obj.mu==0 ) = 0.5;
73 ret( indexes, E-obj.mu>0) = 0;
75 if ~isempty(obj.beta(~indexes))
76 ret( ~indexes, :) = 1./(1+exp(obj.beta(~indexes)*(E-obj.mu)));
82 %> @brief Sets the temperature
for the calculations.
83 %> @
param T The temperature in Kelvin (scalar or an array)
84 function setTemperature(obj, T)
85 obj.T = reshape( T, numel(T), 1);
86 obj.beta = 1./(obj.k_B*T);
94 methods (Access=
protected)
97 %> @brief Parses the optional parameters
for the
class constructor.
98 %> @
param varargin Cell array of optional parameters (https:
99 %> @
param 'T' The absolute temperature in Kelvins.
100 %> @
param 'mu' The Chemical potential in the same unit as other energy scales in the
Hamiltonians.
101 function InputParsing( obj, varargin )
105 p.addParameter(
'T', 0);
106 p.addParameter(
'mu', 0, @isscalar);
108 p.parse(varargin{:});
111 obj.mu = p.Results.mu;
113 obj.setTemperature(T);
119 end %
protected methods
A class describing the Fermi Dirac distribution of fermionic particles.
function Transport(Energy, B)
creating the Ribbon class representing the twoterminal setup
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 ...