Update constants to CODATA 2022 Values #590
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After the yt workshop in Edinburgh I looked this issue in yt which stems from yt sometimes using its internal, and old, units, and sometimes unyt.
In doing so I discovered that a couple of unyt's constants could be updated to the CODATA 2022 values. I am getting confused by the conversion between SI and CGS units for electromagnetism, and so would appreciate someone else's eyes to tell me if Im missing something.
The issue stems from the fact that the SI had a shift in how they define/measure units, including the permeability of free space,$\mu_0$ . It used to be defined as exactly $4\pi \times 10^7~\mathrm{NA}^{-2}$ . Now it has to be measured as $1.25663706127(20)\times10^{-6}~\mathrm{NA}^{-2}$ . This new value is within an error bar of the old one, and they differ at the 10th decimal place. This is useful because it means you can get away with just not changing it.
When we update this value of$\mu_0$ it raises an error in testing our conversion between SI (metre, kilogram, second, coulomb) and CGS (centimetre, gram, second, statcoulomb) units. Specifically converting the B-field from tesla to gauss. To convert B field you introduce factors of $\sqrt{\frac{4\pi}{\mu_0}}$ . This is how you get the equation of energy density used to test the conversion:
However, this doesn't happen when we convert from tesla to gauss. And it is only sometimes mentioned (for example not on the Gauss (unit) wikipedia page, but is on the Gaussian units but in a way that is unclear to me if it part of the definition of the units. What I do know is that the ratio of$\mu_0$ to $4\pi\times10^{-7}~\mathrm{NA}^{-2}$ .
u_mkstou_cgswhen you convert them between unit systems is the same as the ratio of