atomate.vasp.workflows.base package

Submodules

atomate.vasp.workflows.base.adsorption module

class atomate.vasp.workflows.base.adsorption.MPSurfaceSet(structure, bulk=False, auto_dipole=None, **kwargs)

Bases: pymatgen.io.vasp.sets.MVLSlabSet

Input class for MP slab calcs, mostly to change parameters and defaults slightly

__init__(structure, bulk=False, auto_dipole=None, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

incar

Incar object

atomate.vasp.workflows.base.adsorption.get_slab_fw(slab, transmuter=False, db_file=None, vasp_input_set=None, parents=None, vasp_cmd='vasp', name='', add_slab_metadata=True)

Function to generate a a slab firework. Returns a TransmuterFW if bulk_structure is specified, constructing the necessary transformations from the slab and slab generator parameters, or an OptimizeFW if only a slab is specified.

Args:
slab (Slab or Structure): structure or slab corresponding
to the slab to be calculated
transmuter (bool): whether or not to use a TransmuterFW based
on slab params, if this option is selected, input slab must be a Slab object (as opposed to Structure)
vasp_input_set (VaspInputSet): vasp_input_set corresponding to
the slab calculation

parents (Fireworks or list of ints): parent FWs db_file (string): path to database file vasp_cmd (string): vasp command name (string): name of firework add_slab_metadata (bool): whether to add slab metadata to task doc

Returns:
Firework corresponding to slab calculation
atomate.vasp.workflows.base.adsorption.get_slab_trans_params(slab)

Gets a set of slab transformation params

Args:
slab (Slab): slab to find transformation params from
Returns (SlabTransformation):
Transformation for a transformation that will transform the oriented unit cell to the slab
atomate.vasp.workflows.base.adsorption.get_wf_molecules(molecules, vasp_input_set=None, db_file=None, vasp_cmd='vasp', name='')
Args:
molecules (Molecules): list of molecules to calculate vasp_input_set (DictSet): VaspInputSet for molecules db_file (string): database file path vasp_cmd (string): VASP command name (string): name for workflow
Returns:
workflow consisting of molecule calculations
atomate.vasp.workflows.base.adsorption.get_wf_slab(slab, include_bulk_opt=False, adsorbates=None, ads_structures_params=None, vasp_cmd='vasp', db_file=None, add_molecules_in_box=False)

Gets a workflow corresponding to a slab calculation along with optional adsorbate calcs and precursor oriented unit cell optimization

Args:

slabs (list of Slabs or Structures): slabs to calculate include_bulk_opt (bool): whether to include bulk optimization,

this flag sets the slab fireworks to be TransmuterFWs based on bulk optimization of oriented unit cells

adsorbates ([Molecule]): list of molecules to place as adsorbates ads_structures_params (dict): parameters to be supplied as

kwargs to AdsorbateSiteFinder.generate_adsorption_structures
add_molecules_in_box (boolean): flag to add calculation of
adsorbate molecule energies to the workflow

db_file (string): path to database file vasp_cmd (string): vasp command

Returns:
Workflow
atomate.vasp.workflows.base.adsorption.get_wfs_all_slabs(bulk_structure, include_bulk_opt=False, adsorbates=None, max_index=1, slab_gen_params=None, ads_structures_params=None, vasp_cmd='vasp', db_file=None, add_molecules_in_box=False)

Convenience constructor that allows a user to construct a workflow that finds all adsorption configurations (or slabs) for a given max miller index.

Args:

bulk_structure (Structure): bulk structure from which to construct slabs include_bulk_opt (bool): whether to include bulk optimization

of oriented unit cells

adsorbates ([Molecule]): adsorbates to place on surfaces max_index (int): max miller index slab_gen_params (dict): dictionary of kwargs for generate_all_slabs ads_structures_params (dict): dictionary of kwargs for generating

of adsorption structures via AdsorptionSiteFinder

vasp_cmd (str): vasp command db_file (str): location of db file add_molecules_in_box (bool): whether to add molecules in a box

for the entire workflow
Returns:
list of slab-specific Workflows

atomate.vasp.workflows.base.bulk_modulus module

atomate.vasp.workflows.base.bulk_modulus.get_wf_bulk_modulus(structure, deformations, vasp_input_set=None, vasp_cmd='vasp', db_file=None, user_kpoints_settings=None, eos='vinet', tag=None, user_incar_settings=None)

Returns the workflow that computes the bulk modulus by fitting to the given equation of state.

Args:

structure (Structure): input structure. deformations (list): list of deformation matrices(list of lists). vasp_input_set (VaspInputSet): for the static deformation calculations vasp_cmd (str): vasp command to run. db_file (str): path to the db file. user_kpoints_settings (dict): example: {“grid_density”: 7000} eos (str): equation of state used for fitting the energies and the volumes.

supported equation of states: “quadratic”, “murnaghan”, “birch”, “birch_murnaghan”, “pourier_tarantola”, “vinet”, “deltafactor”. See pymatgen.analysis.eos.py
tag (str): something unique to identify the tasks in this workflow. If None a random uuid
will be assigned.

user_incar_settings (dict):

Returns:
Workflow

atomate.vasp.workflows.base.core module

atomate.vasp.workflows.base.core.get_wf(structure, wf_filename, params=None, common_params=None, vis=None, wf_metadata=None)

Get a workflow given a structure and a name of file from the workflow library.

Possible options for wf_filename are listed in: atomate.vasp.workflows.base.library and include band structure, dielectric constant, NEB, and more.

You can also override some of the parameters via the function arguments.

Args:

structure: (Structure) structure to run wf_filename: filename in library subdir, e.g. “band_structure.yaml” params: (list of dicts) set params for each Firework; format is list

that is same length as # of fws in the workflow

common_params: (dict) set common params vis: (VaspInputSet) A VaspInputSet to use for the first FW wf_metadata: (dict) workflow metadata

Returns:
A Workflow

atomate.vasp.workflows.base.deformations module

atomate.vasp.workflows.base.deformations.get_wf_deformations(structure, deformations, name='deformation', vasp_input_set=None, vasp_cmd='vasp', db_file=None, tag='', copy_vasp_outputs=True, metadata=None)

Returns a structure deformation workflow.

Firework 1 : structural relaxation Firework 2 - len(deformations): Deform the optimized structure and run static calculations.

Args:

structure (Structure): input structure to be optimized and run deformations (list of 3x3 array-likes): list of deformations name (str): some appropriate name for the transmuter fireworks. vasp_input_set (DictVaspInputSet): vasp input set for static deformed structure calculation. vasp_cmd (str): command to run db_file (str): path to file containing the database credentials. tag (str): some unique string that will be appended to the names of the fireworks so that

the data from those tagged fireworks can be queried later during the analysis.
copy_vasp_outputs (bool): whether or not copy the outputs from the previous calc(usually
structure optimization) before the transmuter fireworks.

metadata (dict): meta data

Returns:
Workflow

atomate.vasp.workflows.base.elastic module

atomate.vasp.workflows.base.elastic.get_default_strain_states(order=2)

Generates a list of “strain-states”

atomate.vasp.workflows.base.elastic.get_wf_elastic_constant(structure, strain_states=None, stencils=None, db_file=None, conventional=False, order=2, vasp_input_set=None, analysis=True, sym_reduce=False, tag='elastic', copy_vasp_outputs=False, **kwargs)

Returns a workflow to calculate elastic constants.

Firework 1 : write vasp input set for structural relaxation,
run vasp, pass run location, database insertion.

Firework 2 - number of total deformations: Static runs on the deformed structures

last Firework : Analyze Stress/Strain data and fit the elastic tensor

Args:

structure (Structure): input structure to be optimized and run. strain_states (list of Voigt-notation strains): list of ratios of nonzero elements

of Voigt-notation strain, e. g. [(1, 0, 0, 0, 0, 0), (0, 1, 0, 0, 0, 0), etc.].
stencils (list of floats, or list of list of floats): values of strain to multiply
by for each strain state, i. e. stencil for the perturbation along the strain state direction, e. g. [-0.01, -0.005, 0.005, 0.01]. If a list of lists, stencils must correspond to each strain state provided.

db_file (str): path to file containing the database credentials. conventional (bool): flag to convert input structure to conventional structure,

defaults to False.
order (int): order of the tensor expansion to be determined. Defaults to 2 and
currently supports up to 3.
vasp_input_set (VaspInputSet): vasp input set to be used. Defaults to static
set with ionic relaxation parameters set. Take care if replacing this, default ensures that ionic relaxation is done and that stress is calculated for each vasp run.
analysis (bool): flag to indicate whether analysis task should be added
and stresses and strains passed to that task

sym_reduce (bool): Whether or not to apply symmetry reductions tag (str): copy_vasp_outputs (bool): whether or not to copy previous vasp outputs. kwargs (keyword arguments): additional kwargs to be passed to get_wf_deformations

Returns:
Workflow

atomate.vasp.workflows.base.ferroelectric module

atomate.vasp.workflows.base.ferroelectric.get_wf_ferroelectric(polar_structure, nonpolar_structure, vasp_cmd='vasp', db_file=None, vasp_input_set_polar='MPStaticSet', vasp_input_set_nonpolar='MPStaticSet', relax=False, vasp_relax_input_set_polar=None, vasp_relax_input_set_nonpolar=None, nimages=9, hse=False, add_analysis_task=False, wfid=None, tags=None)

Returns a workflow to calculate the spontaneous polarization of polar_structure using a nonpolar reference phase structure and linear interpolations between the polar and nonpolar structure.

The nonpolar and polar structures must be in the same space group setting and atoms ordered such that a linear interpolation can be performed to create intermediate structures along the distortion.

For example, to calculate the polarization of orthorhombic BaTiO3 (space group 38) using the cubic structure (space group 221) as the nonpolar reference phase, we must transform the cubic to the orthorhombic setting. This can be accomplished using Bilbao Crystallographic Server’s Structure Relations tool. (http://www.cryst.ehu.es/cryst/rel.html)

Args:

polar_structure (Structure): polar structure of candidate ferroelectric nonpolar_structure (Structure): nonpolar reference structure in polar setting vasp_input_set_polar (DictVaspInputSet): VASP polar input set. Defaults to MPStaticSet. vasp_input_set_nonpolar (DictVaspInputSet): VASP nonpolar input set. Defaults to MPStaticSet. vasp_relax_input_set_polar (DictVaspInputSet): VASP polar input set. Defaults to MPRelaxSet. vasp_relax_input_set_nonpolar (DictVaspInputSet): VASP nonpolar input set. Defaults to MPRelaxSet. vasp_cmd (str): command to run db_file (str): path to file containing the database credentials. nimages: Number of interpolations calculated from polar to nonpolar structures, including the nonpolar.

For example, nimages = 9 will calculate 8 interpolated structures. 8 interpolations + nonpolar = 9.

add_analysis_task: Analyze polarization and energy trends as part of workflow. Default False. wfid (string): Unique worfklow id starting with “wfid_”. If None this is atomatically generated (recommended). tags (list of strings): Additional tags to add such as identifiers for structures.

Returns:

atomate.vasp.workflows.base.gibbs module

atomate.vasp.workflows.base.gibbs.get_wf_gibbs_free_energy(structure, deformations, vasp_input_set=None, vasp_cmd='vasp', db_file=None, user_kpoints_settings=None, t_step=10, t_min=0, t_max=1000, mesh=(20, 20, 20), eos='vinet', qha_type='debye_model', pressure=0.0, poisson=0.25, anharmonic_contribution=False, metadata=None, tag=None)

Returns quasi-harmonic gibbs free energy workflow. Note: phonopy package is required for the final analysis step if qha_type=”phonopy”

Args:

structure (Structure): input structure. deformations (list): list of deformation matrices(list of lists). vasp_input_set (VaspInputSet) vasp_cmd (str): vasp command to run. db_file (str): path to the db file. user_kpoints_settings (dict): example: {“grid_density”: 7000} t_step (float): temperature step (in K) t_min (float): min temperature (in K) t_max (float): max temperature (in K) mesh (list/tuple): reciprocal space density eos (str): equation of state used for fitting the energies and the volumes.

options supported by phonopy: “vinet”, “murnaghan”, “birch_murnaghan”. Note: pymatgen supports more options than phonopy. see pymatgen.analysis.eos.py
qha_type(str): quasi-harmonic approximation type: “debye_model” or “phonopy”,
default is “debye_model”

pressure (float): in GPa poisson (float): poisson ratio anharmonic_contribution (bool): consider anharmonic contributions to

Gibbs energy from the Debye model. Defaults to False.

metadata (dict): meta data tag (str): something unique to identify the tasks in this workflow. If None a random uuid

will be assigned.
Returns:
Workflow

atomate.vasp.workflows.base.magnetism module

class atomate.vasp.workflows.base.magnetism.MagneticOrderingsWF(structure, default_magmoms=None, strategies=('ferromagnetic', 'antiferromagnetic'), automatic=True, truncate_by_symmetry=True, transformation_kwargs=None)

Bases: object

__init__(structure, default_magmoms=None, strategies=('ferromagnetic', 'antiferromagnetic'), automatic=True, truncate_by_symmetry=True, transformation_kwargs=None)

This workflow will try several different collinear magnetic orderings for a given input structure, and output a summary to a dedicated database collection, magnetic_orderings, in the supplied db_file.

If the input structure has magnetic moments defined, it is possible to use these as a hint as to which elements are magnetic, otherwise magnetic elements will be guessed (this can be changed using default_magmoms kwarg).

A brief description on how this workflow works:
  1. We make a note of the input structure, and then sanitize it (make it ferromagnetic, primitive)
  2. We gather information on which sites are likely magnetic, how many unique magnetic sites there are (whether one species is in several unique environments, e.g. tetrahedral/octahedra as Fe in a spinel)
  3. We generate ordered magnetic structures, first antiferromagnetic, and then, if appropriate, ferrimagnetic_Cr2NiO4 structures either by species or by environment – this makes use of some new additions to MagOrderingTransformation to allow the spins of different species to be coupled together (e.g. all one species spin up, all other species spin down, with an overall order parameter of 0.5)
  4. For each ordered structure, we perform a relaxation and static calculation. Then an aggregation is performed which finds which ordering is the ground state (of those attempted in this specific workflow). For high-throughput studies, a dedicated builder is recommended.
  5. For book-keeping, a record is kept of whether the input structure is enumerated by the algorithm or not. This is useful when supplying the workflow with a magnetic structure obtained by experiment, to measure the performance of the workflow.
Args:
structure: input structure default_magmoms: (optional, defaults provided) dict of

magnetic elements to their initial magnetic moments in µB, generally these are chosen to be high-spin since they can relax to a low-spin configuration during a DFT electronic configuration

strategies: different ordering strategies to use, choose from:

ferromagnetic, antiferromagnetic, antiferromagnetic_by_motif, ferrimagnetic_by_motif and ferrimagnetic_by_species (here, “motif”, means to use a different ordering parameter for symmetry inequivalent sites)

automatic: if True, will automatically choose sensible strategies truncate_by_symmetry: if True, will remove very unsymmetrical
orderings that are likely physically implausible
transformation_kwargs: keyword arguments to pass to

MagOrderingTransformation, to change automatic cell size limits, etc.

get_wf(scan=False, perform_bader=True, num_orderings_hard_limit=16, c=None)

Retrieve the FireWorks workflow.

Args:
scan: if True, use the SCAN functional instead of GGA+U, since

the SCAN functional has shown to have improved performance for magnetic systems in some cases

perform_bader: if True, make sure the “bader” binary is in your

path, will use Bader analysis to calculate atom-projected magnetic moments

num_orderings_hard_limit: will make sure total number of magnetic

orderings does not exceed this number even if there are extra orderings of equivalent symmetry

c: additional config dict (as used elsewhere in atomate)

Returns: FireWorks Workflow

atomate.vasp.workflows.base.magnetism.get_wf_magnetic_deformation(structure, c=None, vis=None)

Minimal workflow to obtain magnetic deformation proxy, as defined by Bocarsly et al. 2017, doi: 10.1021/acs.chemmater.6b04729

Args:
structure: input structure, must be structure with magnetic

elements, such that pymatgen will initalize ferromagnetic input by default – see MPRelaxSet.yaml for list of default elements

c: Workflow config dict, in the same format
as in presets/core.py and elsewhere in atomate
vis: A VaspInputSet to use for the first FW

Returns: Workflow

atomate.vasp.workflows.base.neb module

This module defines the Nudged Elastic Band (NEB) workflow.

atomate.vasp.workflows.base.neb.get_wf_neb_from_endpoints(parent, endpoints, user_incar_settings=None, additional_spec=None, user_kpoints_settings=None, additional_cust_args=None)

Get a CI-NEB workflow from given endpoints. Workflow: (Endpoints relax – ) NEB_1 – NEB_2 - … - NEB_r

endpoints not optimized: ep–neb(r) endpoints are optimized: neb(r)
Args:

parent (Structure): parent structure. endpoints (list[Structure]): The endpoint structures. user_incar_settings([dict]): Additional user_incar_settings. Note that the order of the

list is set as: “parent”, “ep_relax”, “neb1”, “neb2” etc., which contains at least three elements. The first dict is for parent structure relaxation, the second dict is for endpoints relaxation, and the rest are for NEB calculations. For example, [{}, {}, {“IOPT”: 7}, {“IOPT”: 1}]. Besides, user_incar_settings is used to determine how many NEB rounds will be. Default is [{}, {}, {}].

additional_spec (dict): User spec settings to overwrite default_spec. user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at at

least three elements, which is similar to user_incar_settings. For example, [{}, {}, {“grid_density”: 100}] for the workflow from the parent structure relaxation, then the endpoint relaxation followed by one-round NEB simulation. Default values depend on the selected VaspInputSet.
additional_cust_args ([dict]): Optional parameters for RunVaspCustodian, same structure
with user_incar_settings and user_kpoints_settings.
Returns:
Workflow
atomate.vasp.workflows.base.neb.get_wf_neb_from_images(parent, images, user_incar_settings, additional_spec=None, user_kpoints_settings=None, additional_cust_args=None)

Get a CI-NEB workflow from given images. Workflow: NEB_1 – NEB_2 - … - NEB_n

Args:

parent (Structure): parent structure. images ([Structure]): All images and two endpoints. user_incar_settings([dict]): Additional user_incar_settings. Note that the order of the

list is set as: “parent”, “ep_relax”, “neb1”, “neb2” etc., which contains at least three elements. The first dict is for parent structure relaxation, the second dict is for endpoints relaxation, and the rest are for NEB calculations. For example, [{}, {}, {“IOPT”: 7}, {“IOPT”: 1}]. Besides, user_incar_settings is used to determine how many NEB rounds will be. Default is [{}, {}, {}].

additional_spec (dict): User spec settings to overwrite default_spec. user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at at

least three elements, which is similar to user_incar_settings. For example, [{}, {}, {“grid_density”: 100}] for the workflow from the parent structure relaxation, then the endpoint relaxation followed by one-round NEB simulation. Default values depend on the selected VaspInputSet.
additional_cust_args ([dict]): Optional parameters for RunVaspCustodian, same structure
with user_incar_settings and user_kpoints_settings.
Returns:
Workflow
atomate.vasp.workflows.base.neb.get_wf_neb_from_structure(structure, user_incar_settings=None, additional_spec=None, user_kpoints_settings=None, additional_cust_args=None)

Obtain the CI-NEB workflow staring with a parent structure. This works only under the single vacancy diffusion mechanism.

Workflow: (parent relaxation) –> Endpoints relaxation –> NEB_1 –> NEB_2 –> … –> NEB_r
  1. If parent is not relaxed: then parent relaxation–ep–neb(r)
    (r rounds of NEB)
  2. If parent is relaxed: ep–neb(r) (r rounds of NEB)
Args:

structure (Structure): The parent structure. user_incar_settings([dict]): Additional user_incar_settings. Note that the order of the

list is set as: “parent”, “ep_relax”, “neb1”, “neb2” etc., which contains at least three elements. The first dict is for parent structure relaxation, the second dict is for endpoints relaxation, and the rest are for NEB calculations. For example, [{}, {}, {“IOPT”: 7}, {“IOPT”: 1}]. Besides, user_incar_settings is used to determine how many NEB rounds will be. Default is [{}, {}, {}].

additional_spec (dict): User spec settings to overwrite default_spec. user_kpoints_settings ([dict]): Additional user_kpoints_settings, which contains at at

least three elements, which is similar to user_incar_settings. For example, [{}, {}, {“grid_density”: 100}] for the workflow from the parent structure relaxation, then the endpoint relaxation followed by one-round NEB simulation. Default values depend on the selected VaspInputSet.
additional_cust_args ([dict]): Optional parameters for RunVaspCustodian, same structure
with user_incar_settings and user_kpoints_settings.
Returns:
Workflow

atomate.vasp.workflows.base.raman module

atomate.vasp.workflows.base.raman.get_wf_raman_spectra(structure, modes=None, step_size=0.005, vasp_cmd='vasp', db_file=None)
Raman susceptibility tensor workflow:
Calculation of phonon normal modes followed by the computation of dielectric tensor for structures displaced along the normal modes. Finally the dielectric tensors corresponding to each mode are used to compute the Raman susceptibility tensor using finite difference (central difference scheme).
Args:

structure (Structure): Input structure. modes (tuple/list): list of modes for which the Raman spectra need to be calculated.

The default is to use all the 3N modes.
step_size (float): site displacement along the normal mode in Angstroms. Used to compute
the finite difference(central difference scheme) first derivative of the dielectric constant along the normal modes.

vasp_cmd (str): vasp command to run. db_file (str): path to file containing the database credentials.

Returns:
Workflow

atomate.vasp.workflows.base.thermal_expansion module

atomate.vasp.workflows.base.thermal_expansion.get_wf_thermal_expansion(structure, deformations, vasp_input_set=None, vasp_cmd='vasp', db_file=None, user_kpoints_settings=None, t_step=10, t_min=0, t_max=1000, mesh=(20, 20, 20), eos='vinet', pressure=0.0, tag=None)

Returns quasi-harmonic thermal expansion workflow. Note: phonopy package is required for the final analysis step.

Args:

structure (Structure): input structure. deformations (list): list of deformation matrices(list of lists). vasp_input_set (VaspInputSet) vasp_cmd (str): vasp command to run. db_file (str): path to the db file. user_kpoints_settings (dict): example: {“grid_density”: 7000} t_step (float): temperature step (in K) t_min (float): min temperature (in K) t_max (float): max temperature (in K) mesh (list/tuple): reciprocal space density eos (str): equation of state used for fitting the energies and the volumes.

options supported by phonopy: “vinet”, “murnaghan”, “birch_murnaghan”. Note: pymatgen supports more options than phonopy. see pymatgen.analysis.eos.py

pressure (float): in GPa tag (str): something unique to identify the tasks in this workflow. If None a random uuid

will be assigned.
Returns:
Workflow

Module contents