00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, 2008, 2009, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_FERMION_H 00024 #define O2SCL_FERMION_H 00025 00026 #include <string> 00027 #include <iostream> 00028 #include <fstream> 00029 #include <cmath> 00030 00031 // For gsl_sf_fermi_dirac_int() 00032 #include <gsl/gsl_specfunc.h> 00033 00034 #include <o2scl/constants.h> 00035 #include <o2scl/funct.h> 00036 #include <o2scl/root.h> 00037 #include <o2scl/cern_mroot_root.h> 00038 #include <o2scl/part.h> 00039 00040 #ifndef DOXYGENP 00041 namespace o2scl { 00042 #endif 00043 00044 /** 00045 \brief Fermion class 00046 00047 This is a base class for the computation of fermionic statistics 00048 at zero temperature. The more general case of finite temperature 00049 is taken care of by \ref fermion_T objects. The primary 00050 functions are calc_mu_zerot() and calc_density_zerot() which 00051 compute all the thermodynamic quantities as a function of the 00052 chemical potential, or the density, respectively. 00053 00054 This class also adds two member data variables, \ref kf and \ref 00055 del, for the Fermi momentum and the gap. 00056 00057 \future Use hypot() and other more accurate functions for the 00058 analytic expressions for the zero temperature integrals. [Progress 00059 has been made, but there are probably other functions which may 00060 break down for small but finite masses and temperatures] 00061 00062 */ 00063 class fermion : virtual public part { 00064 00065 public: 00066 00067 /// Fermi momentum 00068 double kf; 00069 /// Gap 00070 double del; 00071 00072 /// Create a fermion with mass \c mass and degeneracy \c dof. 00073 fermion(double mass=0, double dof=0); 00074 00075 virtual ~fermion() { 00076 } 00077 00078 /// \name Zero-temperature fermions 00079 //@{ 00080 /** 00081 \brief Calculate the Fermi momentum from the density 00082 00083 Uses the relation \f$ k_F = ( 6 \pi^2 n /g )^{1/3} \f$ 00084 */ 00085 int kf_from_density(); 00086 00087 /** 00088 \brief Energy density at T=0 from \ref kf and \ref ms 00089 00090 Calculates the integral 00091 \f[ 00092 \varepsilon = \frac{g}{2 \pi^2} \int_0^{k_F} k^2 00093 \sqrt{k^2+m^{* 2}} d k 00094 \f] 00095 */ 00096 int energy_density_zerot(); 00097 00098 /** 00099 \brief Pressure at T=0 from \ref kf and \ref ms 00100 00101 Calculates the integral 00102 \f[ 00103 P=\frac{g}{6 \pi^2} \int_0^{k_F} \frac{k^4}{\sqrt{k^2+m^{* 2}}} d k 00104 \f] 00105 */ 00106 int pressure_zerot(); 00107 00108 /** 00109 \brief Zero temperature fermions from nu and ms 00110 00111 This function always returns \c gsl_success. 00112 */ 00113 virtual int calc_mu_zerot(); 00114 00115 /** 00116 \brief Zero temperature fermions from n and ms 00117 00118 This function always returns \c gsl_success. 00119 */ 00120 virtual int calc_density_zerot(); 00121 //@} 00122 00123 /// Return string denoting type ("fermion") 00124 virtual const char *type() { return "fermion"; } 00125 00126 }; 00127 00128 /** \brief Fermion with finite-temperature thermodynamics 00129 [abstract base] 00130 00131 This is an abstract base for the computation of 00132 finite-temperature fermionic statistics. Different children 00133 (e.g. \ref eff_fermion and \ref rel_fermion) use different 00134 techniques to computing the momentum integrations. 00135 00136 Because massless fermions at finite temperature are much 00137 simpler, there are separate member functions included in this 00138 class to handle them. The functions massless_calc_density() and 00139 massless_calc_mu() compute the thermodynamics of massless 00140 fermions at finite temperature given the density or the chemical 00141 potentials. The functions massless_pair_density() and 00142 massless_pair_mu() perform the same task, but automatically 00143 include antiparticles. 00144 00145 The function massless_calc_density() uses a \ref root object to 00146 solve for the chemical potential as a function of the density. 00147 The default is an object of type cern_mroot_root. The function 00148 massless_pair_density() does not need to use the \ref root 00149 object because of the simplification afforded by the inclusion 00150 of antiparticles. 00151 00152 \future Create a Chebyshev approximation for inverting the 00153 the Fermi functions for massless_calc_density() functions? 00154 00155 \htmlonly 00156 This Mathematica notebook contains the derivations of related 00157 series expansions and some algebra for the massless_pair() 00158 functions. 00159 <a href="../extras/fermion.nb"> 00160 fermion.nb</a>, and 00161 <a href="../extras/fermion.pdf"> 00162 fermion.pdf</a>. 00163 \endhtmlonly 00164 \latexonly 00165 This Mathematica notebook contains the derivations of related 00166 series expansions and some algebra for the massless\_pair() 00167 functions. 00168 \begin{verbatim} 00169 doc/o2scl/extras/fermion.nb 00170 doc/o2scl/extras/fermion.pdf 00171 \end{verbatim} 00172 \endlatexonly 00173 */ 00174 class fermion_T : public fermion { 00175 00176 public: 00177 00178 /// Create a fermion with mass \c mass and degeneracy \c dof. 00179 fermion_T(double mass=0, double dof=0); 00180 00181 virtual ~fermion_T() { 00182 } 00183 00184 /** 00185 \brief Calculate properties as function of chemical potential 00186 */ 00187 virtual int calc_mu(const double temper)=0; 00188 00189 /** \brief Calculate properties as function of density 00190 */ 00191 virtual int calc_density(const double temper)=0; 00192 00193 /** \brief Calculate properties with antiparticles as function of 00194 chemical potential 00195 */ 00196 virtual int pair_mu(const double temper)=0; 00197 00198 /** \brief Calculate properties with antiparticles as function of 00199 density 00200 */ 00201 virtual int pair_density(const double temper)=0; 00202 00203 #ifdef O2SCL_NEVER_DEFINED 00204 /** 00205 \brief Degenerate expansion for specific heat 00206 00207 This is a temporary location and is also unchecked. 00208 */ 00209 double deg_specific_heat(double T) { 00210 double ret; 00211 if (non_interacting) { 00212 nu=mu; 00213 ms=m; 00214 } 00215 double sqd=nu*nu-ms*ms; 00216 ret=o2scl_const::pi2*T*nu/sqd* 00217 (1.0-o2scl_const::pi2*T*T* 00218 (5.0*pow(ms,4.0)+4.0*ms*ms*nu*nu+14.0*pow(nu,4.0))/ 00219 15.0/nu/nu/sqd/sqd); 00220 return ret; 00221 } 00222 #endif 00223 00224 /// \name Massless fermions 00225 //@{ 00226 /// Finite temperature massless fermions 00227 virtual int massless_calc_mu(const double temper); 00228 00229 /// Finite temperature massless fermions 00230 virtual int massless_calc_density(const double temper); 00231 00232 /** 00233 \brief Finite temperature massless fermions and antifermions 00234 */ 00235 int massless_pair_mu(const double temper); 00236 00237 /** 00238 \brief Finite temperature massless fermions and antifermions 00239 00240 In the cases \f$ n^3 >> T \f$ and \f$ T >> n^3 \f$ , 00241 expansions are used instead of the exact formulas to avoid 00242 loss of precision. 00243 00244 In particular, using the parameter 00245 \f[ 00246 \alpha = \frac{g^2 \pi^2 T^6}{243 n^2} 00247 \f] 00248 and defining the expression 00249 \f[ 00250 \mathrm{cbt} = \alpha^{-1/6} \left( -1 + \sqrt{1+\alpha}\right)^{1/3} 00251 \f] 00252 we can write the chemical potential as 00253 \f[ 00254 \mu = \frac{\pi T}{\sqrt{3}} \left(\frac{1}{\mathrm{cbt}} - 00255 \mathrm{cbt} \right) 00256 \f] 00257 00258 These expressions, however, do not work well when \f$ \alpha 00259 \f$ is very large or very small, so series expansions are 00260 used whenever \f$ \alpha > 10^{4} \f$ or 00261 \f$ \alpha < 3 \times 10^{-4} \f$. For small \f$ \alpha \f$, 00262 \f[ 00263 \left(\frac{1}{\mathrm{cbt}} - 00264 \mathrm{cbt} \right) \approx 00265 \frac{2^{1/3}}{\alpha^{1/6}} - 00266 \frac{\alpha^{1/6}}{2^{1/3}} + 00267 \frac{\alpha^{5/6}}{6~2^{2/3}} + 00268 \frac{\alpha^{7/6}}{12~2^{1/3}} - 00269 \frac{\alpha^{11/6}}{18~2^{2/3}} - 00270 \frac{5 \alpha^{13/6}}{144~2^{1/3}} + 00271 \frac{77 \alpha^{17/6}}{2592~2^{2/3}} 00272 \f] 00273 and for large \f$ \alpha \f$, 00274 \f[ 00275 \left(\frac{1}{\mathrm{cbt}} - 00276 \mathrm{cbt} \right) \approx 00277 \frac{2}{3} \sqrt{\frac{1}{\alpha}} - 00278 \frac{8}{81} \left(\frac{1}{\alpha}\right)^{3/2} + 00279 \frac{32}{729} \left(\frac{1}{\alpha}\right)^{5/2} 00280 \f] 00281 00282 This approach works to within about 1 \part in \f$ 10^{12} \f$, 00283 and is tested in <tt>fermion_ts.cpp</tt>. 00284 00285 \future This could be improved by including more terms 00286 in the expansions. 00287 00288 */ 00289 int massless_pair_density(const double temper); 00290 //@} 00291 00292 /** \brief Set the solver for use in massless_calc_density() */ 00293 int set_massless_root(root<const double, funct<const double> > &rp) { 00294 massless_root=&rp; 00295 return 0; 00296 } 00297 00298 /** 00299 \brief The default solver for massless_calc_density() 00300 00301 We default to cern_mroot_root here since we don't have 00302 a bracket or a derivative. 00303 */ 00304 cern_mroot_root<const double, funct<const double> > def_massless_root; 00305 00306 /// Return string denoting type ("fermion_T") 00307 virtual const char *type() { return "fermion_T"; } 00308 00309 #ifndef DOXYGENP 00310 00311 protected: 00312 00313 /// A pointer to the solver for massless fermions 00314 root<const double, funct<const double> > *massless_root; 00315 00316 /// The function to solve for massless fermions 00317 int massless_fun(double x, double &y, const double &temper); 00318 00319 #endif 00320 00321 }; 00322 00323 #ifndef DOXYGENP 00324 } 00325 #endif 00326 00327 #endif
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page