Installation

In case you don't have a working Julia installation yet, first download the Julia binaries and follow the Julia installation instructions. At least Julia 1.10 is required for DFTK.

Afterwards you can install DFTK like any other package in Julia. For example run in your Julia REPL terminal:

import Pkg
Pkg.add("DFTK")

which will install the latest DFTK release. DFTK is continuously tested on Debian, Ubuntu, mac OS and Windows and should work on these operating systems out of the box. With this you are all set to run the code in the Tutorial or the examples directory.

For obtaining a good user experience as well as peak performance some optional steps see the next sections on Recommended packages and Selecting the employed linear algebra and FFT backend. See also the details on Using DFTK on compute clusters if you are not installing DFTK on a laptop or workstation.

DFTK version compatibility

We follow the usual semantic versioning conventions of Julia. Therefore all DFTK versions with the same minor (e.g. all 0.6.x) should be API compatible, while different minors (e.g. 0.7.y) might have breaking changes. These will also be announced in the release notes.

While not strictly required to use DFTK it is usually convenient for computational workflows (setting up initial structures, transferring data to ML training, etc.) to install a few standard packages from the AtomsBase. Examples are

  • AtomsIO and AtomsIOPython, which allow you to read (and write) a large range of standard file formats for atomistic structures. In particular AtomsIO is lightweight and highly recommended.
  • AtomsBuilder, which provides a few convenience functions for setting up initial structures, see AtomsBase integration for more details.

You can install these packages using

import Pkg
Pkg.add(["AtomsIO", "AtomsIOPython", "AtomsBuilder"])
Python dependencies in Julia

There are two main packages to use Python dependencies from Julia, namely PythonCall and PyCall. These packages can be used side by side, but some care is needed. By installing AtomsIOPython and ASEconvert you indirectly install PythonCall which these two packages use to manage their third-party Python dependencies. This might cause complications if you plan on using PyCall-based packages (such as PyPlot) In contrast AtomsIO is free of any Python dependencies and can be safely installed in any case.

Optional: Selecting the employed linear algebra and FFT backend

The default Julia setup uses the BLAS, LAPACK, MPI and FFT libraries shipped as part of the Julia package ecosystem. The default setup works, but to obtain peak performance for your hardware additional steps may be necessary, e.g. to employ the vendor-specific BLAS or FFT libraries. See the documentation of the MKL, FFTW, MPI and libblastrampoline packages for details on switching the underlying backend library. If you want to obtain a summary of the backend libraries currently employed by DFTK run the DFTK.versioninfo() command. See also Using DFTK on compute clusters, where some of this is explained in more details.

Installation for DFTK development

If you want to contribute to DFTK, see the Developer setup for some additional recommendations on how to setup Julia and DFTK.