Physics Overview ======================= The thermodynamic properties of the Leptons are calculated from the Lagrangian formalism of a free Fermi gas: .. math:: \mathcal{L}=\sum_{i=e, \mu, \tau} \left[ \bar{\psi_i}\left(i\gamma_{\mu}\partial^{\mu} - m_i\right)\psi_i + \bar \nu_{Li} i\gamma_{\mu}\partial^{\mu} \nu_{Li} \right], where :math:`\psi_i` and :math:`\nu_{Li}` are the electron, muon, tau, and neutrino fields, respectively. :math `m_i` is the mass of the lepton and :math:`\gamma_{\mu}` are the Dirac matrices. The thermodynamic properties are calculated at zero temperature, so the Fermi-Dirac distribution simplifies to a step function and the integrations are made analytically. The density, energy density and pressure are given by: .. math:: n_i=\frac{\gamma_i}{6\pi^2}k_F^3, .. math:: \varepsilon_i=\frac{\gamma_i}{2\pi^2}\Bigg[\left(\frac{1}{8}m_i^2k_F+\frac{1}{4}k_F^3\right)\sqrt{m_i^2+k_F^2}-\frac{1}{8}m_i^4\ln{\frac{k_F+\sqrt{m_i^2+k_F^2}}{m_i}}\Bigg], and .. math:: P_i=\frac{1}{3}\frac{\gamma_i}{2\pi^2}\Bigg[\left(\frac{1}{4}k_F^3-\frac{3}{8}m_i^2k_F\right)\sqrt{m_i^2+k_F^2}+\frac{3}{8}m_i^4\ln{\frac{k_F+\sqrt{m_i^2+k_F^2}}{m_i}}\Bigg], where :math:`\gamma_i=2` for electrons and :math:`\gamma_i=1` for neutrinos, and :math:`k_F` is the Fermi momentum, defined from :math:`\mu_i=\sqrt{k_F^2 + m_i^2}`. The three principal functionalities of the module are: - **Generate a Leptonic Equation of State (EoS):** The user can generate a gridded EoS exclusively with leptons by setting the option **use_lepton_eos** to true in the configuration. The table is generated assuming equilibrium between massive leptons, such that the chemical potentials of the electron, muon and tau are equal to :math:`\mu_e`. The same is true for the neutrino flavors, which have a chemical potential :math:`\mu_\nu`. The EoS is generated by looping over the chemical potentials these chemical potentials (:math:`\mu_e, \mu_\nu`) and their range is flexible and can also be adjusted in the input configuration. - **Make the nuclear grid electrically neutral:** For charge neutral matter, the code takes each row in the input EoS file and uses a root-solver from the `Ceres library `_ to find the chemical potential(s) (:math:`\mu_e` and :math:`\mu_\nu`) that ensure a zero net charge density and, if neutrinos are enabled, that satisfy the lepton fraction that was given in the input configuration. If there are rows in the input EoS file for which there is no solution, the row is excluded from the output (for example, when if nuclear charge density is negative at zero temperature). To enable the charge neutrality option, the user must set the option **use_charge_neutrality** to true. The lepton charge fraction and the lepton fraction are defined as: .. math:: n_{Q, l} = -n_e - n_\mu - n_\tau and .. math:: Y_L = \frac{n_e + n_\mu + n_\tau + n_{\nu_e} + n_{\nu_\mu} + n_{\nu_\tau}}{n_B} where :math:`n_i` is the number density of particle species :math:`i`, :math:`n_{Q, l}` is the lepton charge density and :math:`n_B` is the baryon number density. - **Find the beta-equilibrated EoS:** This functionality employs the same `Ceres `_root-solver to locate points satisfying the bemath:ta-equilibrium condition for chemical potentials. This entails ensuring: .. math:: \mu_Q= -\mu_e + \mu_\nu .. math:: n_Q= n_{Q, l} + n_{Q, b}=0 This is equivalent to writing the particle chemical potential in terms of the charge and Lepton chemical potentials as :math:`\mu_i = Q_i \mu_Q + L_i \mu_L`, where :math:`Q_i` and :math:`L_i` are the electric charge and lepton number of the particle species, respectively. If neutrinos are not present, then :math:`\mu_\nu= \mu_L =0`, and the electric charge potential of the baryons becomes the negative of the proton :math:`\mu_Q = -\mu_e`. :math:`n_{Q, b}` is the baryon charge density. To enable the beta-equilibrium calculation, the user must set the option **use_beta_equilibrium** to true. For the calculation, the module checks if the baryon chemical potential (:math:`\mu_B`) is equally spaced. If so, it will secctionalize the 2d input data into vectors of 1d data of fixed :math:`\mu_B` and attempt to find beta-equilibrium for each value. By default, if :math:`\mu_B` is not equally spaced, it will asume that the data can be sectionalized in the baryon density. If irregular grids are anticipated, the user can enable the **use_multidimensional_interpolator** option. Throughout the functionalities above, the user has the freedom to choose the types of leptons to include—electrons, muons, taus, and their corresponding neutrinos. Be aware that if neutrinos are chosen, the lepton fraction must be specified in the input configuration.