InfluenceFunctional / MXtalTools

BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Implement a method to save properly formatted .cifs #69

Open InfluenceFunctional opened 1 year ago

InfluenceFunctional commented 1 year ago

CCDC io method doesn't seem to work for making new crystals? Or it's at least unclear. Other methods don't properly account for symmetries.

InfluenceFunctional commented 1 year ago

Saving a single unit cell with Ase as below works well enough for Mercury to pack it, but the file format doesn't contain the correct symmetry information

print(f"Saving SG={sg_ind} structures")
cell_structures = [ase_mol_from_crystaldata(unit_cells, highlight_canonical_conformer=False,
                                            index=i, exclusion_level='none', inclusion_distance=4, return_crystal=False)
                   for i in range(supercells.num_graphs)]

for i in range(min(10, len(cell_structures))):
    ase.io.write(f'space_group_{sg_ind}_unit_cell_{i}.cif', cell_structures[i])
InfluenceFunctional commented 1 month ago

Perhaps we need to manually write the cif - tedious but not that hard? Asymmetric unit + symmetry information.