Handling isotopes

Is there a pymatgen-ic way of handling isotopes in structure representations? The current implementation of the periodic table validates only standard element symbols (Ac, Ag, Al, Am, Ar, At, Au, …) and not numeric (1H, 2H, 3H, …) or alphabetic (H, D, T) alternates.

I haven’t explored to find if anything breaks by setting compositions to non-standard element symbols, but there are any number of things calculated from isotopes and isotope-sensitive pair-quantities. Is there any plan to support these explicitly in Specie / Composition type objects?

Hi @Peter_Metz,

Not currently. There are two options one could use, you could use DummySpecie which can hold basically an arbitrary label, or you can ‘mis-use’ Specie and borrow oxidation state to distinguish between isotopes.

I think a more robust handling of this is a great idea. The cleanest place to do it would be to add a new attribute on Specie, e.g. neutron number here: https://github.com/materialsproject/pymatgen/blob/03550ecc31dcf880bee3fe1c0c0901b49dedff3c/pymatgen/core/periodic_table.py#L1044



Custom parsing for Specie strings with leading digits and/or the special cases of D/T could then be handled cleanly.