Constants are accessed by passing the name or alias of a physical constant as a string to the constant
function. This function returns a GummyConstant
instance that can be used like a gummy
in calculations:
from metrolopy import constant
constant('G')
The constant definitions include correlations. So, for example, even though relative atomic masses are not in the constant library, dividing the mass of a particle by the atomic mass constant gives the particle mass in atomic units with the correct uncertainty.
The constants below are mostly based on the 2018 CODATA recommended values. See the .description
attribute of each constant for source information.
Most constants with exact values are stored as integers or the ratio of integers. However constants such as ℏ are exact in theory, but since the numerical value of π cannot be relized exactly on a computer, they may be listed with an uncertainty below.
To get a listing of all built-in constants use the search_constants
function with no argument:
from metrolopy import search_constants
search_constants()