libvdwxc is a library which provides fast and scalable implementations of non-local van der Waals density functionals in the vdW-DF family. To use libvdwxc, you need to install it and compile GPAW with it. libvdwxc can be used with other semilocal functionals like optPBE, optB88, and BEEF-vdW.
Install libvdwxc, making sure that its dependencies FFTW3 and FFTW3-MPI are available on the system. For truly large systems, you may install PFFT to achieve better scalability, but FFTW3-MPI may well be more efficient except for very large systems.
Currently there is no stable libvdwxc release yet. Clone the project from git and install manually.
Run a calculation as follows:
from ase.build import molecule from gpaw import GPAW from gpaw.xc.libvdwxc import vdw_df_cx atoms = molecule('H2O') atoms.center(vacuum=3.0) calc = GPAW(xc=vdw_df_cx()) atoms.set_calculator(calc) atoms.get_potential_energy()
libvdwxc will automatically parallelize with as many cores as are
available for domain decomposition. If you parallelize over k-points
or bands, and especially if you use planewave mode, be sure to pass
the parallelization keyword
augment_grids=True to make use of all
cores including those for k-point and band parallelization.
Here is a more complex example:
from ase.build import bulk from gpaw import GPAW, PW from gpaw.xc.libvdwxc import vdw_df_cx # "Large" system: atoms = bulk('Cu').repeat((2, 2, 2)) calc = GPAW(mode=PW(600), kpts=(4, 4, 4), xc=vdw_df_cx(mode='pfft', pfft_grid=(2, 2)), parallel=dict(kpt=4, augment_grids=True)) atoms.set_calculator(calc) atoms.get_potential_energy()
Normally you should probably not bother to set pfft_grid as it is chosen automatically.