utils module¶
Useful functions.
-
utils.add_frame(f1, f2, val1, op='+', val2=None, label=None, err=False)¶ 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
-
utils.add_mad(system, frame)¶ 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
-
utils.ef(rs, zeta)¶ Fermi Energy for 3D UEG.
Parameters: Returns: ef – Fermi Energy.
Return type:
-
utils.fermi_angle(u, k, q, mu, beta)¶ Fermi factor for \(k + q\). Used for integration.
Parameters: Returns: f_kq – Fermi factor.
Return type:
-
utils.fermi_block(ek, mu, beta)¶ Usual fermi factor blocking factor, i.e., \(\bar{f}_k = 1-f_k\).
Parameters: Returns: fb_k – Fermi blocking factor.
Return type:
-
utils.fermi_factor(ek, mu, beta)¶ - Usual fermi factor:
- \[f_k = \frac{1}{e^{\beta(\varepsilon_k-\mu)}+1}\]
Parameters: Returns: f_k – Fermi factor.
Return type:
-
utils.gamma(rs, theta, zeta)¶ Classical plasma coupling parameter for 3D UEG
Parameters: Returns: gamma – Coupling parameter.
Return type:
-
utils.get_git_revision_hash()¶ Return git revision.
Returns: sha1 – git hash with -dirty appended if uncommitted changes. Return type: string
-
utils.kinetic_cutoff(ne, theta)¶ 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:
-
utils.kinetic_plane_waves(ne, theta)¶ 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:
-
utils.madelung_approx(system)¶ - 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: system (class) – system being studied. Returns: v_M – Madelung potential (in Hartrees). Return type: float
-
utils.magic_numbers(system)¶ - 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
-
utils.plasma_freq(rs)¶ Plasma frequency for 3D UEG.
Parameters: rs (float) – Density parameter. Returns: omega_p – Plasma frequency. Return type: float
-
utils.rs_gamma(gamma, theta, zeta)¶ Find rs give a gamma and theta.
Parameters: Returns: gamma – Coupling parameter.
Return type:
-
utils.step(a, b)¶ Heaviside steb function i.e., :math:` heta(a-b)`
Parameters: - b (a,) – Arguments of step function.
- Returns –
- -------- –
- theta(a-b) (float) – Heaviside step function.
-
utils.step_angle(u, k, q, kf)¶ Heaviside steb function for k+q.
Parameters: - b (a,) – Arguments of step function.
- Returns –
- -------- –
- theta(a-b) (float) – Heaviside step function.
-
utils.theta_gamma(gamma, rs, zeta)¶ Find theta give a gamma and ts.
Parameters: Returns: gamma – Coupling parameter.
Return type: