Constant density
In matter of constant density, the Hamiltonian does not depend on position. Every commutator in the recursion vanishes, the Magnus series stops at its first term, and the evolution operator is a single matrix exponential. As in vacuum, Magνs computes this without exercising any of the method of Methodology.
Constant density at three and two flavors. The density is swept from vacuum to about the value at the center of the Earth. The last call returns 200 energies at one density, which the constant-Hamiltonian engine of Engines and dispatch answers as a single stack of matrix exponentials.
import numpy as np
import magnus.globaldefs as gd
import magnus.oscprob as oscprob
# 'NuFIT 6.1' is the default; re-loaded for clarity only
osc = gd.load_nufit_params('NuFIT 6.1')
E, L = 1.0*gd.UNIT_GEV, 1000.0*gd.UNIT_KM
# Three flavors, one energy and one baseline
for rho in (0.0, 3.0, 8.0, 13.0):
P = oscprob.osc_prob_3nu_matter_constant_density(
E, L, rho=rho,
density_matter_is_in_g_per_cm3=True, **osc)
print('%5.1f g/cm3 Pme = %.6f'
% (rho, P[gd.NUMU][gd.NUE]))
# 0.0 g/cm3 Pme = 0.003773
# 3.0 g/cm3 Pme = 0.013589
# 8.0 g/cm3 Pme = 0.050497
# 13.0 g/cm3 Pme = 0.113343
# Two flavors: one angle and one splitting
P = oscprob.osc_prob_2nu_matter_constant_density(
E, L, rho=3.0, sth=osc['s13'], Dm2=osc['D31'],
density_matter_is_in_g_per_cm3=True)
# P[0][1] = 0.005766
# Two hundred energies in one call
Es = np.logspace(-1, 1, 200)*gd.UNIT_GEV
P = oscprob.osc_prob_3nu_matter_constant_density(
Es, L, rho=3.0,
density_matter_is_in_g_per_cm3=True, **osc)
# P.shape = (200, 3, 3)
Listing Constant density at three and two flavors shows the constant-density wrapper at three and two flavors, over a range of densities, and also the whole calculation as one batched call. The number passed as rho is read in one of three ways, set by two keywords, both False by default:
density_matter_is_in_g_per_cm3=True, as in Listing Constant density at three and two flavors, meansrhois mass density in g cm\(^{-3}\).density_is_of_number_of_electrons=Truemeansrhois the electron number density itself, in eV\(^3\).With neither,
rhois a mass density in natural units, eV\(^4\).
A mass density and an electron number density differ by the composition of the medium, which enters through a third keyword, electron_fraction, the number of electrons per atomic mass unit of matter, \(Y_e = n_e m_u/\rho\), so that \(n_e = \rho N_A Y_e\), with \(m_u\) the atomic mass unit and \(N_A\) Avogadro’s number. For a single element, it is the atomic number over the atomic weight, e.g., 26/55.845 for iron. It defaults to 1/2 in the constant-density wrappers. (Inside the Earth, the wrappers instead take \(Y_e\) layer by layer from the PREM, as a function of the distance from the center; see The Earth and Figure The Earth’s density profile.) Lowering \(Y_e\) to 0.2 at 3 g cm\(^{-3}\) takes \(P_{\nu_\mu \to \nu_e}\) from 0.013589 to 0.006726, i.e., it halves it. It is read only when rho is a mass density; a call that supplies the electron number density directly ignores it, since you have already done the conversion it governs.
Four and five flavors take the same form, with the active-sterile parameters added as further keywords. The call osc_prob_4nu_matter_constant_density with s14 and D41 returns a \(4 \times 4\) matrix where the three-flavor call returns a \(3 \times 3\) one; nothing else about the call changes.
One further keyword, ratio_number_neutrons_to_protons, is the ratio \(r = n_n/n_p\) that enters the projector \(\mathbb{P}\) (The Hamiltonian and the probability); since \(n_p = n_e\), it is also the number of neutrons per electron. It defaults to 1, the isoscalar value, which is the medium the default \(Y_e = 1/2\) already describes. In neutral matter, \(Y_e = 1/(1 + r)\). Setting one of the two keywords does not change the other, so both should be set together. The ratio sets the sterile entry of the matter projector \(\mathbb{P}\) (The Hamiltonian and the probability): with \(\sin^2\theta_{14} = \sin^2\theta_{24} = 0.1\) and \(\Delta m^2_{41} = 1\) eV\(^2\), at the energy, baseline, and density of Listing Constant density at three and two flavors, raising it to 1.5 moves \(P_{\nu_\mu \to \nu_\mu}\) from 0.7764 to 0.7587, by 2.3%. It does not enter the conversion of a mass density into an electron number density, \(n_e = \rho N_A Y_e\), which the electron fraction alone sets (see The Hamiltonian and the probability).