Bundled workflows#

This section we give some brief introduction to the bundled workflows in AiiDA-VASP.

Convergence workchain#

The VaspConvergenceWorkChain is a simple workflow that runs a series of VASP calculations with different parameters and checks if the results converge. The convergence of cut off energy and kpoints are currently implemented.

As metioned above, the inputs to the VaspWorkChain should be placed into the vasp namespace. The convergence settings are specified using the convergence_settings input which is a Dict containing the following keys:

print(WorkflowFactory('vasp.v2.relax').option_class.aiida_description())

See this tutorial for an example of how to run the VaspConvergenceWorkChain.

Relaxation workchain#

The VaspWorkChain is a simple workflow that runs a VASP relaxation calculation. It will run VASP geometry optimizations until the specified convergence criteria are met.

This may involve one or more actual VASP calculations. This is because:

  • A single VASP calculation may not fully relax the structure, especially when the maximum number of ionic steps is set to a relatively small value.

  • For variable cell geometry optimization, multiple VASP calculations are required as each restart resets the basis set, otherwise the effective cut off energy can change.

  • A final singlepoint calculation may be needed to ensure that the energy is consistent with the cut off, if the lattice has been changed.

The inputs to the VaspWorkChain should be placed into the vasp namespace. The convergence settings are specified using the relax_settings input which is a Dict containing the following keys:

from aiida.plugins import WorkflowFactory
print(WorkflowFactory('vasp.v2.relax').option_class.aiida_description())
                             algo:  str        
                                    Default: The algorithm to use for relaxation
                    energy_cutoff:  Optional   
                                    Default: The cut off energy difference when the relaxation is stopped (e.g. EDIFF)
                     force_cutoff:  float      
                                    Default: The maximum force when the relaxation is stopped (e.g. EDIFFG)
                            steps:  int        
                                    Default: Number of relaxation steps to perform (eg. NSW)
                        positions:  bool       
                                    Default: If True, perform relaxation of the atomic positions
                            shape:  bool       
                                    Default: If True, perform relaxation of the cell shape
                           volume:  bool       
                                    Default: If True, perform relaxation of the cell volume
                   convergence_on:  bool       
                                    Default: If True, perform convergence checks within the workchain
             convergence_absolute:  bool       
                                    Default: If True, use absolute values where possible when performing convergence checks
       convergence_max_iterations:  int        
                                    Default: Maximum iterations for convergence checking
            convergence_positions:  float      
                                    Default: The cutoff value for the convergence check on positions in Angstram. A negative value by pass the check.
               convergence_volume:  float      
                                    Default: The cutoff value for the convergence check on volume between the two structures. A negative value by pass the check.
        convergence_shape_lengths:  float      
                                    Default: The cutoff value for the convergence check on the lengths of the unit cell vectors, between input and the outputs structure. A negative value by pass the check.
         convergence_shape_angles:  float      
                                    Default: The cutoff value for the convergence check on the angles of the unit cell vectors, between input and the outputs structure. A negative value by pass the check.
                 convergence_mode:  str        
                                    Default: Mode of the convergence check for positions. 'inout' for checking input/output structure, or 'last' to check only the change of the last step.
                            reuse:  bool       
                                    Default: Whether reuse the previous calculation by copying over the remote folder
                      clean_reuse:  bool       
                                    Default: Whether to perform a final cleaning of the reused calculations
                  keep_sp_workdir:  bool       
                                    Default: Whether to keep the workdir of the final singlepoint calculation
                          perform:  bool       
                                    Default: Do not perform any relaxation if set to 'False'
            hybrid_calc_bootstrap:  bool       
                                    Default: Whether to bootstrap hybrid calculation by performing standard DFT first
  hybrid_calc_bootstrap_wallclock:  int        
                                    Default: Wall time limit in second for the bootstrap calculation
               keep_magnetization:  bool       
                                    Default: Whether to keep magnetization from the previous calculation if possible

Note the keys such as algo, steps, force_cutoff are translated into INCAR tags (IBRION, NSW, EDIFFG, etc.), so one should not explicitly set these tags in the parameters input.

Hint

This means one can quickly reuse the parameters from a single point calculation for a relaxation and vice versa.

See this tutorial for an example of how to run the VaspWorkChain.

Band structure workflow#

The VaspBandsWorkChain is a workflow for calculating the band structure of a material using VASP. A band structure typically involves computing the ground state electron density then using this fixed density to solve for the eigenvalues of the Kohn-Sham equation at specific k-points in the Brillouin zone.

Typically, a path along which the eigenvalues are computed is generated based on the point group symmetry of the input structure. There are approaches to generate this path automatically,here we default to using seekpath, but it can be switched to using the paths generated by sumo.

Another complication is that the path generated is for a specific primitive-cell configuration (as there are infinite ways of choosing the primitive cell). Hence, a common mistake is to blindly using the path of the input cell, which may not be the standardized primitive cell. Here, the workchain handles this internally, and the generated standardized primitive cell is returned by the workchain as one of the outputs.

In addition, an exposed relax namespace for running VaspWorkChain exists and the workchain will perform geometry optimization before the band structure calculation if it is specified.

The parameters for the scf (for generating the charge density) the actual band structure structure calculation should be specified under the exposed VaspWorkChain namespace called scf and bands. An additional dos namespace is also exposed for calculating the density of states and can be specified if desired.

Note

The scf namespace should always be specified, while specifying bands namespace is only needed if the input nodes should be different from that in the scf namespace. The same rule applies to the dos namespace.

Similar to the VaspWorkChain the behavor of the VaspBandsWorkChain can be controlled using the band_settings input:

from aiida.plugins import WorkflowFactory
print(WorkflowFactory('vasp.v2.bands').option_class.aiida_description())
                              symprec:  float      
                                        Default: Precision of the symmetry determination
                            band_mode:  str        
                                        Default: Mode for generating the band path. Choose from: bradcrack, pymatgen,seekpath-aiida and latimer-munro.
                band_kpoints_distance:  float      
                                        Default: Spacing for band distances for automatic kpoints generation, used by seekpath-aiida mode.
                         line_density:  float      
                                        Default: Density of the point along the path, used by the sumo interface.
                 dos_kpoints_distance:  float      
                                        Default: Kpoints for running DOS calculations in A^-1 * 2pi. Will perform non-SCF DOS calculation is supplied.
                             only_dos:  bool       
                                        Default: Flag for running only DOS calculations
                              run_dos:  bool       
                                        Default: Flag for running DOS calculations
  additional_band_analysis_parameters:  dict       
                                        Default: Additional keyword arguments for the seekpath/ interface, available keys are:  ['with_time_reversal', 'reference_distance', 'recipe', 'threshold', 'symprec', 'angle_tolerance']
                    kpoints_per_split:  int        
                                        Default: Number of kpoints per split for the band structure calculation
                 hybrid_reuse_wavecar:  bool       
                                        Default: Whether to reuse the WAVECAR from the previous relax/singlepoint calculation

The is an variant of the VaspBandsWorkChain for running band structure calculation with hybrid functional. In this case, the potential is not completely determined from the electron density, hence one cannot use the standard approach that first compute the ground state electron density and then use it to solve the Kohn-Sham equation. Instead, the Kohn-Sham equation has to be solved self-consistently, and the k-points along the path are inserted as zero-weighted k-points.

The VaspHybridBandsWorkChain is designed for this purpose. In addition, the large compute cost of hybrid functional means it may be advantageous to split the full k-point path into smaller sub-paths, and run multiple self-consistent calculations in parallel instead of doing a single large calculation, given the constraints of the available computing resources. The number of kpoints included in each sub-path can be specified using the kpoints_per_subpath input.

Hint

Set kpoints_per_subpath to a very large number to run a single self-consistent calculation with all k-points.

See this tutorial for an example of how to run the VaspBandsWorkChain.