Julia code for asymptotic estimators for quantites of interest in electronic structure. It can be used to reproduce the main results from our paper Practical error bounds for properties in plane-wave electronic structure calculations by Éric Cancès, Geneviève Dusson, Gaspard Kemlin and Antoine Levitt, available on arXiv. In particular, it reproduces the asymptotic error bound on the H^1-norm of the error from Figure 2 (middle) and the asymptotic estimator for the forces from Figures 8, 10 and 11.
This code is used with the refined reference solutions we introduced in the paper. A small example of the estimates for the forces is available here in the DFTK documentation.
Julia 1.7 with the following Julia libraries:
- DFTK.jl v0.5.0 for the simulation environment (this code might not work with more recent versions of DFTK);
- ForwardDiff.jl
for the computation of
dF
with automatic differentiation; - LinearAlgebra, IterativeSolvers, LinearMaps, FFTW for the linear algebra related computations;
- HDF5, CSV, Tables for saving and reading results.
To perform the computations, first open the Julia shell with julia --project
from the location of this repository and then run
using Pkg
Pkg.instantiate()
to install the required dependencies.
Then, you can run all the computations at once and generates data with
include("run_all_computations.jl")
. This will go in every folder case/
where
case
is successively silicon
, GaAs
and TiO2
with the numerical setting
described in our paper. Each folder contains:
- a file
case_forces.jl
which runs the computations with the Schur complement from our paper to improve the estimates on the forces and then saves the results in the fileforces_case.h5
; - a file
generate_data_case_forces.jl
which generates various.csv
files for plots; - different
.tex
files that read the associated.csv
files to generates.pdf
files:error_case
files represent the estimation on the errorΠ(P-P_*)
in the H^1-norm, as in Figure 2 (middle), without the bad error bound;forces_case
files represent the estimation of the errorF-F*
as in Figure 8 (left) and 10;diff_forces_case
files represent the improvement of this estimations, as in Figures 8 (right) and 11.
Note that, after running the computations, only .h5
and .csv
files have been
generated. You need to compile the .pdf
files with the associated .tex
files
and your favorite LaTeX compiler.
As we have chosen a quite precise reference grid, with many coarser grids, we ran all the computations on 32 Intel Xeon E5-2667 (3.30GHz) cores, which takes around half a day on a such a cluster.
This is research code, not necessarily user-friendly, actively maintened or extremely robust. For a first contact with the implementation, looking at the example mentionned above is maybe advised. If you have questions or encounter problems, get in touch!