magnus.globaldefs

globaldefs.py

Contains physical constants and unit-conversion constants.

This module contains values of physical constants and unit-conversion factors used by the various modules of Magnus: unit conversions (km, cm, GeV, etc., to natural units of eV), fundamental constants (G_F, particle masses, Avogadro’s number), Earth/Sun radii and reference densities, flavor index constants (NUE, NUMU, NUTAU, NUS), predefined oscillation/NSI/LIV parameter sets (e.g., NuFIT 6.1, the default), and ANSI terminal color codes (class cstyle) used to format warning/error messages.

Routine listings

  • cstyle - ANSI terminal color-code constants

  • set_color_output - Enables or disables ANSI color in the warning

    and error message prefixes

  • load_nufit_params - Loads one NuFIT release/ordering/category as a

    dict of standard oscillation parameters, in whichever angles convention is asked for

The remaining module-level names are physical constants, unit-conversion factors, the ANGLE_CONVENTIONS tuple and the three warning classes defined here – MixingAngleConventionWarning, BaselineUnitWarning and SterileMatterCompositionWarning – not routines; see the module source for the full list.

Attributes

WARNING_MSG_NO_COLOR

WARNING_MSG_IN_COLOR

ERROR_MSG_NO_COLOR

ERROR_MSG_IN_COLOR

ANGLE_CONVENTIONS

The values the angles keyword accepts, in the order they are documented.

IMPLAUSIBLE_BASELINE_NATURAL_UNITS

TOL_MSG_NO_COLOR

TOL_MSG_IN_COLOR

MAGNUS_MAX_PREDEFINED_NUM_FLAVORS

Module-level constant

CONV_KM_TO_INV_EV

Module-level constant

UNIT_KM

Module-level constant

CONV_CM_TO_INV_EV

Module-level constant

UNIT_CM

Module-level constant

CONV_CM3_TO_INV_EV3

Module-level constant

UNIT_CM3

Module-level constant

CONV_INV_EV_TO_CM

Module-level constant

UNIT_PER_CM3

Module-level constant

CONV_EV_TO_G

Module-level constant

CONV_G_TO_EV

Module-level constant

UNIT_G_PER_CM3

Module-level constant

SQRT_OF_2

Module-level constant

GF

Module-level constant

MASS_ELECTRON

Module-level constant

MASS_PROTON

Module-level constant

MASS_NEUTRON

Module-level constant

ELECTRON_FRACTION_EARTH_CRUST

Module-level constant

DENSITY_MATTER_CRUST_G_PER_CM3

Module-level constant

N_AV

Module-level constant

NUM_DENSITY_E_EARTH_CRUST

Module-level constant

VCC_EARTH_CRUST

Module-level constant

EARTH_RADIUS

Module-level constant

SUN_RADIUS

Module-level constant

NUM_DENSITY_E_SUN_CENTRAL

Module-level constant

L_SCALE_SUN

Module-level constant

NUE

Module-level constant

NUMU

Module-level constant

NUTAU

Module-level constant

NUS

Module-level constant

NUS1

Module-level constant

NUS2

Module-level constant

UNIT_KEV

Module-level constant

UNIT_MEV

Module-level constant

UNIT_GEV

Module-level constant

UNIT_TEV

Module-level constant

UNIT_PEV

Module-level constant

UNIT_EEV

Module-level constant

S12_NO_BF_NUFIT_6_0

Module-level constant

S23_NO_BF_NUFIT_6_0

Module-level constant

S13_NO_BF_NUFIT_6_0

Module-level constant

DCP_NO_BF_NUFIT_6_0

Module-level constant

D21_NO_BF_NUFIT_6_0

Module-level constant

D31_NO_BF_NUFIT_6_0

Module-level constant

S12_IO_BF_NUFIT_6_0

Module-level constant

S23_IO_BF_NUFIT_6_0

Module-level constant

S13_IO_BF_NUFIT_6_0

Module-level constant

DCP_IO_BF_NUFIT_6_0

Module-level constant

D21_IO_BF_NUFIT_6_0

Module-level constant

D32_IO_BF_NUFIT_6_0

Module-level constant

D31_IO_BF_NUFIT_6_0

