Handling of fractional/mixed occupancies in CIF Files
This one directly relates to #263 (closed)
The idea is to properly read structures with mixed occupancies from CIF files, and to be able to process them with ASE. For that I added a fractional_occupancies
flag to read_cif
(defaulting to False
for legacy behaviour). If True
the latter creates an atoms object with an additional array occupancy
. Only problem I see so far from a DAU perspective is that for mixed occupancies atoms may sit on identical positions (but should be weighted with the occupancies). However, this cannot happen for default settings, and if one wants to deal with mixed occupancies I guess this is a good as we it can get with the current infrastructure.
In order to deal with mixed occupancies, I had to also tweak the spacegroup
module a bit. The only notably change from the outside is the equivalent_sites
now returns an additional array occs
for occupations. But this function is only called once in the entire ASE package...
Marked this one as WIP:
Since I'd love to add some tests. Problem here: I just have cif files from the ICSD with mixed occupancies and do not want to put them in the repo due to copy right. Any suggestions?
Moreover, I plan to also include the occupancy feature in the CASTEP calculator -- which can deal with it in the virtual crystal approximation. As it comes to the combinatorics of supercells we should not start to re-invent the wheel... there is the excellent supercell code which we may interface to at some point. Lastly, on the long run I plan to include some feature in the gui that indicates fractional occupancies similar to what vesta does.
Grateful for any comments!