Function for obtaining Wyckoff sites of a structure
Description
This MR introduces the function add_wyckoff_sites
in the icet.tools.geometry
module.
The function allows one to obtain the Wyckoff sites of a structure.
The function also works for supercells and includes the correct multiplicity factor.
It adds an array to the structure that contains the Wyckoff site labels.
This functionality is particularly useful for setting up SOFObservers as demonstrated by the snippet below, which will be included in the tutorial on observers.
The present MR is hence a contribution toward completing #338.
structure = ... # some Atoms object
add_wyckoff_sites(structure)
sites = {}
for k, site in enumerate(structure.get_array('wyckoff_sites')):
sites[site] = sites.get(site, []) + [k]
sof = SiteOccupancyObserver(ce.get_cluster_space_copy(), sites, structure, interval=len(structure))
mc.attach_observer(sof)
This MR furthermore includes
- a unit test for
add_wyckoff_sites
- an extension of existing tests of geometry module to improve test quality and coverage
- a slight rearrangement to module reference in user guide such that the existing functions are included in the documentation
After revision
The snippet above now can be run as follows:
structure = ... # some Atoms object
sites = {}
for k, site in enumerate(get_wyckoff_sites(structure)):
sites[site] = sites.get(site, []) + [k]
sof = SiteOccupancyObserver(ce.get_cluster_space_copy(), sites, structure, interval=len(structure))
mc.attach_observer(sof)
Edited by Paul Erhart