uegpy package¶
Submodules¶
uegpy.dielectric module¶
Dielectric / Density response functions.
-
uegpy.dielectric.im_chi_rpa(omega, q, beta, mu)[source]¶ Imaginary part of rpa density-density response function.
Parameters: Returns: chi_rpa – Imaginary part of RPA density-density response function.
Return type:
-
uegpy.dielectric.im_chi_rpa0(omega, q, kf, zeta)[source]¶ Imaginary part of \(T=0\) rpa density-density response function.
Parameters: Returns: chi_rpa – Imaginary part of RPA density-density response function.
Return type:
-
uegpy.dielectric.im_chi_tanaka(x, rs, theta, eta, zeta, l)[source]¶ Imaginary part of RPA dielectric function in dimensionless form.
Taken from Tanaka and Ichimary, Phys. Soc. Jap, 55, 2278 (1986).Parameters: Returns: Im(chi) – Imaginary part of dielectric function in the RPA.
Return type:
-
uegpy.dielectric.im_lind(omega, q, beta, mu)[source]¶ Imaginary part of free-electron Lindhard density-density response function.
Parameters: Returns: im_chi – Imaginary part of thermal Lindard function.
Return type:
-
uegpy.dielectric.im_lind0(omega, q, kf)[source]¶ Imaginary part of Lindhard Dielectric function at \(T = 0\).
Note this is \(\mathrm{Im}\left[\chi_{0\sigma}(\mathbf{q}, \omega)\right]\)Parameters: Returns: im_chi_0 – Real part of Lindhard dielectric function.
Return type:
-
uegpy.dielectric.im_rpa_dielectric0(omega, q, kf, zeta)[source]¶ Imaginary part of the \(T=0\) RPA dielectric function.
Parameters: Returns: re_eps – Real part of rpa dielectric function.
Return type:
-
uegpy.dielectric.lindhard_matsubara(x, rs, theta, eta, zeta, l)[source]¶ Dimensionless Lindhard function function factor.
Taken from Tanaka and Ichimaru J. Phys. Soc. Jap, 55, 2278 (1986).
For large l or x we use the asyptotic form of
\[\phi(x, l) = \frac{4 x^2}{3(2\pi l \Theta)^2 + x^4} + \mathcal{O}(x^{-4}, l^{-4})\]Parameters: Returns: chi(x, l) – Lindhard function evaluated at frequency l (for imaginary frequencies).
Return type:
-
uegpy.dielectric.re_lind(omega, q, beta, mu)[source]¶ Real part of free-electron Lindhard density-density response function.
Parameters: Returns: re_chi – Imaginary part of thermal Lindard function.
Return type:
-
uegpy.dielectric.re_lind0(omega, q, kf)[source]¶ Real part of Lindhard Dielectric function at \(T = 0\).
Note this is \(\mathrm{Re}\left[\chi_{0\sigma}(\mathbf{q}, \omega)\right]\)Parameters: Returns: re_chi_0 – Real part of Lindhard dielectric function.
Return type:
uegpy.finite module¶
Evaluate properties of system with a finite particle number
-
uegpy.finite.canonical_partition_function(system, beta)[source]¶ Calculate canonical partition function from single particle eigenvalues.
Warning: This gets very expensive very fast.Parameters: system (class) – system class. Returns: - U (float) – Internal energy.
- Z (float) – Canonical partition function.
-
uegpy.finite.centre_of_mass_obsv(system, beta)[source]¶ Calculate centre of mass partition function and total energy.
Parameters: - system (class) – System class containing system information.
- beta (float) – Inverse temperature.
Returns: - E_tot (float) – Total energy contribution from centre of mass motion.
- Z (float) – Centre of mass partition function.
-
uegpy.finite.check_self_consist(sp_new, sp_old)[source]¶ Check self consistency for array
Parameters: - sp_new (list) – new single particle eigenvalues.
- sp_old (list) – old single particle eigenvalues.
Returns: de – cumulative difference between new and old eigenvalues.
Return type:
-
uegpy.finite.chem_pot_sum(system, eigs, beta)[source]¶ Find the chemical potential for finite system.
Parameters: - system (class) – System class containing system information.
- beta (float) – Inverse temperature.
Returns: mu – Chemical potential.
Return type:
-
uegpy.finite.energy_sum(beta, mu, spval, pol)[source]¶ Calculate internal energy for free electron gas.
Parameters: Returns: Nav - ne – Difference between expected and actual number of electrons.
Return type:
-
uegpy.finite.fthf_ex_energy(system, beta)[source]¶ Evaluate finite temperature Hartree-Fock internal energy.
Todo : notes + grand canonical equivalent.Parameters: - system (class) – System being studied.
- beta (float) – Inverse Temperature.
Returns: U_tx – Finite temperature Hartree-Fock internal energy.
Return type:
-
uegpy.finite.fthf_self_consistency(system, beta, mu)[source]¶ - Run self consistency loop to find finite temperature Hartree-Fock
eigenvalues and chemical potential.
Todo: Check this makes sense + document better, integrate with Monte Carlo.
Parameters: Returns: - iterations (tuple) – Number of iterations required to find self consistency of mu and single particle eigenvalues.
- sp_x (list) – Single particle eigenvalues.
- mu_x (float) – Hartree-Fock chemical potential.
-
uegpy.finite.gc_part_func(sys, cpot, beta)[source]¶ Grand canonical partition function for finite system.
\[Z_{GC} = \prod_i (1 + e^{-\beta(e_i-\mu)})\]Parameters: - system (class) – System being studied.
- beta (float) – Inverse Temperature.
Returns: Z_GC – Grand canonical partition function.
Return type:
-
uegpy.finite.hf_potential(occ, kvecs, L)[source]¶ Hartree-Fock exchange energy for given determinant
Parameters: - occ (list) – List of occupied single particle orbitals.
- kvecs (list) – kvectors.
- L (float) – Box lenght.
Returns: ex – Exchange energy.
Return type:
-
uegpy.finite.hfx_potential(spvals, kvecs, ki, beta, mu, L)[source]¶ Finite temperature Hartree-Fock potential.
Parameters: Returns: ex – exchange potential.
Return type:
-
uegpy.finite.hfx_sum(system, beta, mu)[source]¶ Evaluate the HF exchange contribution as a summation.
Parameters: Returns: hfx – hf exchange energy
Return type:
Calculate average number of electrons.
Parameters: Returns: N – Number of electrons.
Return type:
Calculate difference between expected and average number of electrons.
Parameters: Returns: Nav - ne – Difference between expected and actual number of electrons.
Return type:
uegpy.fits module¶
Various approximate fits to the UEG or OCP
-
uegpy.fits.classical_ocp(system, beta)[source]¶ - Evaluate the classical excess energy using the parametrised fit given by
- Hansen PRA 8, 6 1973.
Parameters: - system (class) – System being studied.
- beta (float) – Inverse Temperature.
Returns: U_xc – Excess internal energy for classical OCP.
Return type:
-
uegpy.fits.ksdt(rs, t, zeta)[source]¶ Fit to RPIMC data of Brown et al (Phys. Rev. Lett. 110, 146405 (2013)) from Karasiev, Sjostrom, Dufty and Trickey, PRL 112, 076403. Please cite these guys.
The KSDT fit is given as:
\[f_{\mathrm{xc}}^{\zeta}(r_s, t) = -\frac{1}{r_s}\frac{\omega_{\zeta}a(t) + b_{\zeta}(t)r_s^{1/2} + c_{\zeta}(t)r_s}{1+d_{\zeta}(t)r_s^{1/2} + e_{\zeta}(t)r_s}\]Parameters: Returns: f_xc – Exchange-correlation free energy per-particle.
Return type:
-
uegpy.fits.ksdt_uxc(rs, t, zeta, dt=0.0001)[source]¶ Evaluate u_xc from KSDT fit using finite differences.
\[u_{\mathrm{xc}} = f_{\mathrm{xc}} - \Theta \left(\frac{\partial f_{\mathrm{xc}}}{\partial \Theta}\right)_{r_s}\]Parameters: Returns: u_xc – Exchange-correlation internal energy per-particle.
Return type:
-
uegpy.fits.ksdt_v(rs, t, zeta, dr=0.0001)[source]¶ Evaluate u_xc from KSDT fit using finite differences.
\[v = f_{\mathrm{xc}} + r_s \left(\frac{\partial f_{\mathrm{xc}}}{\partial r_s}\right)_{\Theta}\]Parameters: Returns: v – Potential energy per-particle.
Return type:
-
uegpy.fits.pdw(rs, t, zeta)[source]¶ - Perrot, Dharma-wardana (Phys. Rev. A 30, 2619 (1984).)fit to RPA
- correlation free energy of unpolarised UEG.
Parameters: Returns: f_c – Correlation free energy energy.
Return type:
-
uegpy.fits.pdwfxc00(rs, theta, zeta)[source]¶ Parametrisation of f_xc from CHNC data for the UEG.
From Perrot, Dharma-wardana, 62, 16536 (2000).
Warning
This does not seem to match with Table. IV from the reference. Something is completely off for unpolarized case.
Parameters: Returns: f_xc – Exchange-correlation free energy.
Return type:
-
uegpy.fits.pz81(rs, zeta)[source]¶ Perdew-Zunger parametrization of the ground state correlation energy of the UEG.
Ref: PRB, 23, 5048 (1981).Parameters: Returns: E_c – Correlation energy of 3D UEG parametrised to CA QMC data.
Return type:
-
uegpy.fits.ti_STLS_params(t, zeta)[source]¶ Fitting parameters for \(T>0\) STLS properties.
Taken from Tanaka & Ichimaru J. Phys. Soc. Jpn. 55, 2278 (1986).Parameters: Returns: (a, b, c, d, e) – Fitting parameters.
Return type: floats
-
uegpy.fits.ti_fxc(rs, t, pol)[source]¶ Excess free energy (over kT) from STLS.
Taken from Tanaka & Ichimaru J. Phys. Soc. Jpn. 55, 2278 (1986).Parameters: Returns: (a, b, c, d, e) – Fitting parameters.
Return type: floats
-
uegpy.fits.ti_txc(rs, t, pol)[source]¶ Excess kinetic energy (over kT) from STLS.
Taken from Tanaka & Ichimaru J. Phys. Soc. Jpn. 55, 2278 (1986).Parameters: Returns: (a, b, c, d, e) – Fitting parameters.
Return type: floats
-
uegpy.fits.ti_uxc(rs, t, pol)[source]¶ - Excess internal energy from STLS
- Taken from Tanaka & Ichimaru J. Phys. Soc. Jpn. 55, 2278 (1986).
Parameters: Returns: (a, b, c, d, e) – Fitting parameters.
Return type: floats
uegpy.infinite module¶
Evaluate properties of electron gas in thermodynamic limit using grand canonical ensemble
-
uegpy.infinite.chem_pot(rs, beta, ef, zeta)[source]¶ Find the chemical potential for infinite system.
Parameters: Returns: mu – Chemical potential.
Return type:
-
uegpy.infinite.exchange_energy(rs, beta, mu, zeta)[source]¶ Exchange contribution to internal energy
Turns out to be:
\[u_\mathrm{x} = \frac{3}{2} \mu_\mathrm{x} - f_{\mathrm{x}}\]Parameters: Returns: u_x – Exchange energy.
Return type:
-
uegpy.infinite.f_x(rs, beta, mu, zeta)[source]¶ First-order exchange contribution to free energy:
Uses the convenient form for the exchange integral from: Horovitz and Thieberger, Physica 71, 99 (1974).
\[f_\mathrm{x} = -(2-\zeta) \frac{r_s^3}{3\pi^2\beta^2} \int_{-\infty}^{\eta_0} d\eta I_{-1/2}(\eta)\]Parameters: Returns: hfx – Grand potential (Helmholtz Free energy.)
Return type:
-
uegpy.infinite.fermi_integral(nu, eta)[source]¶ Standard Fermi integral \(I(\eta, \nu)\), where:
\[I(\eta, \nu) = \int_0^{\infty} \frac{x^{\nu}}{(e^{x-\eta}+1)} dx\]Parameters: Returns: :math:`I(eta, nu)` – Fermi integral.
Return type:
-
uegpy.infinite.fermi_integrand(x, nu, eta)[source]¶ Integrand of standard Fermi integral I(eta, nu), where:
\[I(\eta, \nu) = \int_0^{\infty} \frac{x^{\nu}}{(e^{x-\eta}+1)} dx\]Parameters:
-
uegpy.infinite.fermi_integrand_deriv(x, nu, eta)[source]¶ - Derivative of integrand of standard Fermi integral \(I(eta, nu)\)
wrt beta.
TODO : check this.
Parameters:
-
uegpy.infinite.gc_free_energy(beta, mu, rs)[source]¶ Free energy:
\[U = (2-\zeta) \frac{8\sqrt{2}}{9\pi}r_s^3\beta^{-5/2} I(5/2, \eta)\]Parameters: Returns: Omega – Ideal grand potential.
Return type:
-
uegpy.infinite.hfx_integrand(eta, power)[source]¶ Integrand of first order exchange contribution to internal energy.
\[I_{-1/2}(\eta_0)^2\]Parameters: eta (float) – beta * mu, for beta = 1 / T and mu the chemical potential. Returns: I(-1/2, nu)^2 – Fermi integral. Return type: float
-
uegpy.infinite.ideal_kinetic_energy(beta, mu, rs, zeta)[source]¶ Total energy of ideal gas (Kinetic only):
\[U_0 = (2-\zeta) \frac{2\sqrt{2}}{3\pi}r_s^3\beta^{-5/2} I(3/2, \eta)\]Parameters: Returns: I(eta, nu) – Fermi integral.
Return type:
-
uegpy.infinite.mu_x(rs, beta, mu, zeta)[source]¶ First order exchange correction to the chemical potential.
Turns out to be:
\[\mu_\mathrm{x} = -\frac{1}{\sqrt{2}\pi}\beta^{-1/2}I_{-1/2}(\eta_0)\]Parameters: Returns: corr – Correction term for inversion process.
Return type:
Average density i.e. \(N/V\).
Parameters: Returns: rho – Average density.
Return type:
Deviation of average density for given \(\mu\) from true value.
Parameters: Returns: dev – \(n(\mu) - n\).
Return type:
-
uegpy.infinite.rpa_correlation_free_energy(rs, theta, zeta, lmax, qmax)[source]¶ RPA correlation free energy.
Calculated as given in Tanaka and Ichimaru, Phys. Soc. Jap, 55, 2278 (1986) as:
\[\frac{\Omega_{\mathrm{c}}}{N} = -\frac{1}{2(2\pi)^3n\beta}\sum_l\int d\mathbf{q} \Big[\log[1-v_{\mathbf{q}}\chi^0(\mathbf{q},z_l)]+ v_{\mathbf{q}}\chi^0(\mathbf{q}, z_l)\Big]\]Parameters: Returns: f_c – Exchange correlation free energy.
Return type:
-
uegpy.infinite.rpa_v_tanaka(rs, theta, zeta, nmax=10000, qmax=5, correction=True)[source]¶ Evaluate RPA electron-electron (potential) energy.
Taken from Tanaka & Ichimaru JPSJ 55, 2278 (1986) and benchmarked against this.Parameters: Returns: V – Potential energy.
Return type:
uegpy.monte_carlo module¶
Simple Monte Carlo routines for evaluating in the canonical ensemble.
-
uegpy.monte_carlo.create_orb_list(probs, ne)[source]¶ Create orbital list with \(N\) electrons
Parameters: - probs (list) – Single particle probabilities (fermi factors).
- ne (int) – Number of electrons.
Returns: - gen (boolean) – True if configuration with ne electrons was generated.
- selected_orbs (list) – Selected orbitals.
-
uegpy.monte_carlo.gc_correction_free_energy(sys, cpot, beta, delta, delta_error)[source]¶ - Canonical correction to free electron grand canonical partition function.
Assumption, \(Z_{GC}(N) / Z_{GC} = \delta\), so
\[-kT \log\delta = -kT \log Z_{GC}(N) + kT \log Z_{GC}.\]Therefore,
\[-kT \log Z_N = -kT \log \delta - kT \log Z_{GC} + \mu N,\]or
\[F^0_N = \Omega + \Delta(N) + \mu N.\]
Parameters: Returns: F_N – Canonical free electron Helmholtz free energy.
Return type:
-
uegpy.monte_carlo.sample_canonical_energy(system, beta, nmeasure)[source]¶ Sample canonical energy of a non-interacting system.
Properties of the non-interacting canonical system can be evaluated by simply discarding configurations generated in grand canonical ensemble whose particle number is not equal to the expected number of particles.Parameters: Returns: frame – Frame containing estimates for properties of system at temperature theta.
Return type: pandas.DataFrame
uegpy.size_corrections module¶
Utilities for finite size corrections.
-
uegpy.size_corrections.bcdc(rs, theta, zeta, N)[source]¶ Potential energy correction using the BCDC finite size correction for V.
Ref: Ethat W. Brown et al. Phys. Rev. Lett. 110, 146405 (2013).Parameters: Returns: delta_V – RPA finite size correction.
Return type:
-
uegpy.size_corrections.conv_fac(nmax, alpha)[source]¶ - Convergence factor for Hartree–Fock size corrections from Drummond et al.
- Warning: Exceptionally slow.
Parameters: Returns: C_HF – Convergence constant.
Return type:
-
uegpy.size_corrections.fxc_correction(rs, theta, zeta, N)[source]¶ Free energy correction using the BCDC finite size correction for V
Parameters: Returns: delta_f_xc(V) – RPA finite size correction.
Return type:
-
uegpy.size_corrections.fxc_correction_quad(rs, dv)[source]¶ Evalute correction to exchange-correlation free energy.
Parameters: - rs (list) – Grid of densities.
- dv (list) – Corresponding grid of potential energy size corrections.
Returns: df_xc – Size correction to f_xc.
Return type:
-
uegpy.size_corrections.mad_integral(theta, eta, zeta, kf, kmin, kmax, nmax)[source]¶ Evaluate integral of uniform distribution of point charges.
Parameters: Returns: v_s – Potential energy from static distribution of point charges.
Return type:
-
uegpy.size_corrections.mad_summation(qvals, L)[source]¶ Evaluate sum of uniform distribution of point charges.
Parameters: - qvals (list) – magnitude of kpoints to evaluate structure factor at.
- L (float) – Box length.
Returns: v_s – Contribution to potential energy from periodically repeated point charges.
Return type:
-
uegpy.size_corrections.sk_integral(rs, theta, eta, zeta, kf, kmin, kmax, lmax)[source]¶ Integral over RPA structure factor.
Parameters: Returns: intg – Integral over s_q.
Return type:
-
uegpy.size_corrections.v_integral(rs, theta, eta, zeta, kf, kmin, kmax, lmax)[source]¶ Potential energy evaluated from RPA structure factor.
Useful to evaluate size corrections.Parameters: Returns: V – RPA potential energy.
Return type:
uegpy.structure module¶
Structure factors at various levels of theory.
-
uegpy.structure.bcdc(q, rs, theta, zeta)[source]¶ Structure factor using leading order RPA form.
From Brown, Clark, Du Bois, Ceperley PRL 2013.Parameters: Returns: S(q) – BCDC structure factor.
Return type:
-
uegpy.structure.bijl_feynman(q, kf, zeta)[source]¶ Bijl-Feynman structure factor.
Parameters: Returns: S(q) – Bijl-Feynman structure factor.
Return type:
-
uegpy.structure.hartree_fock(q, rs, beta, mu, zeta)[source]¶ Static structure factor at Hartree–Fock level:
\[S(q) = 1 - \frac{r_s^3}{3\pi} \int_0^{\infty} dk k^2 f_k \int_{-1}^{1} du \frac{1}{e^{\beta(\frac{1}{2}(k^2+q^2+2kqu)}+1}\]Parameters: Returns: S(q) – Static structure factor.
Return type:
-
uegpy.structure.hartree_fock_ground_state(q, kf)[source]¶ Analytic static structure factor at Hartree–Fock level in the ground state:
\[\begin{split}S(q) = \begin{cases} \frac{1}{2} \Big(\frac{3}{4} \frac{q}{q_F} - \frac{1}{16} \Big(\frac{q}{q_F}\Big)^3\Big) & \text{if} \ q \le 2q_F \\ \frac{1}{2} & \text{if} \ q > 2q_F \end{cases}\end{split}\]Parameters: Returns: S(q) – Static structure factor.
Return type:
-
uegpy.structure.hartree_fock_ground_state_integral(q, rs, kf)[source]¶ Static structure factor at Hartree–Fock level in the ground state:
\[S(q) = 1 - \frac{r_s^3}{3\pi} \int_0^{\infty} dk k^2 \theta(k_F-k) \int_{-1}^{1} du \theta(k_F-(k^2+2kqu+q^2))\]Parameters: Returns: S(q) – Static structure factor.
Return type:
-
uegpy.structure.q0_plasmon(q, rs)[source]¶ Plasmon structure factor.
\[S(q) = \frac{q^2}{2\omega_p}\]Parameters: Returns: S(q) – Plasmon structure factor.
Return type:
-
uegpy.structure.rpa(q, beta, mu, rs)[source]¶ Finite temperature RPA static structure factor evulated as:
\[S(q) = -\frac{1}{\pi} \int_{-\infty}^{\infty} \mathrm{Im}[\chi^{\mathrm{RPA}}(q, \omega)] \coth(\beta\omega/2)\]Warning
This uses a naive approach which directly evaluates \(\mathrm{Im}[\chi^{\mathrm{RPA}}]\). Better results can be found using rpa_matsubara. In particular this routine will likely miss the plasmon contribution to the structure factor which dominates for some \(q_c(r_s, \Theta)\) .
Parameters: Returns: s_q – Static structure factor.
Return type:
-
uegpy.structure.rpa_ground_state(q, kf, rs)[source]¶ Zero temperature RPA static structure factor.
\[S(q) = -\frac{1}{\pi} \int_{-\infty}^{\infty} d \omega \mathrm{Im}[\chi^{\mathrm{RPA}}(q, \omega)]\]Parameters: Returns: s_q – Static structure factor.
Return type:
-
uegpy.structure.rpa_matsubara(q, rs, theta, eta, zeta, lmax, qmax=5)[source]¶ RPA static structure factor evaluated using matsubara frequencies.
\[S(q) = -\frac{1}{\pi} \int_{-\infty}^{\infty} d \omega \mathrm{Im}[\chi^{\mathrm{RPA}}(q, \omega)]\]Parameters: Returns: s_q – Static structure factor.
Return type:
uegpy.ueg_sys module¶
System properties.
-
class
uegpy.ueg_sys.System(rs, ne, ecut, zeta)[source]¶ System Properties - Everything is measured in Hartree atomic units.
-
rs¶ float – Wigner-Seitz radius.
-
ne¶ int – Number of electrons.
-
ecut¶ float – Plane wave cutoff.
-
zeta¶ int – Spin polarisation = 1 for fully polarised case, 0 for unpolarised.
-
L¶ float – Box length.
-
kfac¶ float – kspace grid spacing.
-
kf¶ float – Fermi wavevector.
-
ef¶ float – Fermi energy
-
spval¶ list – containing single particle eigenvalues, sorted in increasing value of kinetic energy.
-
kval¶ list – Plane wave basis vectors, sorted in increasing value of kinetic energy.
-
deg_e¶ list of lists – Compressed list of spval containing unique eigenvalues and their degeneracy.
-
M¶ int – Number of plane waves in our basis.
-
compress_spval(spval)[source]¶ - Compress the single particle eigenvalues so that we only consider unique
- values which vastly speeds up the k-space summations required.
Parameters: spval (list) – list containing single particle eigenvalues Returns: def_e – Compressed single-particle eigenvalues. Return type: list of lists
-
uegpy.utils module¶
Useful functions.
-
uegpy.utils.add_frame(f1, f2, val1, op='+', val2=None, label=None, err=False)[source]¶ Add or subtract two frames and take care of errorbars.
Parameters: f1,f2 ( pandas.DataFrame) – Frames to add/subtract.Returns: f – f1 +/- f2 Return type: pandas.DataFrame
-
uegpy.utils.add_mad(system, frame)[source]¶ Add Madelung constant to data.
Parameters: - system (class) – system being studied.
- frame (
pandas.DataFrame) – Frame containing total energies.
Returns: frame – Frame with energies per particle including Madelung constant where appropriate.
Return type: pandas.DataFrame
-
uegpy.utils.alpha(zeta)[source]¶ Alpha Parameter for ueg.
Parameters: zeta (int) – Returns: alpha Return type: float
-
uegpy.utils.calcT(rs, theta, zeta)[source]¶ Calculate temperature in Hartrees from Theta.
Parameters: Returns: T – Temperature in Hartree atomic units.
Return type:
-
uegpy.utils.calc_density_parameters(Z, rho_m, A)[source]¶ Cacluate the density parameters of a real free electron system.
Parameters: Returns: - rs (float) – Density parameter (in bohr).
- n (float) – Electronic density (in g/cm^3).
-
uegpy.utils.ef(rs, zeta)[source]¶ Fermi Energy for 3D UEG.
Parameters: Returns: ef – Fermi Energy.
Return type:
-
uegpy.utils.fermi_angle(u, k, q, mu, beta)[source]¶ Fermi factor for \(k + q\). Used for integration.
Parameters: Returns: f_kq – Fermi factor.
Return type:
-
uegpy.utils.fermi_block(ek, mu, beta)[source]¶ Usual fermi factor blocking factor, i.e., \(\bar{f}_k = 1-f_k\).
Parameters: Returns: fb_k – Fermi blocking factor.
Return type:
-
uegpy.utils.fermi_factor(ek, mu, beta)[source]¶ - Usual fermi factor:
- \[f_k = \frac{1}{e^{\beta(\varepsilon_k-\mu)}+1}\]
Parameters: Returns: f_k – Fermi factor.
Return type:
-
uegpy.utils.gamma(rs, theta, zeta)[source]¶ Classical plasma coupling parameter for 3D UEG
Parameters: Returns: gamma – Coupling parameter.
Return type:
-
uegpy.utils.get_git_revision_hash()[source]¶ Return git revision.
Returns: sha1 – git hash with -dirty appended if uncommitted changes. Return type: string
-
uegpy.utils.kf(rs, zeta)[source]¶ Fermi wavevector for 3D UEG.
Parameters: Returns: kf – Fermi wavevector.
Return type:
-
uegpy.utils.kinetic_cutoff(ne, theta)[source]¶ Determine number of planewaves necessary to converge kinetic energy.
The kinetic energy converges exponentially once
\[\varepsilon_c \approx kT\]The following extrapolates from a smaller system size to determine the cutoff necessary at any \(\Theta, N\) value as
\[\varepsilon_c(N,\Theta) = \alpha \varepsilon_c(19,8) (\Theta/8) (N/19)^{2/3}\]Parameters: Returns: e_c – Cutoff required (units of (2pi/L)^2
Return type:
-
uegpy.utils.kinetic_plane_waves(ne, theta)[source]¶ Determine number of planewaves necessary to converge kinetic energy.
The kinetic energy converges exponentially once
\[M \approx N \Theta^{3/2}\]The following extrapolates from a smaller system size to determine the cutoff necessary at any \(\Theta, N\) value as
\[M(N,\Theta) = (\Theta/8)^{3/2} M(19,8) (N/19)\]Parameters: Returns: M – Number of planewaves required
Return type:
-
uegpy.utils.madelung_approx(rs, ne)[source]¶ - Use expression in Schoof et al. (PhysRevLett.115.130402) for the
- Madelung contribution to the total energy. Please cite these guys and L.M. Fraser et al. Phys. Rev. B 53, 1814 whose functional form they fitted to.
Parameters: Returns: v_M – Madelung potential (in Hartrees).
Return type:
-
uegpy.utils.magic_numbers(system)[source]¶ - Work out possible magic electron numbers (i.e. those that will fit in
- a closed shell) below nmax
Parameters: system (class) – System being studied Returns: pol – Polarised magic numbers. Unpolarised = 2 * pol Return type: list
-
uegpy.utils.plasma_freq(rs)[source]¶ Plasma frequency for 3D UEG.
Parameters: rs (float) – Density parameter. Returns: omega_p – Plasma frequency. Return type: float
-
uegpy.utils.rs_gamma(gamma, theta, zeta)[source]¶ Find rs give a gamma and theta.
Parameters: Returns: gamma – Coupling parameter.
Return type:
-
uegpy.utils.step(a, b)[source]¶ Heaviside steb function i.e., :math:` heta(a-b)`
Parameters: Returns: theta(a-b) – Heaviside step function.
Return type:
-
uegpy.utils.step_angle(u, k, q, kf)[source]¶ Heaviside steb function for k+q.
Parameters: Returns: theta(kf - |a-b|) – Heaviside step function.
Return type:
-
uegpy.utils.theta_gamma(gamma, rs, zeta)[source]¶ Find theta give a gamma and ts.
Parameters: Returns: gamma – Coupling parameter.
Return type:
Module contents¶
uegpy can calculate various thermodynamic properties of the UEG.
The code is organised in various modules which can be combined to calculate useful quantities. Currently the following functionality is available:
- Internal, potential and free energies for the the 3D-UEG as a function of
temperature at various levels of approximation. Currently we can do ideal, Hartree–Fock and RPA.
- Dynamic properties such as density-density reposonse at any temperature.
- Static and dynamic structure factors.
Most of these quantities can be calculated in the thermodynamic limit as well as for a finite number of electrons in the canonical and grand canonical ensemble.