In this tutorial, we will guide you through setting up a development environment for running DFTK calculations using AiiDA. The tutorial is divided into two main sections:
- Julia Side: Creating a Julia project and installing AiidaDFTK.
- Python Side: Setting up aiida-core, installing the aiida-DFTK plugin, defining an AiiDA computer, code, and managing pseudopotentials.
In this tutorial we will call the computer where you want to run the DFTK
calculations jed
.
On jed
first install Julia.
For this download the Julia binaries
and follow the installation instructions.
In this tutorial we will assume Julia is available under the path path/to/julia
.
- Launch a Julia REPL: E.g. by executing
path/to/julia
. - Activate a New Environment: In the Julia REPL,
create a new environment (essentially a new Julia project)
using the following commands:
Replace
import Pkg Pkg.activate("path/to/new/environment")
path/to/new/environment
with the directory where you wish to create the new environment. This will generate a folder containingProject.toml
andManifest.toml
files. - Install AiidaDFTK: While still in the Julia REPL,
initialize the project by adding packages you'll need.
For this tutorial we will only need
AiidaDFTK
.import Pkg Pkg.add("AiidaDFTK")
- Optional configuration: See the details in the DFTK documentation
on running DFTK on clusters
on how
to set up a
LocalPreferences.toml
file. This file allows to specify a cluster-specific configuration for libraries such as BLAS, LAPACK, FFT etc. This is optional, but can improve performance.
The new Julia project is now ready and includes AiidaDFTK
and its dependency DFTK
.
You can now proceed with DFTK calculations in this isolated environment.
Follow the official aiida-core setup tutorial.
Make sure you have a working aiida-core
installation.
Install the aiida-dftk plugin repository from github and install it locally:
pip install git+https://github.com/aiidaplugins/aiida-dftk.git
For a detailed guide on defining a new computer in AiiDA,
consult the official AiiDA tutorial.
In this tutorial we will assume the new computer is available under
the name jed
.
DFTK, when run through AiidaDFTK, should be registered as a code in the AiiDA database. This can be done using:
verdi code create core.code.installed \
--label DFTK \
--description "Julia DFTK" \
--computer jed \
--filepath-executable "path/to/julia" \
--prepend-text 'export JULIA_PROJECT="path/to/new/environment"' \
--default-calc-job-plugin dftk \
--append-text '' \
--no-use-double-quotes
The first two flags are description, the third specifies the computer from Step 3,
the fourth and fifth the path to the Julia executable from Part 1
as well as the setup (prepended commands), which needs to be done
to select the correct project folder with AiidaDFTK
from Part 1.
In this case this consists simply of exporting the environment variable,
which tells Julia, which project folder to use. In some setup additional steps
might be needed here, such as loading modules, which provide Julia or
one of the vendor-specific libraries configured in Part 1, Step 4.
The last three flags select dftk
as the default input plugin and specify
to use the default values for append_text
and use_double_quotes
.
DFTK supports both HGH and UPF pseudopotentials. For realistic calculations, UPF format is recommended. We suggest using pseudo-dojo, which can be installed using the aiida-pseudo plugin. Follow this detailed tutorial for more information. Here's how to install pseudo-dojo 0.5 PBE pseudopotentials with scalar relativistic effects in UPF format:
aiida-pseudo install pseudo-dojo -v 0.5 -x PBE -r SR -f upf
Congratulations! You've successfully set up your development environment for AiidaDFTK and are ready to proceed with your calculations.