If I have a CIF that is P1, is there a (preferably free) code that can map the structure to some user-specified space group? I know that there are ways to do similar things with molecular systems. For instance, ChemCraft has an option to detect the nearest point group and then apply it to the molecule. I'd like to do the same for a crystalline structure given a space group.
While there are undoubtedly other programs that do this, it's fairly easy to do in Avogadro.
- I start with a calculation on hexagonal SiC. As mentioned, it starts as $P_1$:
- Go to Crystallography -> Space Group -> Perceive Space Group
- The unit cell should update, including symmetrization if needed
ASE has an advantage that you can enforce symmetry during an optimization of cell size / positions. Here is an example that can be run with GPAW which will load a geometry (
POSCAR) and optimize the cell size and shape while keeping the original symmetry.
from ase.io import read from ase.optimize.bfgs import BFGS from ase.constraints import UnitCellFilter from ase.spacegroup.symmetrize import FixSymmetry from gpaw import GPAW, PW atoms = read("POSCAR") atoms.set_constraint(FixSymmetry(atoms)) si.calc = GPAW(xc='PBE', mode=PW(400, dedecut='estimate'), kpts=(4, 4, 4), txt='stress.txt') uf = UnitCellFilter(si) relax = BFGS(uf) relax.run(fmax=0.05)
The full trajectory will be contained in
stress.txt. Other calculators that ASE supports can be used by simply changing the GPAW based lines to another calculator. It will need to implement a stress tensor though, so this restricts use somewhat. For example, GPAW does not support stress tensor calculations in FD or LCAO modes currently.