Use this page when a calculation depends on a physical constant, an astronomical conversion scale, or the distinction between a nominal convention and a measured property.
Representation contract¶
| Contract field | Current representation |
|---|---|
| Mathematical object | Scalar physical constants and named conversion scales used as coefficients in scientific relations. |
| Physical convention | CGS unless a symbol explicitly names another unit; CODATA 2018, revised-SI exact values, IAU nominal conversions, and cited photometric conventions are distinguished. |
| Runtime owner | jaxstro.constants owns raw numeric values and their source comments. |
| Shape and unit policy | Public values are scalar Python numbers; units are encoded by symbol names and documentation rather than a runtime Quantity wrapper. |
| Transform boundary | Constants may appear inside jit, vmap, and grad, but they are static coefficients rather than differentiated inputs. |
| Evidence | Source-backed cards in Constants and unit conventions and constant tests check values, derivations, and stored-precision identities. |
| Downstream interpretation boundary | A constant does not select a domain unit system, define code units, or establish that a model using it is scientifically valid. |
Coefficients need conventions¶
A number becomes interpretable only after its unit and authority are known. For example, Newtonian gravity in CGS uses
G_CGS is therefore compatible with masses in grams, lengths in centimeters, and
times in seconds. Substituting a value expressed in another unit system without a
conversion produces a numerically valid array and a physically invalid calculation.
Selected conventions include:
G_CGS,C_CGS,H_CGS,K_B, and related microphysical constants use the recorded CODATA 2018 values or exact revised-SI definitions converted to CGS.RSUN_CM,LSUN_ERG_S, andTEFF_SUNare IAU nominal conversion constants. They are not measurements of a time-varying Sun.MSUN_Gis a rounded compatibility conversion derived from the exact IAU nominal solar mass parameter and Jaxstro’s frozenG_CGS; it is not an exact nominal solar mass defined by the IAU.AB_ZEROPOINT_JYrecords the conventional 3631 Jy AB reference value and cites its photometric source.
See (1) when checking that a kernel’s base units match the constant it consumes.
Raw constants and quantity constants¶
jaxstro.constants remains the backwards-compatible raw-CGS surface. The separate
jaxstro.quantity.constants module wraps selected values in explicit units and
attaches inspectable metadata:
from jaxstro import constants as C
import jaxstro.quantity as q
raw_g = C.G_CGS
typed_g = q.constants.G
source = q.constants.metadata("G")The two surfaces answer different boundary needs. Raw constants keep inner kernels small; quantity constants make dimensional checks explicit at public boundaries.
Shape, transforms, and evidence¶
The values are scalar and broadcast according to ordinary JAX rules when combined with arrays. Gradients flow through variables around a constant, but there is no runtime uncertainty model for the coefficient itself. If a research question treats a constant as uncertain, the caller must represent that uncertain parameter explicitly rather than differentiate with respect to a module-level literal.
The generated source cards identify exact sources, stored values, derivations, code locations, and assertion-bearing tests. They do not prove the scientific adequacy of every downstream equation that imports the constants.