Module-level constant

OSC_PARAMS_NU_FIT_6_0_SK_NO

OSC_PARAMS_NU_FIT_6_0_SK_IO

OSC_PARAMS_PREDEFINED

EPS_EE

Module-level constant

EPS_EM

Module-level constant

EPS_ET

Module-level constant

EPS_MM

Module-level constant

EPS_MT

Module-level constant

EPS_TT

Module-level constant

EPS_2

Module-level constant

EPS_3

Module-level constant

SXI12

Module-level constant

SXI23

Module-level constant

SXI13

Module-level constant

DXICP

Module-level constant

B1

Module-level constant

B2

Module-level constant

B3

Module-level constant

LAMBDA

Module-level constant

NUFIT_GLOBAL_FITS

OSC_PARAMS_NU_FIT_6_1_SK_NO

OSC_PARAMS_NU_FIT_6_1_SK_IO

Exceptions

MixingAngleConventionWarning

A parameter set is very probably not in the angles convention it declared.

BaselineUnitWarning

A baseline was passed that looks like kilometers rather than eV-1.

SterileMatterCompositionWarning

A caller's scalar builds the sterile matter entry from a different medium than the

Classes

cstyle

ANSI escape-code constants for colored/styled terminal output.

Functions

set_color_output(→ None)

Enables or disables ANSI color in the warning/error/tolerance message prefixes.

load_nufit_params([version, ordering, category, angles])

Load standard three-flavor mixing parameters from a NuFIT global fit.

Module Contents

class magnus.globaldefs.cstyle[source]

ANSI escape-code constants for colored/styled terminal output.

Used to format the warning/error/tolerance messages printed by oscprob.py (e.g., gd.WARNING_MSG_IN_COLOR, gd.ERROR_MSG_IN_COLOR). Has no effect on Windows terminals unless os.system("") has been called first, which this module does at import time.

Added in version 1.0.0.

CEND = '\x1b[0m'[source]
CBOLD = '\x1b[1m'[source]
CITALIC = '\x1b[3m'[source]
CURL = '\x1b[4m'[source]
CBLINK2 = '\x1b[6m'[source]
CSELECTED = '\x1b[7m'[source]
CBLACK = '\x1b[30m'[source]
CRED = '\x1b[31m'[source]
CGREEN = '\x1b[32m'[source]
CYELLOW = '\x1b[33m'[source]
CBLUE = '\x1b[34m'[source]
CVIOLET = '\x1b[35m'[source]
CBEIGE = '\x1b[36m'[source]
CWHITE = '\x1b[37m'[source]
CBLACKBG = '\x1b[40m'[source]
CREDBG = '\x1b[41m'[source]
CGREENBG = '\x1b[42m'[source]
CYELLOWBG = '\x1b[43m'[source]
CBLUEBG = '\x1b[44m'[source]
CVIOLETBG = '\x1b[45m'[source]
CBEIGEBG = '\x1b[46m'[source]
CWHITEBG = '\x1b[47m'[source]
CGREY = '\x1b[90m'[source]
CRED2 = '\x1b[91m'[source]
CGREEN2 = '\x1b[92m'[source]
CYELLOW2 = '\x1b[93m'[source]
CBLUE2 = '\x1b[94m'[source]
CVIOLET2 = '\x1b[95m'[source]
CBEIGE2 = '\x1b[96m'[source]
CWHITE2 = '\x1b[97m'[source]
CGREYBG = '\x1b[100m'[source]
CREDBG2 = '\x1b[101m'[source]
CGREENBG2 = '\x1b[102m'[source]
CYELLOWBG2 = '\x1b[103m'[source]
CBLUEBG2 = '\x1b[104m'[source]
CVIOLETBG2 = '\x1b[105m'[source]
CBEIGEBG2 = '\x1b[106m'[source]
CWHITEBG2 = '\x1b[107m'[source]
magnus.globaldefs.WARNING_MSG_NO_COLOR = 'Warning:'[source]
magnus.globaldefs.WARNING_MSG_IN_COLOR = '\x1b[45mWarning:\x1b[0m'[source]
magnus.globaldefs.ERROR_MSG_NO_COLOR = 'Error in magnus:'[source]
magnus.globaldefs.ERROR_MSG_IN_COLOR = '\x1b[41mError in magnus:\x1b[0m'[source]
magnus.globaldefs.ANGLE_CONVENTIONS = ('sin', 'sin2', 'rad', 'deg')[source]

