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).