scuq.constants¶
scuq.constants provides a deliberately small set of physical constants as
native SCUQ quantities. It does not import SciPy and does not mirror the full
scipy.constants database.
Data provenance¶
The measured value in the initial set is pinned to the 2022 CODATA recommended values published in version 9.0 of the NIST Reference on Constants, Units, and Uncertainty (May 2024). The exact values follow the SI defining constants published by the BIPM.
The SI fixes the numerical values of c, h, e, k_B, and
N_A exactly. Their SCUQ standard uncertainty is therefore zero. In
contrast, the fine-structure constant alpha is measured and carries the
CODATA 2022 standard uncertainty.
Example¶
from scuq.constants import alpha, epsilon_0, mu_0, Z_0
from scuq.ucomponents import Context
context = Context()
print(context.value_uncertainty_unit(alpha))
print(context.value_uncertainty_unit(mu_0))
print(context.value_uncertainty_unit(epsilon_0))
print(context.value_uncertainty_unit(Z_0))
The module-level constants are protected against augmented assignment and
direct changes to their stored value or unit. Ordinary arithmetic remains
available and returns regular scuq.quantities.Quantity expressions.
API¶
Curated physical constants represented as uncertainty-aware quantities.
The measured values in this module are pinned to the 2022 CODATA recommended values published in NIST Reference on Constants, Units, and Uncertainty, version 9.0 (May 2024). The exact constants use the defining values of the International System of Units (SI), 9th edition.
Only the fine-structure constant is introduced as an independent uncertain input. Vacuum permeability, vacuum permittivity, and vacuum impedance are derived from that shared input and the exact defining constants. Consequently, SCUQ retains their physical dependence during uncertainty propagation.
References
- scuq.constants.CODATA_RELEASE = '2022 CODATA recommended values'¶
Pinned release used for measured physical constants.
- scuq.constants.CODATA_SOURCE = 'https://physics.nist.gov/constants'¶
Official NIST source for the pinned CODATA release.
- scuq.constants.SI_DEFINITION_SOURCE = 'https://www.bipm.org/en/measurement-units/si-defining-constants'¶
Official BIPM source for exact SI defining constants.
- class scuq.constants.PhysicalConstant(unit, value)[source]¶
Bases:
QuantityA
Quantityprotected against in-place mutation.Physical constants participate in ordinary SCUQ arithmetic exactly like other quantities. Arithmetic returns ordinary
Quantityobjects, while augmented assignment and direct changes to the stored unit or value raiseTypeError. This protects the module-level objects from accidental process-wide modification.- Parameters:
unit (scuq.units.Unit) – Canonical SI unit of the constant.
value (numbers.Number or scuq.ucomponents.UncertainComponent) – Exact numeric value or uncertainty expression stored by the constant.
- scuq.constants.SPEED_OF_LIGHT = Quantity(m*s^(-1), 299792458.0)¶
Speed of light in vacuum, exactly 299 792 458 m/s in the SI.
- scuq.constants.PLANCK_CONSTANT = Quantity(J*s, 6.62607015e-34)¶
Planck constant, exactly 6.626 070 15e-34 J s in the SI.
- scuq.constants.ELEMENTARY_CHARGE = Quantity(C, 1.602176634e-19)¶
Elementary charge, exactly 1.602 176 634e-19 C in the SI.
- scuq.constants.BOLTZMANN_CONSTANT = Quantity(J*K^(-1), 1.380649e-23)¶
Boltzmann constant, exactly 1.380 649e-23 J/K in the SI.
- scuq.constants.AVOGADRO_CONSTANT = Quantity(mol^(-1), 6.02214076e+23)¶
Avogadro constant, exactly 6.022 140 76e23 1/mol in the SI.
- scuq.constants.FINE_STRUCTURE_CONSTANT = Quantity(1, 0.0072973525643 +/- 1.1e-12)¶
Fine-structure constant with its CODATA 2022 standard uncertainty.
- scuq.constants.VACUUM_MAGNETIC_PERMEABILITY = Quantity(H*m^(-1), 1.2566370612628149e-06 +/- 1.8942496682311442e-16 [NC])¶
Vacuum magnetic permeability derived from
2 * alpha * h / (e**2 * c).
- scuq.constants.VACUUM_ELECTRIC_PERMITTIVITY = Quantity(F*m^(-1), 8.854187818840059e-12 +/- 1.3346767221268747e-21 [NC])¶
Vacuum electric permittivity derived from
1 / (mu_0 * c**2).
- scuq.constants.VACUUM_IMPEDANCE = Quantity(u"Ω", 376.73031340987586 +/- 5.6788176410469925e-08 [NC])¶
Vacuum impedance derived from
mu_0 * c.