librasteve / raku-Physics-Unit

Some physical Units (SI, metric and more...)
Artistic License 2.0
1 stars 0 forks source link

add Hartrees as unit def'n #11

Closed librasteve closed 3 years ago

librasteve commented 3 years ago

from @kjpye

  1. Some of the constants have a value expressed in Hartrees (part of the Hartree atomic units system). A reasonable response is probably to just ignore those constants. Especially considering the usual symbol for the unit is U_h with a subscript h which is rather difficult to type, although the alternative Ha is given which might be made to work.
librasteve commented 3 years ago

wikipedia info is very useful on this - https://en.wikipedia.org/wiki/Hartree_atomic_units

some thoughts:

a proposal:

librasteve commented 3 years ago

a raku snippet that

constant \hartree-energy = %( name => 'Hartree energy', value => 4.3597447222071e-18, uncertainty => 0.0000000000085e-18, units => 'J' ); my \c-he := hartree-energy;

my $He-unit; { use Physics::Unit;

$He-unit = Unit.new( defn => "{c-he<value> ~ ' ' ~ c-he<units>}", names => <Eₕ E_h Ha> );

dd $He-unit;

} { use Physics::Measure;

my $He-mea = Energy.new(value => 1, units => $He-unit );

say $He-mea;             #1Eₕ
say $He-mea.in('J');     #4.3597447222071e-18J

}

librasteve commented 3 years ago

closing for now (added to https://github.com/p6steve/raku-Physics-Unit/issues/12 instead )