The values the angles keyword accepts, in the order they are documented.

'sin' (the default everywhere) is the sine of the mixing angle, 'sin2' its square – which is what global fits report – 'rad' the angle itself in radians, and 'deg' in degrees. Under 'deg' the CP phases are read as degrees too; under the other three they stay in radians, a sine being no way to state a phase.

Defined here rather than in magnus.hamiltonians because the conversion itself lives in a private module, and a name users are told to filter or compare against has to be documented somewhere public.

Added in version 1.0.0.

Type:

tuple

exception magnus.globaldefs.MixingAngleConventionWarning[source]

Bases: UserWarning

A parameter set is very probably not in the angles convention it declared.

Raised only where the mistake is diagnosable from the values themselves: sines handed to angles='deg' are about fifty times too small to be angles, and the call would otherwise return a converged, unitary, entirely wrong probability rather than an error. A warning rather than an exception, for the same reason as magnus.matter.DensityUnitWarning: the threshold reflects the mixing people currently study, not a law.

Its own class so it can be silenced or promoted on its own:

import warnings
import magnus.globaldefs as gd

warnings.filterwarnings('error', category=gd.MixingAngleConventionWarning)

Added in version 1.0.0.

exception magnus.globaldefs.BaselineUnitWarning[source]

Bases: UserWarning

A baseline was passed that looks like kilometers rather than eV-1.

Every length crossing this API is in natural units, so a baseline is \(L_{\rm km} \times\) CONV_KM_TO_INV_EV, some 5.07e9 per kilometer. Passing the raw kilometer value does not fail: the call returns a converged, exactly unitary probability for a baseline a few meters long, which looks like an ordinary answer rather than a wrong one. Measured on the Sun, the radius in kilometres passed raw returns 1.000 at 20 MeV where the correct value is 0.29, and the survival probability comes out rising with energy, which is backwards for an MSW resonance.

The threshold is IMPLAUSIBLE_BASELINE_NATURAL_UNITS, about two meters in natural units, so a genuinely short baseline is still reachable without tripping it.

Its own class so it can be silenced deliberately:

import warnings
import magnus.globaldefs as gd

warnings.filterwarnings('ignore', category=gd.BaselineUnitWarning)

Added in version 1.0.5.

magnus.globaldefs.IMPLAUSIBLE_BASELINE_NATURAL_UNITS = 10000000.0[source]
exception magnus.globaldefs.SterileMatterCompositionWarning[source]

Bases: UserWarning

A caller’s scalar builds the sterile matter entry from a different medium than the density.

An Earth chord takes its neutron-to-proton ratio from \(Y_e\) layer by layer for the density, and – by default – for the sterile states’ entry in the matter projector too, so out of the box the two describe the same medium and this warning has nothing to say. It fires when a caller passes a scalar ratio_number_neutrons_to_protons over layered composition: no scalar describes a chord that crosses iron and rock – near the sterile matter resonance the mismatch reaches ~0.4 in probability at 3+1 on a core-crossing chord, and the best possible scalar still leaves ~7e-3 – and it does so silently in the physics, since nothing else about the call looks wrong. With a uniform electron_fraction override it fires only when the scalar contradicts the ratio that override implies.

Its own class so it can be silenced once the choice has been made deliberately:

import warnings
import magnus.globaldefs as gd

warnings.filterwarnings('ignore', category=gd.SterileMatterCompositionWarning)

Three flavors never raise it: the projector’s sterile block is empty.

Added in version 1.0.0.

Changed in version 1.1.0: The default no longer warns – the projector follows the composition, which is the fix for the mismatch this class used to report. A scalar over layered \(Y_e\) now warns unconditionally: the old 2% threshold on \(r\) was measured to pass chords whose error matched the very figure the warning quoted.

