magnus.hamiltonians.hamiltonians2nu
hamiltonians2nu.py
Compute two-neutrino Hamiltonians for selected scenarios.
This module contains the routines to compute the two-neutrino Hamiltonians for the following scenarios: oscillations in vacuum, in matter of constant density, in matter with non-standard interactions (NSI), and in a CPT-odd Lorentz invariance-violating background (LIV).
Routine listings
mixing_matrix_2nu - Returns 2x2 rotation matrix
hamiltonian_2nu_vacuum_energy_independent - Returns H_vac (no 1/E)
- hamiltonian_2nu_vacuum_energy_independent_td - Returns H_vac (no
1/E), as a function of position
hamiltonian_2nu_vacuum - Returns H_vac
hamiltonian_2nu_vacuum_td - Returns H_vac, as a function of position
hamiltonian_2nu_matter - Returns H_matter
hamiltonian_2nu_matter_td - Returns H_matter, as a function of position
hamiltonian_2nu_nsi - Returns H_NSI
hamiltonian_2nu_nsi_td - Returns H_NSI, as a function of position
hamiltonian_2nu_liv - Returns H_LIV
- hamiltonian_2nu_liv_energy_independent - Returns H_LIV (no energy
dependence)
Functions
|
Returns the 2x2 rotation matrix. |
|
Returns the two-neutrino Hamiltonian for vacuum oscillations. |
Returns the two-neutrino Hamiltonian for vacuum oscillations, as a function of distance, |
|
|
Returns the two-neutrino Hamiltonian for vacuum oscillations. |
|
Returns the two-neutrino Hamiltonian for vacuum oscillations, as a function of distance, |
|
Returns the two-neutrino Hamiltonian for matter oscillations. |
|
Returns the two-neutrino Hamiltonian for matter oscillations, as a function of distance. |
|
Returns the two-neutrino Hamiltonian for oscillations with NSI. |
|
Returns the two-neutrino NSI Hamiltonian as a function of position. |
|
Returns the two-neutrino Hamiltonian for oscillations with LIV. |
|
Returns the two-neutrino Hamiltonian for oscillations with LIV. |
Module Contents
- magnus.hamiltonians.hamiltonians2nu.mixing_matrix_2nu(sth: float) numpy.ndarray[source]
Returns the 2x2 rotation matrix.
Computes and returns a 2x2 real rotation matrix parametrized by a single rotation angle theta.
Added in version 1.0.0.
- Parameters:
sth (float) – Sine of the mixing angle \(\theta\).
- Returns:
Rotation matrix [[cth, sth], [-sth, cth]], with cth = cos(theta) and sth = sin(theta).
- Return type:
np.ndarray
Examples
import numpy as np from magnus.hamiltonians import hamiltonians2nu U = np.asarray(hamiltonians2nu.mixing_matrix_2nu(np.sqrt(0.308))) print(np.round(U, 6)) print('unitary to %.1e' % np.max(np.abs(U.conj().T @ U - np.eye(2))))
[[ 0.831865 0.554977] [-0.554977 0.831865]] unitary to 1.1e-16
Note the argument is \(\sin\theta\), not \(\sin^2\theta\); fits are usually quoted as the latter, hence the square root.
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_vacuum_energy_independent(sth: float, Dm2: float, compute_matrix_multiplication: bool | None = False) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for vacuum oscillations.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in vacuum, parametrized by a single mixing angle theta and a single mass-squared difference Dm2. The Hamiltonian is H = (1/2)*R.M2.R^dagger, with R the 2x2 rotation matrix and M2 the mass matrix. The multiplicative factor 1/E is not applied.
Added in version 1.0.0.
- Parameters:
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
Examples
import numpy as np import magnus.globaldefs as gd from magnus.hamiltonians import hamiltonians2nu h = np.asarray(hamiltonians2nu.hamiltonian_2nu_vacuum_energy_independent( np.sqrt(0.308), 7.49e-5)) print(np.round(h/1e-5, 6), ' [1e-5 eV^2]') print('at 1 GeV, in eV: %.3e' % (h/(1.0*gd.UNIT_GEV))[0][0])
[[-0.71904 1.728941] [ 1.728941 0.71904 ]] [1e-5 eV^2] at 1 GeV, in eV: -7.190e-15
The energy is divided out separately, which is what makes this the piece to build once and reuse across a scan over energies.
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_vacuum_energy_independent_td(l: float, sth: float, Dm2: float, compute_matrix_multiplication: bool | None = False) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for vacuum oscillations, as a function of distance, even if it does not depend on it.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in vacuum, as a function of distance, parametrized by a single mixing angle theta and a single mass-squared difference Dm2. The Hamiltonian is H = (1/2)*R.M2.R^dagger, with R the 2x2 rotation matrix and M2 the mass matrix. The multiplicative factor 1/E is not applied. The vacuum Hamiltonian does not depend on distance in reality, but we include the dependence here as a way to validate the routine to compute probabilities for time-dependent Hamiltonians.
Added in version 1.0.0.
- Parameters:
l (float) – Position at which the Hamiltonian is evaluated.
sth (float) – Sine of the mixing angle \(\theta\).
Dm2 (float) – Mass-squared difference \(\Delta m^2\).
compute_matrix_multiplication (bool, optional) – If False (default), use the pre-computed expressions; otherwise, multiply R.M2.R^dagger live.
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_vacuum(energy: float, sth: float, Dm2: float, compute_matrix_multiplication: bool | None = False) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for vacuum oscillations.
Same as
hamiltonian_2nu_vacuum_energy_independent(), but with the 1/E factor applied.Added in version 1.0.0.
- Parameters:
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_vacuum_td(l: float, energy: float, sth: float, Dm2: float, compute_matrix_multiplication: bool | None = False) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for vacuum oscillations, as a function of distance, even if it does not depend on it.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in vacuum, as a function of distance, parametrized by a single mixing angle theta and a single mass-squared difference Dm2. The Hamiltonian is H = (1/2)*R.M2.R^dagger, with R the 2x2 rotation matrix and M2 the mass matrix. The multiplicative factor 1/E is not applied. The vacuum Hamiltonian does not depend on distance in reality, but we include the dependence here as a way to validate the routine to compute probabilities for time-dependent Hamiltonians.
Added in version 1.0.0.
- Parameters:
l (float) – Position at which the Hamiltonian is evaluated.
energy (float) – Neutrino energy.
sth (float) – Sine of the mixing angle \(\theta\).
Dm2 (float) – Mass-squared difference \(\Delta m^2\).
compute_matrix_multiplication (bool, optional) – If False (default), use the pre-computed expressions; otherwise, multiply R.M2.R^dagger live.
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_matter(VCC: float) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for matter oscillations.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in matter with constant density.
Added in version 1.0.0.
- Parameters:
VCC (float) – Potential due to charged-current interactions of nu_e with electrons.
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
Examples
import numpy as np from magnus.hamiltonians import hamiltonians2nu print(np.asarray(hamiltonians2nu.hamiltonian_2nu_matter(1.0e-13)))
[[1.e-13 0.e+00] [0.e+00 0.e+00]]
Only the electron-flavour entry is filled: matter is what the other flavours do not feel.
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_matter_td(l: float, VCC_func: Callable) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for matter oscillations, as a function of distance.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in matter with a given density as a function of position.
Added in version 1.0.0.
- Parameters:
l (float) – Position at which the Hamiltonian is evaluated.
VCC_func (Callable) – Potential due to charged-current interactions of nu_e with electrons, as a function of position, l.
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_nsi(VCC: float, eps_aa: float, eps_ab: complex) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for oscillations with NSI.
Computes and returns the 2x2 complex two-neutrino Hamiltonian for oscillations with non-standard interactions (NSI) in matter with constant density.
Two flavors admit only one physically meaningful diagonal NSI degree of freedom: an overall (flavor-universal) diagonal shift is proportional to the identity matrix, so it commutes with everything, contributes only an unobservable global phase to the evolution operator, and cannot affect any oscillation probability.
eps_aais therefore defined here as the non-universal (flavor-off-diagonal-difference) coupling, following the convention eps_mumu = 0, i.e., it parametrizes the coupling of \(\nu_e\) alone, relative to \(\nu_\mu\). [Earlier versions of this function placed eps_aa on both diagonal entries, making it a pure multiple of the identity and therefore a no-op on every oscillation probability – this was a bug, not a convention choice, confirmed by direct calculation.]Added in version 1.0.0.
- Parameters:
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_nsi_td(l: float, VCC_func: Callable, eps_aa: float, eps_ab: complex) numpy.ndarray[source]
Returns the two-neutrino NSI Hamiltonian as a function of position.
Same as
hamiltonian_2nu_nsi(), but evaluates the position-dependent matter potentialVCC_func(l)first.Added in version 1.0.0.
- Parameters:
l (float) – Position at which the Hamiltonian is evaluated.
VCC_func (Callable) – Potential due to charged-current interactions of nu_e with electrons, as a function of position, l.
eps_aa (float) – Non-universal diagonal NSI coupling of nu_e; see
hamiltonian_2nu_nsi().eps_ab (complex) – Flavor-off-diagonal (nu_e-nu_mu) NSI coupling.
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_liv(energy: float, sxi: float, b1: float, b2: float, Lambda: float, n_liv: int, nubar: bool | None = False) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for oscillations with LIV.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in a CPT-odd Lorentz invariance-violating background. Same as
hamiltonian_2nu_liv_energy_independent(), but with the \(E^{n_{\rm liv}}\) energy dependence of the LIV operator applied.Added in version 1.0.0.
- Parameters:
energy (float) – Neutrino energy.
sxi (float) – Sin(xi), with xi the rotation angle between the space of the eigenvectors of B2 and the flavor states.
b1 (float) – Eigenvalue b1 of the LIV operator B2.
b2 (float) – Eigenvalue b2 of the LIV operator B2.
Lambda (float) – Energy scale of the LIV operator B2.
n_liv (int) – Power of the energy dependence of the LIV operator (dimension of the operator minus 3).
nubar (bool, optional) – Accepted for interface parity with
magnus.hamiltonians.hamiltonians3nu.hamiltonian_3nu_liv()and its 4nu/5nu siblings, which conjugate their (complex) LIV mixing matrix for antineutrinos. The 2-flavor LIV rotation has no CP-violating phase (only the real anglesxi), so there is nothing to conjugate and this parameter currently has no effect. Default: False.
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray
- magnus.hamiltonians.hamiltonians2nu.hamiltonian_2nu_liv_energy_independent(sxi: float, b1: float, b2: float, Lambda: float, n_liv: int) numpy.ndarray[source]
Returns the two-neutrino Hamiltonian for oscillations with LIV.
Computes and returns the 2x2 real two-neutrino Hamiltonian for oscillations in a CPT-odd Lorentz invariance-violating background, without the energy-dependent prefactor.
Added in version 1.0.0.
- Parameters:
sxi (float) – Sin(xi), with xi the rotation angle between the space of the eigenvectors of B2 and the flavor states.
b1 (float) – Eigenvalue b1 of the LIV operator B2.
b2 (float) – Eigenvalue b2 of the LIV operator B2.
Lambda (float) – Energy scale of the LIV operator B2.
n_liv (int) – Power of the energy dependence of the LIV operator (dimension of the operator minus 3).
- Returns:
Hamiltonian 2x2 matrix.
- Return type:
np.ndarray