PeriodicTable.jl icon indicating copy to clipboard operation
PeriodicTable.jl copied to clipboard

Adding Isotopes

Open 8me opened this issue 3 years ago • 5 comments

I found in the PeriodicTable.jl thread on discourse that there was already the idea to add the individual isotopes to the elements. Has this idea been followed up at some point?

8me avatar May 19 '21 14:05 8me

I am also interested in have isotope info.

gustavojra avatar Jul 30 '21 05:07 gustavojra

I am interested in isotope info as well. In addition to that, I would like to add nuclear spin and gyromagnetic ratio (depends on the particular isotope).

I understand that adding such information requires careful thinking, but it is precisely the reason the response from maintainers is much needed. So, guys, what are your thoughts about this? Are there any plans to develop this package further or do you just want to leave it like this?

Gregstrq avatar Aug 07 '21 16:08 Gregstrq

IMO, isotopes and their properties could be added. The main author has also indicated that he is positive about it in the linked discourse thread. As always, the best way to drive things forward is to make a contribution. I'll happily review a PR.

carstenbauer avatar Aug 07 '21 16:08 carstenbauer

As always, the best way to drive things forward is to make a contribution

No doubt in that. At the same time, I would like to discuss the possible implementations before making a PR.

Presently, Periodic Table contains isotope average data. If we want to add isotopes, it should be separate Elements. Then, isotope-specific information (abundance, spin, gyromagnetic ratio) does not make sense for isotope-averaged data. As a result, a separate Element type is needed to actually store isotope data. Are you ok with that?

On a side note, did you ever consider transforming the PeriodicTable into a DataFrame?

Gregstrq avatar Aug 07 '21 17:08 Gregstrq

Maybe the easier way to keep it organize is to create a Isotope struct like

struct Isotope
    massNumber
    mass
    abundance
    spin
    gyromagneticRatio
    ...
end

then we can add a field to atoms isotopes which can be a vector of Isotope objects or perhaps a named tuple mapping the mass number to the corresponding object. Retrieving info would look like

elements[:C].isotopes[14]

Alternatively we can create a separate structure from elements. In that case retrieving info would also require the atom I guess, since mass number isn't unique (right?)

isotopes[:C, 14]

gustavojra avatar Aug 07 '21 17:08 gustavojra