magnus.globaldefs.TOL_MSG_NO_COLOR = 'Requested tolerance achieved'[source]
magnus.globaldefs.TOL_MSG_IN_COLOR = '\x1b[42mRequested tolerance achieved\x1b[0m'[source]
magnus.globaldefs.set_color_output(enabled: bool) → None[source]

Enables or disables ANSI color in the warning/error/tolerance message prefixes.

The *_IN_COLOR constants above wrap their text in ANSI escape codes, which read correctly in a terminal but appear as literal escape-code noise anywhere that does not interpret them – a captured log file, a Jupyter notebook rendered to HTML, or the jupyter-execute cells in this package’s own documentation. Calling this function with False rebinds every *_IN_COLOR constant to its plain-text counterpart, so the existing call sites (which all reference the *_IN_COLOR names) print unadorned text with no further change. Calling it with True restores the colored versions.

Added in version 1.0.0.

Parameters:

enabled (bool) – True to emit ANSI-colored message prefixes (the default at import time), False to emit plain text.

Return type:

None

Examples

import magnus.globaldefs as gd

gd.set_color_output(False)
gd.WARNING_MSG_IN_COLOR
'Warning:'
magnus.globaldefs.MAGNUS_MAX_PREDEFINED_NUM_FLAVORS = 5[source]

Module-level constant

Maximum number of flavors for which we have hard-coded routines in the oscprob module. Units: [Adimensional]

Type:

int

magnus.globaldefs.CONV_KM_TO_INV_EV = 5067730000.0[source]

Module-level constant

Multiplicative conversion factor from km to \(\text{eV}^{-1}\). Units: [\(\text{km}^{-1}~\text{eV}^{-1}\)].

Type:

float

magnus.globaldefs.UNIT_KM = 5067730000.0[source]

Module-level constant

Multiplicative conversion factor from km to \(\text{eV}^{-1}\). Alias for CONV_KM_TO_INV_EV. Units: [\(\text{km}^{-1}~\text{eV}^{-1}\)].

Type:

float

magnus.globaldefs.CONV_CM_TO_INV_EV = 50677.3[source]

Module-level constant

