JASory / Iridium

Atomic Physics Library
https://rust-cas.org
MIT License
18 stars 5 forks source link

Remove x86_64 dependency #5

Closed Kezii closed 11 months ago

Kezii commented 1 year ago

It'd be great if the hard dependency on x86_64 was removed, and a cross-platform alternative is used instead, to allow the library to be used in other architectures

It's used in these two instances:

https://github.com/JASory/Iridium/blob/413c32a6fb78e47357f9a51a92d6326c23e6f4af/Nuclide/src/nuclidedata/nuclidestruct.rs#L24

https://github.com/JASory/Iridium/blob/413c32a6fb78e47357f9a51a92d6326c23e6f4af/Nuclide/src/nuclidedata/decaymodes.rs#L43

Kezii commented 1 year ago

but also, what is the point of "simulating" the decay? why can't just the percentages be given to the user?

JASory commented 1 year ago

but also, what is the point of "simulating" the decay? why can't just the percentages be given to the user?

One can easily look-up the percentages so merely giving this to the user is not particularly useful. Currently the decay model is fairly simple but it at least gives some approximate energies of decay products. Obviously there are much better models that need to be implemented.

JASory commented 1 year ago

Thank you for the reminder to update the rand function.

JASory commented 11 months ago

Fixed, by resorting to XORSHIFT of the system time for platforms that don't provide RDRAND.

Additionally the branching ratio and decay probabilities can now be directly computed using x.branching_ratio<{DecayMode}>() and x.decay_probability<{DecayMode}>(time_in_seconds).