Common Dissociation Curve Workflow#

The Dissociation Curve (DC) workflow is designed to compute dissociation curves for diatomic molecules. It automatically runs single-point calculations at several distances of the two atoms composing the molecule. The inputs for the single-point calculations can be defined in a code-agnostic way, making use of the common interface of the common relax workflow. The only available option for the relax_type is none, which corresponds to single-point calculations. To allow full flexibility on the inputs, code-dependent overrides can be specified through the input port sub_process (see below).

Submission script template#

A typical script for the submission of common DC workflow could look something like the following:

from aiida.orm import List, Dict
from aiida.engine import submit
from aiida_common_workflows.plugins import WorkflowFactory

cls = WorkflowFactory('common_workflows.dissociation_curve')

inputs = {
    'molecule': molecule,
    'distances': List(list=[0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1]),  # Atomic distance in Ångstrom
    'generator_inputs': {  # code-agnostic inputs for the single-point calculations
        'engines': engines,
        'protocol': protocol,
        'spin_type': spin_type,
        ...
    },
    'sub_process_class': 'common_workflows.relax.<implementation>',
    'sub_process' : {  # optional code-dependent overrides
        'parameters': Dict(dict={...})
        ...
    },
}

submit(cls, **inputs)

The inputs of the DC workchain are detailed below.

Inputs#

  • molecule. (Type: an AiiDA StructureData instance, the common data format to specify crystal structures and molecules in AiiDA). Only diatomic molecules are accepted. The periodic boundary conditions should be set to [False,False,False], however, since some code plugins do not manage aperiodic structures, the simulation box should also be large enough to avoid interaction among replicas. The positions of the atoms will be ignored since the workflow forces the distance between the atoms and sets the molecule to be symmetric with respect to the origin of the system.

  • distances. (Type: a list of Python float or int values, wrapped in the AiiDA List data type). List of distances (in Ångstrom) between the two atoms for which total energy should be computed. This input is optional since the “distances” can be set in an alternative way (see next input).

  • distances_count, distance_max, and distance_min. (Type: an AiiDA Int, Float, and Float respectively, the data format devoted to the specification of integers and floats in AiiDA). These three inputs can be used together to set the distances for the DC. The distances_count indicates the number of points to compute for the DC and the distance_min/distance_max define the range for the distances. If the distances port is specified, these three inputs are ignored. The default for distances_count is Int(20), for distance_min is Float(0.5), for distance_min is Float(3).

  • sub_process_class. (Type: valid workflow entry point for one common relax implementation). The quantum engine that will be used for the relaxation is determined through the sub_process_class input, that must be a valid workflow entry point for a common relax implementation. Referring to the submission template above, the <implementation> in the string 'common_workflows.relax.<implementation>' should be replaced with the corresponding entry point name of a quantum engine, for instance common_workflows.relax.quantum_espresso. To see a list of all available entry points, call verdi plugin list aiida.workflows. Any entry point that starts with common_workflows.relax. can be used.

  • generator_inputs. (Type: a Python dictionary). This input name-space is dedicated to the specifications of the common relax inputs. A full list of the allowed inputs are described in the dedicated section. Only the structure input is not allowed in the generator_inputs, since it is selected by the workflow. Also, the only relax_type accepted is none.

  • sub_process. (Type: a Python dictionary). This input namespace hosts code-dependent inputs that can be used to override inputs that are automatically generated by the input generator based on the generator_inputs. The specified keys must be valid input ports of the corresponding sub_process_class workflow.

Note

The single-point calculations at the various distances are not all performed in parallel. The energy at the first distance listed in distances is calculated first. Then all the other calculations are run in parallel using the first calculation as reference_workchain input. This ensures that the energies computed for the various single-point calculations can be compared in a meaningful sense.

Outputs#

The DC workchain simply returns for each point of the dissociation curve a distance (in Ångstrom, as AiiDA Float under the namespace distances) and an energy (in eV, as AiiDA Float and under the namespace total_energies). If returned by the underline common relax workflow, also the total magnetization for each point of the dissociation curve is returned (in μB, as Float and under the namespace total_magnetizations).

A template script to retrieve the results follows:

from aiida.common import LinkType

node = load_node(<IDN>) # <IDN> is an identifier (PK, uuid, ..) of a completed DC workchain

outputs = node.base.links.get_outgoing(link_type=LinkType.RETURN).nested()

distances = []
energies = []
magnetizations = []

for index in outputs['total_energies'].keys():
    distances.append(outputs['distances'][index].value)
    energies.append(outputs['total_energies'][index].value)
    try:
        total_magnetization = outputs['total_magnetizations'][index].value
    except KeyError:
        total_magnetization = None
    magnetizations.append(total_magnetization)

CLI#

The use of the CLI for the submission of a common workflow is reported in the main page of this documentation. For the DC workflow:

acwf launch dissociation-curve <OPTIONS> -- <ENGINE>

The available <ENGINE> and <OPTIONS> are the same of the relaxation CLI, with the exception of the -P and -r option.