You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear developers,
When trying to convert physics constants into atomic units, I get the wrong behaviour:
julia>using Unitful, UnitfulAtomic
julia>using PhysicsConstants.CODATA2018: m_u
julia> m_u
Atomic mass constant (m_u)
Value =1.6605390666e-27 kg
Standard uncertainty =5.0e-37 kg
Relative standard uncertainty =3.0e-10
Reference = CODATA 2018
julia>aunit(m_u)
mₑ
julia>uconvert(u"kg", 1.0*aunit(m_u))
9.1093837015e-31 kg
Which is indeed wrong, as m_u should be 1.6605390666e-27 kg, as specified by physics constants. Is this a bug of UnitfulAtomic?
The text was updated successfully, but these errors were encountered:
Yes, m_u should be (and is in fact) equal to 1.6605390666e-27 kg. But aunit(m_u) is not the same thing as m_u.
julia>aunit(m_u)
mₑ
Maybe it is difficult to see, but the result has a subscript e (not u), referring to the electron rest mass. In Hartree atomic units, the unit of mass is the electron rest mass, not the atomic mass constant.
So the result is correct: aunit(m_u) returns the electron rest mass (UnitfulAtomics.me_au, printed as mₑ), which is equal to 9.1093837015e-31 kg.
Hi, thanks for the explanation. I was confusing auconvert(m_u) with aunit(m_u).
Indeed, aunit returns only the unit type, which is the electron mass, while auconvert does what I was expecting (converting into atomic units).
Dear developers,
When trying to convert physics constants into atomic units, I get the wrong behaviour:
Which is indeed wrong, as m_u should be 1.6605390666e-27 kg, as specified by physics constants. Is this a bug of UnitfulAtomic?
The text was updated successfully, but these errors were encountered: