DFTK.jl
DFTK.jl copied to clipboard
Reduce computation time for energy calculation
Hello,
I am currently writing a function that calculates the total energy for an arbitrary number of gallium atoms in a cluster. The system is isolated (kgrid = [1,1,1]). However, for a 12 atom system, the timing of the computation of the self_consistent_field function averages to around 3 seconds. Here is the code so far. If you have any ideas on how to reduce the computation time of the energy calculation function that would be really helpful. Thank you for your time.
Will take a look. Do you expect less by comparison to other codes and if yes by how much? On a Gamma point only calculation we should be about a factor of 2 slower (because we don't optimize for real wavefunctions) but not much more.
There's nothing that stands out particularly. You can play with the mixing types to get a bit faster SCF convergence but there's no glaring issue.
A large time is spent on the XC computation, if you're running things with lots of vacuum you can possibly gain a bit by using a threshold, @mfherbst did something related to that at some point I believe
Alright, I'll try out all of these suggestions. Thanks a lot for your help!
For reference on the point Antoine mentioned, you can reduce the cutoff for the points where XC quantities are computed using
model_DFT(lattice, atoms, positions, Xc(functionals; potential_threshold=tol); kwargs...)
where functionals is your functional list (e.g. [:lda_x, lda_c_pw]) and tol is the tolerance, try values around 1e-10, but check on the errors you make.
Also I'm closing this for now as this is a usage discussion. Feel free to reopen @EfremCarnate if you want more advice.