Physical Constants

AtomicAndPhysicalConstants.jl exports a flat set of const values drawn from the active CODATA release. All values are Float64 scalars in the units shown below.

The active release is selected at package-load time via a Preferences.jl setting (default: 2022). See CODATA Releases for how to change it.


Particle masses

Units: eV/c²

ConstantParticle
M_ELECTRONelectron
M_PROTONproton
M_NEUTRONneutron
M_MUONmuon
M_DEUTERONdeuteron
M_HELIONhelion (³He nucleus)
M_TRITONtriton (³H nucleus) ‡
M_PION_0neutral pion †
M_PION_CHARGEDcharged pion †

† Pion masses are taken from the Particle Data Group (PDG), not from CODATA, and are the same across all release years.

M_TRITON is not tabulated in the 2002 CODATA release; CODATA2002.M_TRITON is NaN.


Magnetic dipole moments

Units: eV/T

Stored values are CODATA SI values (J/T) converted to eV/T via EV_PER_J.

ConstantParticle
MU_ELECTRONelectron
MU_PROTONproton
MU_NEUTRONneutron
MU_MUONmuon
MU_DEUTERONdeuteron
MU_HELIONhelion
MU_TRITONtriton

Spin g-factors (dimensionless)

ConstantParticleCODATA availability
G_ELECTRONelectronall releases
G_PROTONprotonall releases
G_NEUTRONneutronall releases
G_MUONmuonall releases
G_DEUTERONdeuteronall releases §
G_HELIONhelion2010 and later §
G_TRITONtritonall releases §

§ These three are not the raw CODATA values — see below.

Composite-nucleus g-factors are renormalized

CODATA/NIST tabulates the deuteron, helion, and triton g-factors relative to the nuclear magneton $\mu_N = e\hbar / 2m_p$, i.e. the published number is

\[g_\text{NIST} = \frac{\mu}{I\,\mu_N}\]

so the proton mass — not the particle's own mass — sets the scale. Used directly in $a = (|g|-2)/2$ those values give a meaningless anomaly (for the deuteron, $(0.857\ldots - 2)/2$).

This package instead stores the g-factor in the convention $\boldsymbol{\mu} = g\,\frac{e}{2m}\,\mathbf{S}$, where the particle's own mass sets the scale, which is the convention the spin-precession (Thomas–BMT) equation and the gyromagnetic anomaly assume. Converting between the two is a single mass ratio, applied at package-load time:

\[g = g_\text{NIST}\,\frac{m}{m_p}\]

Exported constantDefinition
G_DEUTERONG_DEUTERON_NUCLEAR * M_DEUTERON / M_PROTON
G_HELIONG_HELION_NUCLEAR * M_HELION / M_PROTON
G_TRITONG_TRITON_NUCLEAR * M_TRITON / M_PROTON

The _NUCLEAR suffix marks the nuclear-magneton normalization: those are the names the raw NIST values carry as fields of the release structs (CODATA2022.G_DEUTERON_NUCLEAR, …). There is no exported top-level G_*_NUCLEAR constant; the active release's values are held as the internal AtomicAndPhysicalConstants._G_DEUTERON, ._G_HELION, and ._G_TRITON.

The mass ratio uses the mass from the same active CODATA release as the g-factor, so switching releases with set_release renormalizes consistently.

Only these three struct fields carry the _NUCLEAR suffix. The electron, muon, proton, and neutron g-factors need no rescaling — CODATA already tabulates them against the magneton built from the particle's own mass — so G_ELECTRON, G_MUON, G_PROTON, and G_NEUTRON keep their plain names in the release structs and are exported exactly as published.

Because the renormalization is folded into the constants themselves, g_spin and gyromagnetic_anomaly need no special-casing — $a = (|g|-2)/2$ applies uniformly to every subatomic species:

gyromagnetic_anomaly(Species("deuteron"))   # ≈ -0.1429872697

Gyromagnetic anomalies (dimensionless)

The gyromagnetic anomaly is defined as $a = (|g| - 2)/2$. gyromagnetic_anomaly takes the unsigned g-factor — the default of g_spin — so particles with a negative stored g-factor (electron, muon, neutron, helion) come out with the conventional positive anomaly rather than a value near $-2$.

ConstantParticleCODATA availability
ANOMALY_ELECTRONelectron2010 and later
ANOMALY_MUONmuon2010 and later

Other physical constants

ConstantDescriptionUnits
E_CHARGEelementary chargeC
C_LIGHTspeed of lightm/s
H_PLANCKPlanck's constant heV·s
H_BARreduced Planck constant ħeV·s
R_ELECTRONclassical electron radiusm
R_PROTONclassical proton radiusm
CLASSICAL_RADIUS_FACTOR$e^2 / (4\pi\varepsilon_0) = r_e m_e c^2$eV·m
K_BOLTZMANNBoltzmann's constant k<sub>B</sub>eV/K
EPS_0permittivity of free space1/(eV·m)
MU_0vacuum permeabilityeV·s²/m
AVOGADROAvogadro's constantmol⁻¹
FINE_STRUCTUREfine-structure constantdimensionless
RELEASE_YEARactive CODATA release year

CLASSICAL_RADIUS_FACTOR is not a tabulated CODATA value; it is computed as R_ELECTRON * M_ELECTRON from the active release. It is the same for all particles of charge ±1. Because it is derived, it is not a field of the CODATA_release structs (e.g. there is no CODATA2022.CLASSICAL_RADIUS_FACTOR).


Unit-conversion constants

ConstantConversion
KG_PER_AMUkg per dalton
EV_PER_AMUeV/c² per dalton
J_PER_EVjoules per eV
EV_PER_JeV per joule
G_PER_EVgrams per eV/c²
KG_PER_MEV_C2kg per MeV/c²