Working with AiiDA¶
verdi command line interface¶
The main way of interacting with AiiDA is through a command line interface tool called
You have already used
verdi when installing AiiDA, either through
verdi quicksetup or
verdi is very versatile and provides a wealth of other functionalities; here is a list:
- calculation: query and interact with calculations
- code: setup and manage codes to be used
- comment: manage general properties of nodes in the database
- completioncommand: return the bash completion function to put in ~/.bashrc
- computer: setup and manage computers to be used
- daemon: manage the AiiDA daemon
- data: setup and manage data specific types
- devel: AiiDA commands for developers
- export: export nodes and group of nodes
- graph: create a graph from a given root node
- group: setup and manage groups
- import: export nodes and group of nodes
- node: manage operations on AiiDA nodes
- profile: list and manage AiiDA profiles
- run: execute an AiiDA script
- runserver: run the AiiDA webserver on localhost
- setup: setup aiida for the current user/create a new profile
- shell: run the interactive shell with the Django environment
- user: list and configure new AiiDA users.
- workflow: manage the AiiDA worflow manager
Each command above can be preceded by the
-p <profile> or
option, as in:
verdi -p <profile> calculation list
This allows one to select a specific AiiDA profile, and therefore a specific database, on which the command is executed. Thus several databases can be handled and accessed simultaneously by AiiDA. To install a new profile, use the install command.
This profile selection has no effect on the
verdi daemon commands.
Some ambiguity might arise when a certain
verdi subcommand manages both positional arguments and at least one option which accepts an unspecified number of arguments. Make sure you insert the separator
-- between the last optional argument and the first positional argument. As an example, instead of typing:
verdi export -g group1 group2 group3 export.aiida
verdi export -g group1 group2 group3 -- export.aiida The previous command will export the nodes belonging to groups ``group1``, ``group2``, and ``group3`` (specified by the option ``-g``) into the file ``export.aiida``, which is taken as a positional argument.
Below is a list with all the available subcommands.
While many common functionalities are provided by either command-line tools
verdi) or the web interface, for fine tuning (or automatization)
it is useful to directly access the python objects and call their methods.
This is possible in two ways, either via an interactive shell, or writing and running a script. Both methods are described below.
AiiDA plug-ins are input generators and output parsers, enabling the integration of codes into AiiDA calculations and workflows.
The plug-ins are not meant to completely automatize the calculation of physical properties. An underlying knowledge of how each code works, which flags it requires, etc. is still required. A total automatization, if desired, has to be implemented at the level of a workflow.
Plugins live in different repositories than AiiDA.
You can find a list of existing plugins on the AiiDA website or on the
aiida-registry (check the JSON version
or the human-readable version), the official location to register
and list plugins.
- The calculation state
- Setting calculation properties
- Retrieving results
- AiiDA data types
- Export data nodes to various formats
As described in the section about calculations,
JobCalculation instances are submitted by the daemon to an external scheduler.
For this functionality to work, AiiDA needs to be able to interact with these schedulers.
Interfaces have been written for some of the most used schedulers.
- Directly querying in Django
- Directly querying in SQLAlchemy
- Using the QueryBuilder