rascaline icon indicating copy to clipboard operation
rascaline copied to clipboard

Helper functions for species selection/conversion

Open Luthaf opened this issue 1 year ago • 0 comments

It would be nice to provide functions to convert between atomic symbols and atomic number, than can then be used as selection with rascaline. Something like

selection = rascaline.species_selection("species_center", "Au")
selection = rascaline.species_selection("species_center", ["Au", "Li", "S"])
selection = rascaline.species_selection(["species_center", "species_neighbor"], [("Au", "Li"), ("Au", "Au")])
descriptor = calculator.compute(frames, selected_keys=selection)

# or even something like
descriptor.block(species_center=rascaline.species_index("Au")

# since the species assignment can depend on the frames origin
descriptor.block(species_center=rascaline.species_index("Au", origin="ASE")

This would workaround https://github.com/lab-cosmo/equistore/issues/15 and make code a bit more readable.

Luthaf avatar May 30 '23 16:05 Luthaf