-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support natural units (hbar = c = 1) #112
Comments
Thank you for the feedback! I see two ways how this could be implemented
To be honest, I'm not particularly fond of either of those options. Especially since it is already possible to do similar calculations with a minimal overhead:
What do you think? (did you set |
@robinro Closing this as there is no further feedback and I don't see a huge benefit. |
I have the same request, so I'm writing to a closed issue. Note that there are different sets of natural units. The one OP seems to be after, and me as well, are Hartree atomic units. I think that the task of adding full support for these can be split in two parts:
@sharkdp What do you think? |
Thank you for the feedback!
Definitely sounds like a sensible feature request. It's not quite clear to me how we would deal with the conflict between unit names and constants. For example: we already have Or do we want to somehow support a special conversion "to constants", which would basically just divide by that quantity and make sure that the result is a scalar. For example:
could be executed as: "make sure that both sides of the arrow have matching units (otherwise, print an error). Then, print the result of
Interesting idea. This is related to #184 which looks for a way to say: convert this quantity to base SI units. Conversion to some natural system of units would involve one additional step where Insect would basically divide by an appropriate product like |
In a way, there is no semantic difference between a unit name and a constant. A physical unit is a constant. In atomic units,
This would make perfect sense, and given what I wrote above, it's actually equivalent to #184. Expressing something in the base SI units is in fact just dividing the results by the "SI constants" (m, kg, s) and making sure the results is a scalar. |
Seconding what @jhrmnn said! A physical constant is a unit, so Insect should be able to convert to, as well as from, units like the speed of light, the elementary charge, and Planck's constant.
Since the Kelvin has officially been redefined as a unit of energy, Insect should also be able to convert between Kelvin and other units of energy.
|
In the follow-up project for Insect, a lot of this is now possible. Users can define their own physical units (and dimensions). We also support some unit systems like Planck units, Stoney units ( Issue sharkdp/numbat#116 has some more details and open points. In any case, I would be glad to get some feedback on Numbat. Having the possibility for users to define their own units was one of the main reasons that I completely rewrote Insect from scratch. |
In relativistic physics it's common to set hbar = c = 1. This relates meter to second and Joule to second.
Similarly k_b = 1.
I'd like to see support for this together with an explicit warning about the use of natural units.
Results could then be
1 ns -> m = 0.299792 m (assuming c=1)
1 fm-> 1/GeV = 0.806554 GeV⁻¹ (assuming hbar=c=1)
The text was updated successfully, but these errors were encountered: