atomate.vasp.firetasks package

Submodules

atomate.vasp.firetasks.approx_neb_dynamic_tasks module

atomate.vasp.firetasks.approx_neb_tasks module

atomate.vasp.firetasks.electrode_tasks module

atomate.vasp.firetasks.exchange module

atomate.vasp.firetasks.glue_tasks module

This module defines tasks that acts as a glue between other vasp Firetasks to allow communication between different Firetasks and Fireworks. This module also contains tasks that affect the control flow of the workflow, e.g. tasks to check stability or the gap is within a certain range.

class atomate.vasp.firetasks.glue_tasks.CheckBandgap(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Checks the band gap of an entry. If band gap is >min_gap or <max_gap, then the task will return a FWAction that will defuse all remaining tasks.

Required params:

(none) - but you should set either min_gap or max_gap

Optional params:

min_gap: (float) minimum gap energy in eV to proceed max_gap: (float) maximum gap energy in eV to proceed vasprun_path: (str) path to vasprun.xml file

optional_params = ['min_gap', 'max_gap', 'vasprun_path']
required_params = []
run_task(fw_spec)

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Args:
fw_spec (dict): A Firework spec. This comes from the master spec.

In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class atomate.vasp.firetasks.glue_tasks.CheckStability(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Checks the stability of the entry against the Materials Project database. If the stability is less than the cutoff (default is 0.1 eV/atom), then the task will return a FWAction that will defuse all remaining tasks.

Required params:

(none) - but your MAPI key must be set as an environ var in this case

Optional params:
ehull_cutoff: (float) energy in eV/atom to use as ehull cutoff. Default

is 0.05 eV/atom.

MAPI_KEY: (str) set MAPI key directly. Supports env_chk. calc_dir: (str) string to path containing vasprun.xml (default currdir)

optional_params = ['ehull_cutoff', 'MAPI_KEY', 'calc_dir']
required_params = []
run_task(fw_spec)

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Args:
fw_spec (dict): A Firework spec. This comes from the master spec.

In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class atomate.vasp.firetasks.glue_tasks.CopyVaspOutputs(*args, **kwargs)

Bases: atomate.common.firetasks.glue_tasks.CopyFiles

Copy files from a previous VASP run directory to the current directory. By default, copies ‘INCAR’, ‘POSCAR’ (default: via ‘CONTCAR’), ‘KPOINTS’, ‘POTCAR’, ‘OUTCAR’, and ‘vasprun.xml’. Additional files, e.g. ‘CHGCAR’, can also be specified. Automatically handles files that have a “.gz” extension (copies and unzips).

Note that you must specify either “calc_loc” or “calc_dir” to indicate the directory containing the previous VASP run.

Required params:

(none) - but you must specify either “calc_loc” OR “calc_dir”

Optional params:
calc_loc (str OR bool): if True will set most recent calc_loc. If str

search for the most recent calc_loc with the matching name

calc_dir (str): path to dir that contains VASP output files. filesystem (str): remote filesystem. e.g. username@host additional_files ([str]): additional files to copy,

e.g. [“CHGCAR”, “WAVECAR”]. Use $ALL if you just want to copy everything

contcar_to_poscar (bool): If True (default), will move CONTCAR to

POSCAR (original POSCAR is not copied).

potcar_spec (bool): Instead of copying the POTCAR, copy the

“POTCAR.spec”. This is intended to allow testing of workflows without requiring pseudo-potentials to be installed on the system. Default: False

copy_files()

Defines the copy operation. Override this to customize copying.

optional_params = ['calc_loc', 'calc_dir', 'filesystem', 'additional_files', 'contcar_to_poscar', 'potcar_spec']
run_task(fw_spec)

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Args:
fw_spec (dict): A Firework spec. This comes from the master spec.

In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

class atomate.vasp.firetasks.glue_tasks.GetInterpolatedPOSCAR(*args, **kwargs)

Bases: fireworks.core.firework.FiretaskBase

Grabs CONTCARS from two previous calculations to create interpolated structure.

The code gets the CONTCAR locations using get_calc_loc of two calculations indicated by the start and end params, creates a folder named “interpolate” in the current FireWork directory, and copies the two CONTCARs to this folder. The two CONTCARs are then used to create nimages interpolated structures using pymatgen.core.structure.Structure.interpolate. Finally, the structure indicated by this_image is written as a POSCAR file.

Required params:

start (str): name of fw for start of interpolation. end (str): name of fw for end of interpolation. this_image (int): which interpolation this is. nimages (int) : number of interpolations.

Optional params:
autosort_tol (float): parameter used by Structure.interpolate.

a distance tolerance in angstrom in which to automatically sort end_structure to match to the closest points in this particular structure. Default is 0.0.

interpolate_poscar(fw_spec)
optional_params = ['autosort_tol']
required_params = ['start', 'end', 'this_image', 'nimages']
run_task(fw_spec)

This method gets called when the Firetask is run. It can take in a Firework spec, perform some task using that data, and then return an output in the form of a FWAction.

Args:
fw_spec (dict): A Firework spec. This comes from the master spec.

In addition, this spec contains a special “_fw_env” key that contains the env settings of the FWorker calling this method. This provides for abstracting out certain commands or settings. For example, “foo” may be named “foo1” in resource 1 and “foo2” in resource 2. The FWorker env can specify { “foo”: “foo1”}, which maps an abstract variable “foo” to the relevant “foo1” or “foo2”. You can then write a task that uses fw_spec[“_fw_env”][“foo”] that will work across all these multiple resources.

Returns:

(FWAction)

atomate.vasp.firetasks.glue_tasks.pass_vasp_result(pass_dict=None, calc_dir='.', filename='vasprun.xml.gz', parse_eigen=False, parse_dos=False, **kwargs)

Function that gets a PassResult firework corresponding to output from a Vasprun. Covers most use cases in which user needs to pass results from a vasp run to child FWs (e. g. analysis FWs)

pass_vasp_result(pass_dict={‘stress’: “>>ionic_steps.-1.stress”})

Args:
pass_dict (dict): dictionary designating keys and values to pass

to child fireworks. If value is a string beginning with ‘>>’, the firework will search the parsed VASP output dictionary for the designated property by following the sequence of keys separated with periods, e. g. “>>ionic_steps.-1.stress” is used to designate the stress from the last ionic_step. If the value is not a string or does not begin with “>>” or “a>>” (for an object attribute, rather than nested key of .as_dict() conversion), it is passed as is. Defaults to pass the computed entry of the Vasprun.

calc_dir (str): path to dir that contains VASP output files, defaults

to ‘.’, e. g. current directory

filename (str): filename for vasp xml file to parse, defaults to

“vasprun.xml.gz”

parse_eigen (bool): flag on whether or not to parse eigenvalues,

defaults to false

parse_eigen (bool): flag on whether or not to parse dos,

defaults to false

**kwargs (keyword args): other keyword arguments passed to PassResult

e.g. mod_spec_key or mod_spec_cmd

atomate.vasp.firetasks.lobster_tasks module

atomate.vasp.firetasks.neb_tasks module

atomate.vasp.firetasks.parse_outputs module

atomate.vasp.firetasks.run_calc module

atomate.vasp.firetasks.write_inputs module

Module contents