Running the relaxation with DFT

From the article of the challenge I see that

Second, the dataset would enable the training of models that take as input rough initial starting positions of the system’s atoms from which the relaxed geometries and energies could be computed.

I know it is very expensive, and out of scope for the challenge itself, but is there an easy way, similar to

python --mode run-relaxations --config-yml configs/s2ef/2M/schnet/schnet.yml \
        --checkpoint checkpoints/[TIMESTAMP]/

(from to actually perform a second relaxation based on DFT?

We currently don’t have such a script available. Part of the reason is we used a commercial software for DFT - VASP. For those with access to VASP, all our settings are publicly available here. We plan on releasing a script to run VASP DFT calculations in the near future.

With the community’s help, we hope to have a Quantum Espresso or other free DFT package implementation as well for people to explore.

1 Like

I’ve been seeing what is needed to carry out a DFT implementation of this. I think that the place where the model is called for the relaxation procedure is this one coming from


On the DFT side, I have sometimes used pyscf a bit, and I have found
and its periodic boundary condition option
Or perhaps just use the pyscf.gradients package: pyscf.grad package — PySCF
The idea would be to embed such calculation in a torch module to compute the gradients and just substitute the computation in the function above?

Also, perhaps I am missing something, but how is the DFT relaxation different from a geometric optimization

Are you referring to inserting the full DFT calculation inside autograd? That isn’t something we’re currently thinking about or plan on releasing. What I was referring to is releasing DFT code snippets to run DFT calculations on the user’s end if they were curious to gain more general intuition about the problem.

PySCF is certainly a plausible alternative that, if a sample code was available (with relatively consistent settings to what we did with VASP) would be useful to the community to experiment with. Other free packages include QE and GPAW. As far as geometric optimization - DFT relaxations are synonymous, no difference.

Well, I was talking about carrying out a DFT relaxation after the GNN relaxation rather than a single-point DFT calculation. I only mentioned autograd because to obtain the forces one has to derive the energy with respect to the atom positions, that’s why. So I guess that you are not doing that no?

Ah I see. As far as DFT is concerned, it returns both energies and forces so wrapping it in autograd isn’t necessary. You can think of DFT as a black box that returns ground truth energy and forces at the theoretical level we have selected.

1 Like

Thanks! I think my error was to think that DFT would only return the energy of the state, not the forces. But that is quite clarifying. Thanks again! I have seen that probably the easiest way to run a second relaxation would be to use, or any of the libraries you mention to perform the optimization afterward. I think they all provide out-of-the-box methods for that, either using DFT or any other method (although post-hartree fock might be too expensive).
But that was clarifying. Thanks!

1 Like