Multiplicative conversion factor from cm to \(\text{eV}^{-1}\). Units: [\(\text{cm}^{-1}~\text{eV}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_CM = 50677.3[source]

Module-level constant

Multiplicative conversion factor from cm to \(\text{eV}^{-1}\). Alias for CONV_CM_TO_INV_EV. Units: [\(\text{cm}^{-1}~\text{eV}^{-1}\)]

Type:

float

magnus.globaldefs.CONV_CM3_TO_INV_EV3[source]

Module-level constant

Multiplicative conversion factor from \(\text{cm}^{3}\) to \(\text{eV}^{-3}\). Units: [\(\text{cm}^{-3}~\text{eV}^{-3}\)]

Type:

float

magnus.globaldefs.UNIT_CM3[source]

Module-level constant

Multiplicative conversion factor from \(\text{cm}^{3}\) to \(\text{eV}^{-3}\). Alias for CONV_CM3_TO_INV_EV3. Units: [\(\text{cm}^{-3}~\text{eV}^{-3}\)]

Type:

float

magnus.globaldefs.CONV_INV_EV_TO_CM = 1.9732700834495916e-05[source]

Module-level constant

Multiplicative conversion factor from \(\text{eV}^{-1}\) to cm. Units: [eV cm]

Type:

float

magnus.globaldefs.UNIT_PER_CM3[source]

Module-level constant

Multiplicative conversion factor from \(\text{cm}^{-3}\) to \(\text{eV}^{3}\). Units: [\(\text{cm}^{3}~\text{eV}^{3}\)]

Type:

float

magnus.globaldefs.CONV_EV_TO_G = 1.783e-33[source]

Module-level constant

Multiplicative conversion factor from eV to grams: the mass equivalent of one eV. Units: [\(\text{g eV}^{-1}\)]

Type:

float

magnus.globaldefs.CONV_G_TO_EV = 5.608524957936063e+32[source]

Module-level constant

Multiplicative conversion factor from grams to eV, as a mass. Units: [\(\text{eV g}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_G_PER_CM3[source]

Module-level constant

Multiplicative conversion factor from \(\text{g cm}^{-3}\) to \(\text{eV}^{4}\). Units: [\(\text{g}^{-1}~\text{cm}^{3}~\text{eV}^{4}\)]

Type:

float

magnus.globaldefs.SQRT_OF_2[source]

Module-level constant

Square root of 2. Units: [Adimensional]

Type:

float

magnus.globaldefs.GF = 1.1663787e-23[source]

Module-level constant

Fermi constant. Units: [\(\text{eV}^{-2}\)]

Type:

float

magnus.globaldefs.MASS_ELECTRON = 510998.9461[source]

Module-level constant

Electron mass. Units: [eV]

Type:

float

magnus.globaldefs.MASS_PROTON = 938272046.0[source]

Module-level constant

Proton mass. Units: [eV]

Type:

float

magnus.globaldefs.MASS_NEUTRON = 939565379.0[source]

Module-level constant

Neutron mass. Units: [eV]

Type:

float

magnus.globaldefs.ELECTRON_FRACTION_EARTH_CRUST = 0.5[source]

Module-level constant

Electron fraction in the Earth’s crust. Units: [Adimensional]

Type:

float

magnus.globaldefs.DENSITY_MATTER_CRUST_G_PER_CM3 = 3.0[source]

Module-level constant

Average matter density in the Earth’s crust. Units: [\(\text{g cm}^{-3}\)]

Type:

float

magnus.globaldefs.N_AV = 6.02214076e+23[source]

Module-level constant

Avogadro constant Units: [\(\text{mol}^{-1}\)]

Type:

float

magnus.globaldefs.NUM_DENSITY_E_EARTH_CRUST[source]

Module-level constant

Electron number density in the Earth’s crust. The mean nucleon mass is taken as \((m_p + m_n)/2\), not the atomic mass unit, which puts this about 0.8% below the textbook \(\rho N_A Y_e\); VCC_EARTH_CRUST inherits the same convention. Units: [\(\text{eV}^{3}\)]

Type:

float

magnus.globaldefs.VCC_EARTH_CRUST[source]

Module-level constant

Charged-current matter potential in the Earth’s crust. Units: [eV]

Type:

float

magnus.globaldefs.EARTH_RADIUS = 6371.0[source]

Module-level constant

Average Earth radius. Units: [km]

Type:

float

magnus.globaldefs.SUN_RADIUS = 695700.0[source]

Module-level constant

Nominal solar radius, IAU 2015 Resolution B3. L_SCALE_SUN is derived from it, so every solar scale height and baseline in the package follows it. Units: [km]

Type:

float

magnus.globaldefs.NUM_DENSITY_E_SUN_CENTRAL[source]

Module-level constant

Normalization of the standard exponential fit to the solar electron number density, \(n_e(r) = 245\,N_A\,\exp(-10.54\,r/R_\odot)\ \text{cm}^{-3}\).

This is the \(r \to 0\) intercept of that fit, not the central density of a solar model. The two differ by more than a factor of two: the BS2005-AGS,OP table gives \(n_e = 102.7\,N_A\ \text{cm}^{-3}\) at its innermost point \(r = 0.0016\,R_\odot\), against the fit’s 245, because the real profile flattens towards the center while an exponential does not. Measured against that table across the whole star:

\(r/R_\odot\)

largest departure from it

0.00 – 0.05

fit high by 2.4x

0.05 – 0.10

fit high by 1.6x

0.10 – 0.20

21 %

0.20 – 0.30

2.5 %

0.30 – 0.70

11 %

0.70 – 1.00

up to 89 %

So the fit is a few-percent description only in a band around \(0.2\,R_\odot\), and the scale height L_SCALE_SUN – the span the package’s own diagnostics use as a trajectory – lies at \(0.095\,R_\odot\), where the fit is high by about 30 %. It is still the right constant for the exponential profile it normalizes; what would be wrong is reading it as a measurement of the Sun’s central density, or the exponential as a stand-in for a tabulated model in the core.

Units: [\(\text{eV}^{3}\)]

Type:

float

magnus.globaldefs.L_SCALE_SUN = 334499028557874.75[source]

Module-level constant

Scale height of the solar electron number density, \(R_\odot/10.54\), the decay length of the exponential fit normalized by NUM_DENSITY_E_SUN_CENTRAL.

Units: [\(\text{eV}^{-1}\)]

Type:

float

magnus.globaldefs.NUE = 0[source]

Module-level constant

Index used to denote nu_e flavor when computing probabilities. Units: [Adimensional]

Type:

int

magnus.globaldefs.NUMU = 1[source]

Module-level constant

Index used to denote nu_mu flavor when computing probabilities. Units: [Adimensional]

Type:

int

magnus.globaldefs.NUTAU = 2[source]

Module-level constant

Index used to denote nu_tau flavor when computing probabilities. Units: [Adimensional]

Type:

int

magnus.globaldefs.NUS = 3[source]

Module-level constant

Index used to denote the sterile flavor when computing four-neutrino (3+1) probabilities. Units: [Adimensional]

Type:

int

magnus.globaldefs.NUS1 = 3[source]

Module-level constant

Index used to denote the first sterile flavor when computing five-neutrino (3+2) probabilities. Units: [Adimensional]

Type:

int

magnus.globaldefs.NUS2 = 4[source]

Module-level constant

Index used to denote the second sterile flavor when computing five-neutrino (3+2) probabilities. Units: [Adimensional]

Type:

int

magnus.globaldefs.UNIT_KEV = 1000.0[source]

Module-level constant

One keV, in eV. Multiply by it to turn a number of keV into the eV every entry point expects: 1.0*gd.UNIT_KEV is one keV. Units: [\(\text{eV keV}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_MEV = 1000000.0[source]

Module-level constant

One MeV, in eV. Multiply by it to turn a number of MeV into the eV every entry point expects: 1.0*gd.UNIT_MEV is one MeV. Units: [\(\text{eV MeV}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_GEV = 1000000000.0[source]

Module-level constant

One GeV, in eV. Multiply by it to turn a number of GeV into the eV every entry point expects: 1.0*gd.UNIT_GEV is one GeV. Units: [\(\text{eV GeV}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_TEV = 1000000000000.0[source]

Module-level constant

One TeV, in eV. Multiply by it to turn a number of TeV into the eV every entry point expects: 1.0*gd.UNIT_TEV is one TeV. Units: [\(\text{eV TeV}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_PEV = 1000000000000000.0[source]

Module-level constant

One PeV, in eV. Multiply by it to turn a number of PeV into the eV every entry point expects: 1.0*gd.UNIT_PEV is one PeV. Units: [\(\text{eV PeV}^{-1}\)]

Type:

float

magnus.globaldefs.UNIT_EEV = 1e+18[source]

Module-level constant

One EeV, in eV. Multiply by it to turn a number of EeV into the eV every entry point expects: 1.0*gd.UNIT_EEV is one EeV. Units: [\(\text{eV EeV}^{-1}\)]

Type:

float

magnus.globaldefs.S12_NO_BF_NUFIT_6_0[source]

Module-level constant

Lepton mixing angle \(\sin\theta_{12}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [Adimensional]

Type:

float

magnus.globaldefs.S23_NO_BF_NUFIT_6_0[source]

Module-level constant

Lepton mixing angle \(\sin\theta_{23}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [Adimensional]

Type:

float

magnus.globaldefs.S13_NO_BF_NUFIT_6_0[source]

Module-level constant

Lepton mixing angle \(\sin\theta_{13}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [Adimensional]

Type:

float

magnus.globaldefs.DCP_NO_BF_NUFIT_6_0[source]

Module-level constant

Lepton CP-violation phase \(\delta_\text{CP}\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [radian]

Type:

float

magnus.globaldefs.D21_NO_BF_NUFIT_6_0 = 7.49e-05[source]

Module-level constant

Mass-squared difference \(\Delta m_{21}^2\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]

Type:

float

magnus.globaldefs.D31_NO_BF_NUFIT_6_0 = 0.002513[source]

Module-level constant

Mass-squared difference \(\Delta m_{31}^2\), best fit from NuFIT 6.0, assuming normal ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]

Type:

float

magnus.globaldefs.S12_IO_BF_NUFIT_6_0[source]

Module-level constant

Lepton mixing angle \(\sin\theta_{12}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [Adimensional]

Type:

float

magnus.globaldefs.S23_IO_BF_NUFIT_6_0[source]

Module-level constant

Lepton mixing angle \(\sin\theta_{23}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [Adimensional]

Type:

float

magnus.globaldefs.S13_IO_BF_NUFIT_6_0[source]

Module-level constant

Lepton mixing angle \(\sin\theta_{13}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [Adimensional]

Type:

float

magnus.globaldefs.DCP_IO_BF_NUFIT_6_0[source]

Module-level constant

Lepton CP-violation phase \(\delta_\text{CP}\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [radian]

Type:

float

magnus.globaldefs.D21_IO_BF_NUFIT_6_0 = 7.49e-05[source]

Module-level constant

Mass-squared difference \(\Delta m_{21}^2\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]

Type:

float

magnus.globaldefs.D32_IO_BF_NUFIT_6_0 = -0.002484[source]

Module-level constant

Mass-squared difference \(\Delta m_{32}^2\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]

Type:

float

magnus.globaldefs.D31_IO_BF_NUFIT_6_0 = -0.0024091[source]

Module-level constant

Mass-squared difference \(\Delta m_{31}^2\), best fit from NuFIT 6.0, assuming inverted ordering with SK atmospheric data. Units: [\(\text{eV}^{2}\)]

Type:

float

magnus.globaldefs.OSC_PARAMS_NU_FIT_6_0_SK_NO[source]
magnus.globaldefs.OSC_PARAMS_NU_FIT_6_0_SK_IO[source]
magnus.globaldefs.OSC_PARAMS_PREDEFINED[source]
magnus.globaldefs.EPS_EE = 0.06[source]

Module-level constant

Total NSI strength parameter eps_ee computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]

Type:

float

magnus.globaldefs.EPS_EM = -0.06[source]

Module-level constant

Total NSI strength parameter eps_em computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]

Type:

float

magnus.globaldefs.EPS_ET = 0.0[source]

Module-level constant

Total NSI strength parameter eps_et computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]

Type:

float

magnus.globaldefs.EPS_MM = 1.2[source]

Module-level constant

Total NSI strength parameter eps_mm computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]

Type:

float

magnus.globaldefs.EPS_MT = 0.0[source]

Module-level constant

Total NSI strength parameter eps_mt computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]

Type:

float

magnus.globaldefs.EPS_TT = 0.0[source]

Module-level constant

Total NSI strength parameter eps_tt computed using values of the u and d quark parameters compatible at 2sigma with LMA+coherent from 1805.04530. Units: [Adimensional]

Type:

float

magnus.globaldefs.EPS_2[source]

Module-level constant

Vector of total NSI strength parameters for two-neutrino oscillations. Units: [Adimensional]

Type:

list of float

magnus.globaldefs.EPS_3[source]

Module-level constant

Vector of total NSI strength parameters for three-neutrino oscillations. Units: [Adimensional]

Type:

list of float

magnus.globaldefs.SXI12 = 0.0[source]

Module-level constant

LIV lepton mixing angle sin(xi_12). Units: [Adimensional]

Type:

float

magnus.globaldefs.SXI23 = 0.0[source]

Module-level constant

LIV lepton mixing angle sin(xi_23). Units: [Adimensional]

Type:

float

magnus.globaldefs.SXI13 = 0.0[source]

Module-level constant

LIV lepton mixing angle sin(xi_13). Units: [Adimensional]

Type:

float

magnus.globaldefs.DXICP = 0.0[source]

Module-level constant

LIV CP-violation phase. Units: [radian]

Type:

float

magnus.globaldefs.B1 = 1e-09[source]

Module-level constant

LIV eigenvalue b_1. Units: [eV]

Type:

float

magnus.globaldefs.B2 = 1e-09[source]

Module-level constant

LIV eigenvalue b_2. Units: [eV]

Type:

float

magnus.globaldefs.B3 = 2e-09[source]

Module-level constant

LIV eigenvalue b_3. Units: [eV]

Type:

float

magnus.globaldefs.LAMBDA = 1000000000000.0[source]

Module-level constant

LIV energy scale Lambda. Units: [eV]

Type:

float

magnus.globaldefs.NUFIT_GLOBAL_FITS[source]
magnus.globaldefs.load_nufit_params(version='NuFIT 6.1', ordering='NO', category=None, angles='sin')[source]

Load standard three-flavor mixing parameters from a NuFIT global fit.

Looks up NUFIT_GLOBAL_FITS for the requested release, mass ordering, and (release-specific) secondary category, and returns them as a plain dict with the same parameter names used throughout Magnus (s12, s23, s13, dCP, D21, D31), so the result can be passed directly as keyword arguments to any osc_prob_3nu_* function (or to the builders in magnus.hamiltonians.hamiltonians3nu and other functions that take the same standard-oscillation parameter names).

Parameters:
  • version (str, optional) – NuFIT release to load, e.g. 'NuFIT 6.1', 'NuFIT 5.2', 'NuFIT 1.0'. See NUFIT_GLOBAL_FITS.keys() for the full list of available releases (v1.0 through v6.1). Default: 'NuFIT 6.1' (the latest release at the time of writing).

  • ordering (str, optional) – Neutrino mass ordering: 'NO' (normal) or 'IO' (inverted). Default: 'NO'.

  • category (str or None, optional) – Release-specific secondary category (e.g. 'with_SK' / 'without_SK' for v4.0+, 'LEM' / 'LID' for v2.1, 'free_fluxes_rsbl' / 'huber_fluxes_no_rsbl' for v1.0-v1.3). If None (default), the release’s preferred/primary category is used (for releases with a with_SK/without_SK split, this is 'with_SK'). See NUFIT_GLOBAL_FITS[version]['categories'].keys() for the categories available for a given release. Default: None.

  • angles (str, optional) –

    Convention the three mixing angles are returned in: 'sin' (default) their sines, 'sin2' their sines squared – which is the form NuFIT itself reports – 'rad' the angles in radians, or 'deg' in degrees. Under 'deg' dCP is converted too.

    Pass the same value here that you pass to the probability function. The two are one setting in two places: osc_prob_3nu_earth(E, **load_nufit_params(), angles='deg') reads perfectly and is silently wrong, because the loader’s sines (0.15 to 0.85) are then interpreted as degrees, about fifty times too small. The result is a converged, unitary, entirely wrong probability. The guard in magnus.hamiltonians.hamiltonians3nu.hamiltonian_3nu_vacuum_energy_independent() catches that particular pairing, but the reliable fix is to state the convention once and use it on both calls.

Returns:

Dict with keys s12, s23, s13, dCP, D21 and D31. The three angles are in whichever convention angles names – by default their sines, adimensional – and dCP is in radians unless angles='deg', which puts it in degrees. D21 and D31 are always \(\text{eV}^{2}\).

Return type:

dict

Raises:

ValueError – If version is not a known NuFIT release, if ordering is not 'NO' or 'IO', if category is not one of the categories available for version, or if angles is not one of ANGLE_CONVENTIONS.

Examples

Load a release and feed it straight into a probability function (the code below runs when these docs are built, so the output shown is always current):

import magnus.globaldefs as gd
import magnus.oscprob as oscprob

params = gd.load_nufit_params('NuFIT 6.1', ordering='NO')

sorted(params.keys())
['D21', 'D31', 'dCP', 's12', 's13', 's23']
oscprob.osc_prob_3nu_vacuum(1.0 * gd.UNIT_GEV, 100.0 * gd.UNIT_KM,
                            **params)
array([[0.99147795, 0.00323398, 0.00528806],
       [0.0034939 , 0.90719742, 0.08930869],
       [0.00502815, 0.0895686 , 0.90540325]])

Comparing normal- and inverted-ordering best fits from an older release:

no = gd.load_nufit_params('NuFIT 4.0', ordering='NO', category='with_SK')
io = gd.load_nufit_params('NuFIT 4.0', ordering='IO', category='with_SK')

no['D31'] > 0 and io['D31'] < 0
True

Added in version 1.0.0.

magnus.globaldefs.OSC_PARAMS_NU_FIT_6_1_SK_NO[source]
magnus.globaldefs.OSC_PARAMS_NU_FIT_6_1_SK_IO[source]