Automate elastic_constants by AD-DFPT as a postprocessing#1172
Automate elastic_constants by AD-DFPT as a postprocessing#1172
elastic_constants by AD-DFPT as a postprocessing#1172Conversation
|
Something that bothers me as well is that it's basically impossible to send any kind of parameters to the DFPT solver in your implementation. There is the |
|
Also in
The displacement |
Agreed. I now added the more general solution to pass arbitrary
Makese sense. I added tol_symmetry as keyword argument and displace by |
| if hasproperty(scfres, :mixing) | ||
| dict["mixing"] = string(scfres.mixing) | ||
| end | ||
| for sym in (:is_converged, :nbandsalg, :fermialg, :diagtolalg, :solver, :eigensolver) | ||
| if hasproperty(scfres, sym) | ||
| dict[string(sym)] = string(getproperty(scfres, sym)) | ||
| end | ||
| end |
There was a problem hiding this comment.
This is code duplication and I'm not sure if the strings you get out of solver and eigensolver are very useful. E.g. eigensolver could just be a large bunch of numbers (which could blow up the size of the json). Have you checked that ?
There was a problem hiding this comment.
It seems to work fine for the function arguments, it just prints the name. On examples/silicon.jl it looks like this:
julia> dict = Dict()
Dict{Any, Any}()
julia> for sym in (:is_converged, :nbandsalg, :fermialg, :diagtolalg, :solver, :eigensolver)
if hasproperty(scfres, sym)
dict[string(sym)] = string(getproperty(scfres, sym))
end
end
julia> dict
Dict{Any, Any} with 6 entries:
"nbandsalg" => "AdaptiveBands(4, 7, 1.0e-6, 0.01)"
"eigensolver" => "lobpcg_hyper"
"is_converged" => "ScfConvergenceDensity(1.0e-8)"
"diagtolalg" => "AdaptiveDiagtol(0.2, nothing, 0.005, 0.03)"
"solver" => "anderson"
"fermialg" => "FermiTwoStage()"
Following up on the ideas at #1162.
This PR aims to automate the clamped-ion elastic constants as a convenient postprocessing function
elastic_constants(scfres)for 1) the generic case of not using symmetry (most expensive, 6xDFPT on a fully unfolded kgrid...), 2.1) the most common case of cubic crystals (least expensive, 1xDFPT on a partially unfolded kgrid). Optimizations for other the point groups could be implemented later following a similar pattern.progress: