Module constants

Module constants 

Source
Expand description

Physical constants used throughout NEREIDS.

Values from CODATA 2018 recommended values. Reference: https://physics.nist.gov/cuu/Constants/

Constants§

AVOGADRO
Avogadro’s number in mol⁻¹.
BOLTZMANN_EV_PER_K
Boltzmann constant in eV/K.
DIVISION_FLOOR
Floor for denominators in physics evaluations (penetrability, shift, etc.) to avoid division by zero.
EV_TO_JOULES
1 eV in joules.
HBAR_EV_S
Planck constant (reduced, ħ) in eV·s.
LM_DIAGONAL_FLOOR
Floor for Levenberg-Marquardt diagonal elements to ensure damping stability. Intentionally much larger than PIVOT_FLOOR — LM requires a meaningful minimum curvature for numerical stability of the trust-region step.
LOG_FLOOR
Floor for avoiding log(0) or division by zero in general computations.
NEAR_ZERO_FLOOR
Generic tiny positive floor used as a near-zero tolerance across physics calculations (e.g., cross-sections in barns, energies in eV, widths, dimensionless parameters). Values below this are treated as negligible.
NEUTRON_MASS_AMU
Neutron mass in atomic mass units (u).
NEUTRON_MASS_KG
Neutron mass in kg.
NEUTRON_MASS_MEV
Neutron mass in MeV/c².
PIVOT_FLOOR
Floor for pivot detection and division safety in numerical linear algebra (LM solver, Gaussian elimination). Values below this indicate a (near-)singular system.
POISSON_EPSILON
Floor for Poisson model values to avoid log(0) in NLL computation.
QUANTUM_NUMBER_EPS
Epsilon for floating-point comparison of quantum numbers (J, L, spin).
SPEED_OF_LIGHT
Speed of light in m/s.

Functions§

energy_to_tof
Convert neutron energy (eV) to time-of-flight (μs) given flight path (m).
energy_to_wavelength_angstrom
Convert neutron energy (eV) to wavelength (Å).
tof_to_energy
Convert neutron time-of-flight (μs) and flight path (m) to energy (eV).