leeping / geomeTRIC

Geometry optimization code that includes the TRIC coordinate system
https://geometric.readthedocs.io/
Other
147 stars 65 forks source link

Optimization of molecular crystals (and other periodic systems) #189

Open annulen opened 6 months ago

annulen commented 6 months ago

I've recently worked with CP2K, and its optimizer is far from being stellar. AFAIU, they use fractional coordinates (XYZ projected onto lattice vectors) which is clearly suboptimal for crystals composed of organic molecules. Observable behavior is that convergence is very slo, e.g more than 200 steps were needed to optimize cell of 80 atoms.

I wonder what kind of changes would be needed to make geomeTRIC work for this case. It seems to me that TRIC coordinates should be an ideal fit for molecular crystal. However it might be needed to take into account that certain groups of atoms on the opposite sides of unit cell are in fact parts of the same molecule dissected by cell borders.

Another thing to consider is optimization of unit cell parameters which should ideally be performed in conjunction with geometry optimization. Distances between separate molecules and cell parameters are interdependent. CP2K uses stress tensor to optimize cell parameters.

leeping commented 5 months ago

Supporting periodic boundary conditions is something I've wanted to do for a long time. I agree the TRIC coordinate system could yield performance improvements for molecular crystals, but we should be able to support general periodic systems.

The Molecule object, which is used to determine the bond lists, currently supports cubic cells. It would need to be extended to support triclinic cells. We would also need to add primitive internal coordinates for changes in the lattice vectors. I currently don't know whether it's better to directly modify the lattice vector components, or the three lengths + three angles. For molecular crystals, I think that the lattice vectors should be coupled to the centers of the molecules in the lattice, so that as the lattice deforms, the molecules move rigidly such that the fractional coordinates of the centers in the cell are the same.

Lastly we need an Engine object to communicate with a periodic code. If you have an example geometry optimization with CP2K, that would be very helpful to get started.