# Physical constants in Python

You can find a large collection of physical constants in scipy.constants. The most frequently used constants are available directly, and hundreds more are in a dictionary physical_constants.

The fine structure constant α is defined as a function of other physical constants:

The following code shows that the fine structure constant and the other constants that go into it are available in scipy.constants.

    import scipy.constants as sc

a = sc.elementary_charge**2
b = 4 * sc.pi * sc.epsilon_0 * sc.hbar * sc.c
assert( abs(a/b - sc.fine_structure) < 1e-12 )

## Eddington’s constant

In the 1930’s Arthur Eddington believed that the number of protons in the observable universe was exactly the Eddington number

Since at the time the fine structure constant was thought to be 1/136, this made the number of protons a nice even 136 × 2256.  Later he revised his number when it looked like the fine structure constant was 1/137. According to the Python code above, the current estimate is more like 1/137.036.

Eddington was a very accomplished scientist, though he had some ideas that seem odd today. His number is a not a bad estimate, though nobody believes it could be exact.

## Related posts

The constants in scipy.constants have come up in a couple previous blog posts.

The post on Koide’s coincidence shows how to use the physical_constants dictionary, which includes not just the physical constant values but also their units and uncertainty.

The post on Benford’s law shows that the leading digits of the constants in scipy.constants follow the logarithmic distribution observed by Frank Benford (and earlier by Simon Newcomb).

## 4 thoughts on “Physical constants in Python”

1. Anders Gustafsson

Hi John,

I think a small typo has made its way into your text. I believe the Eddington constant represents the number of PROTONS in observable universe. See e.g. here: https://en.wikipedia.org/wiki/Eddington_number

Best regards,

2. Thanks. I knew it was proton, but I wrote photon. Twice even! :)

3. Nathan Hannon

Am I missing something? The number of protons in the observable universe cannot be expected to be constant; first, because the scope of what is observable changes over time and depends on the observer, and second, because the total number of protons is changing (because of nuclear fusion and beta decay, for example). How can anyone with any knowledge of physics believe that it has a precise mathematical value?

4. I imagine Eddington’s claim was more plausible in the 1930s than it would be now. I don’t know how much about nuclear physics was known by anybody, and especially how much was so widely known that Eddington should have been aware of it.