Get started#

Requirements#

To work with aiida-quantumespresso, you should have:

  • installed aiida-core

  • configured an AiiDA profile.

Please refer to the documentation of aiida-core for detailed instructions.

Installation#

The Python package can be installed from the Python Package index PyPI or directly from the source:

The recommended method of installation is to use the Python package manager pip:

$ pip install aiida-quantumespresso

This will install the latest stable version that was released to PyPI.

To install the package from source, first clone the repository and then install using pip:

$ git clone https://github.com/aiidateam/aiida-quantumespresso
$ pip install -e aiida-quantumespresso

The -e flag will install the package in editable mode, meaning that changes to the source code will be automatically picked up.

Configuration#

To enable tab-completion for the command line interface, execute the following shell command (depending on the shell):

$ eval "$(_AIIDA_QUANTUMESPRESSO_COMPLETE=bash_source aiida-quantumespresso)"
$ eval "$(_AIIDA_QUANTUMESPRESSO_COMPLETE=zsh_source aiida-quantumespresso)"
$ eval (env _AIIDA_QUANTUMESPRESSO_COMPLETE=fish_source aiida-quantumespresso)

Place this command in your shell or virtual environment activation script to automatically enable tab completion when opening a new shell or activating an environment. This file is shell specific, but likely one of the following:

  • the startup file of your shell (.bashrc, .zsh, …), if aiida is installed system-wide

  • the activators of your virtual environment

  • a startup file for your conda environment

Important

After having added the line to the start up script, make sure to restart the terminal or source the script for the changes to take effect.

Setup#

Computer#

To run Quantum ESPRESSO calculations on a compute resource, the computer should first be set up in AiiDA. This can be done from the command line interface (CLI) or the Python application programming interface (API). In this example, we will set up the localhost, the computer where AiiDA itself is running:

To set up a computer, use the verdi CLI of aiida-core.

$ verdi computer setup -n -L localhost -H localhost -T core.local -S core.direct -w ~/aiida_work_dir

After creating the localhost computer, configure the core.local transport using:

$ verdi computer configure core.local localhost -n --safe-interval 0

Verify that the computer was properly setup by running:

$ verdi computer test localhost

To setup a computer using the Python API, run the following code in a Python script with verdi run or in the verdi shell:

from aiida.orm import Computer
from pathlib import Path

computer = Computer(
    label='localhost',
    hostname='localhost',
    transport_type='core.local',
    scheduler_type='core.direct',
    workdir=Path('~/aiida_work_dir').resolve()
).store()
computer.configure()

For more detailed information, please refer to the documentation on setting up compute resources.

Code#

To run a Quantum ESPRESSO code, it should first be setup in AiiDA. This can be done from the command line interface (CLI) or the Python application programming interface (API). In this example, we will setup the pw.x code that is installed on the computer where AiiDA is running:

To setup a particular Quantum ESPRESSO code, use the verdi CLI of aiida-core.

$ verdi code create core.code.installed -n --computer localhost --label pw --default-calc-job-plugin quantumespresso.pw --filepath-executable pw.x

To setup particular Quantum ESPRESSO code using the Python API, run the following code in a Python script with verdi run or in the verdi shell:

from aiida.orm import InstalledCode

computer = load_computer('localhost')
code = InstalledCode(
label='pw',
computer=computer,
filepath_executable='pw.x',
default_calc_job_plugin='quantumespresso.pw',
).store()

Important

Using the commands above, you will set up a code that uses the first pw.x binary your PATH. You can find out the absolute path to this binary using the which command:

which pw.x

If this is not the Quantum ESPRESSO version you want to run, pass the correct absolute path as the filepath executable.

For more detailed information, please refer to the documentation on setting up codes.

Pseudo potentials#

Many Quantum ESPRESSO codes require pseudo potentials. The simplest way of installing these is through the aiida-pseudo plugin package. This should come as a dependency of aiida-quantumespresso and should already be installed. If this is not the case, it can be installed using:

$ pip install aiida-pseudo

At a minimum, at least one pseudo potential family should be installed. We recommend using the [SSSP] v1.3 with the PBEsol functional:

$ aiida-pseudo install sssp -v 1.3 -x PBEsol

For more detailed information on installing other pseudo potential families, please refer to the documentation of [aiida-pseudo].