hetero2d.firetasks package

Submodules

hetero2d.firetasks.heteroiface_tasks module

These modules are helper functions for the workflow, fireworks, and firetasks to simulate the thermodynamic stability and electronic properties of 2D thin films adsorbed on a substrate surface. Most functions here are not intented to be used outside of specific fireworks.

hetero2d.firetasks.heteroiface_tasks.find(pattern, path)

Finds a file on a given search path that matches the pattern.

Parameters
  • pattern (str) – String to match on.

  • path (str) – File path to search over.

Returns

a list of files matching the criteria

hetero2d.firetasks.heteroiface_tasks.get_FWjson()

Helper function which reads the FW.json file in the local directory and returns the FW.json file.

class hetero2d.firetasks.heteroiface_tasks.TransferSlabTask(*args: Any, **kwargs: Any)

Bases: fireworks.core.firework.FiretaskBase

This class updates the spec from the SubstrateSlabFW with the relaxed oriented substrate slab.

Parameters

label (str) – The name of the structure in the additional_spec dict - struct_sub.

Returns

FWAction updating the spec

required_params = ['label']
run_task(fw_spec)
class hetero2d.firetasks.heteroiface_tasks.CreateHeterostructureTask(*args: Any, **kwargs: Any)

Bases: fireworks.core.firework.FiretaskBase

Applies provided transformations to the input 2D structure and substrate slab and writes the VASP input for the calculation. Reads structure from previous the directory if no structure is provided.

Updates the Q_Adapter settings for the hetero_interface optimization. Updates spec file to include to analysis_info, the previous job info, and enables duplicate checking.

Parameters
  • heterotransformation_params (dict) – dictionary containing the input to control the hetero2d.manipulate.hetero_transmuter modules. Example: h_params={‘transformations’:[‘hetero_interfaces’], ‘transformation_params’: [{hetero_inface input}]}.

  • transformations (list) – list of transformations to apply to the structure as defined in the modules in hetero2d.manipulate module.

  • transformation_params (list) – list of dicts where each dict specifies the input parameters to instantiate the transformation class in the transformations list. The transformations input parameters should correspond to the dictionary keys where the values represent the input data.

  • vasp_input_set (vis) – User defined vasp input set for the heterostructure.

Other Parameters

name (str) – The firework name for this step of the workflow.

Returns

HeterostructureFW’s for each unique structure generated by the heterotransformation_params

required_params = ['vasp_input_set', 'heterotransformation_params']
optional_params = ['name']
run_task(fw_spec)

hetero2d.firetasks.parse_outputs module

These modules parse output from VASP runs, calculate various energetic and structural parameters and update a mongoDB with the relevant information.

hetero2d.firetasks.parse_outputs.HeteroTaskDoc(self, fw_spec, task_name, task_collection, additional_fields=None, db_file=None)

Insert a new doc for the 2d, 3d2d, bulk, substrate slab, 2d-subs generator, or 2d-subs configuration into the database.

Parameters
  • fw_spec (dict) – A dictionary containing all the information linked to this firework.

  • task_name (str) – The name of the firework being analyzed.

  • task_collection (str) – The name of the task collection you want to push the data to.

  • additional_fields (dict) – a dictionary containing additional information you want added to the database.

  • db_file (str) – a string representation for the location of the database file.

Returns

Analyzed structure, number of sites, and energy

class hetero2d.firetasks.parse_outputs.HeteroAnalysisToDb(*args: Any, **kwargs: Any)

Bases: fireworks.core.firework.FiretaskBase

Enter heterostructure workflow analysis into the database.

Parameters
  • db_file (str) – path to file containing the database credentials. Supports env_chk. Default: write data to JSON file.

  • wf_name (str) – The name of the workflow that this analysis is part of.

Other Parameters
  • Adsorption_Energy (bool) – If set this will perform adsorption energy analysis for the run and send the results to the Adsorption_Energy collection.

  • Binding_Energy (bool) – If set the binding energy will be calculated and sent to the Binding Energy collection.

  • Formation_Energy (bool) – If set the formation energy will be calculated and sent to the Formation_Energy collection.

  • calc_dir (str) – The calculation directory to parse.

  • calc_loc (str) – The location to the directory to parse.

required_params = ['db_file', 'wf_name', 'task_label']
optional_params = ['Adsorption_Energy', 'Binding_Energy', 'Formation_Energy', 'additional_fields']
run_task(fw_spec)

hetero2d.firetasks.run_calc module

This module defines tasks that support running vasp in various ways. Under active development for Hetero2d. Currently not in use as the default behaviour from atomate is sufficient.

class hetero2d.firetasks.run_calc.RunVaspCustodian(*args: Any, **kwargs: Any)

Bases: fireworks.FiretaskBase

Run VASP using custodian “on rails”, i.e. in a simple way that supports most common options.

Parameters

vasp_cmd (str) – the name of the full executable for running VASP. Supports env_chk.

Other Parameters
  • job_type – (str) - choose from “normal” (default), “double_relaxation_run” (two consecutive jobs), “full_opt_run” (multiple optimizations), and “neb”

  • handler_group – (str or [ErrorHandler]) - group of handlers to use. See handler_groups dict in the code for the groups and complete list of handlers in each group. Alternatively, you can specify a list of ErrorHandler objects.

  • max_force_threshold – (float) - if >0, adds MaxForceErrorHandler. Not recommended for nscf runs.

  • scratch_dir – (str) - if specified, uses this directory as the root scratch dir. Supports env_chk.

  • gzip_output – (bool) - gzip output (default=T)

  • max_errors – (int) - maximum # of errors to fix before giving up (default=5)

  • ediffg – (float) shortcut for setting EDIFFG in special custodian jobs

  • auto_npar – (bool) - use auto_npar (default=F). Recommended set to T for single-node jobs only. Supports env_chk.

  • gamma_vasp_cmd – (str) - cmd for Gamma-optimized VASP compilation. Supports env_chk.

  • wall_time (int) – Total wall time in seconds. Activates WallTimeHandler if set.

  • half_kpts_first_relax (bool) – Use half the k-points for the first relaxation

required_params = ['vasp_cmd']
optional_params = ['job_type', 'handler_group', 'max_force_threshold', 'scratch_dir', 'gzip_output', 'max_errors', 'ediffg', 'auto_npar', 'gamma_vasp_cmd', 'wall_time', 'half_kpts_first_relax']
run_task(fw_spec)

hetero2d.firetasks.write_inputs module

These classes write the vasp input sets used to control VASP tags.

class hetero2d.firetasks.write_inputs.WriteSlabStructureIOSet(*args: Any, **kwargs: Any)

Bases: fireworks.core.firework.FiretaskBase

Apply the provided transformations to the input structure and write the input set for that structure. Reads structure from POSCAR if no structure provided. Note that if a transformation yields many structures from one, only the last structure in the list is used.

Parameters
  • structure (Structure) – input structure.

  • transformations (list) – list of names of transformation classes as defined in the modules in pymatgen.transformations

  • vasp_input_set (VaspInputSet) – VASP input set.

Other Parameters
  • transformation_params (list) – list of dicts where each dict specifies the input parameters to instantiate the transformation class in the transformations list.

  • override_default_vasp_params (dict) – additional user input settings.

  • prev_calc_dir (str) – path to previous calculation if using structure from another calculation.

Returns

none

required_params = ['structure', 'transformations', 'vasp_input_set']
optional_params = ['prev_calc_dir', 'transformation_params', 'override_default_vasp_params']
run_task(fw_spec)

Execute the transformations and write the input files for the calculation

class hetero2d.firetasks.write_inputs.WriteHeteroStructureIOSet(*args: Any, **kwargs: Any)

Bases: fireworks.core.firework.FiretaskBase

Apply the provided transformations to the input 2D structure and substrate slab then write the input set for that simulation. Reads structure from POSCAR if no structure provided.

Parameters

structure (Slab) – 2D input structure to place on substrate. Valid parameters include all pymatgen structure objects.

Other Parameters
  • vasp_input_set (VaspInputSet) – VASP input set for the transformed 2d on sub-slab

  • override_default_vasp_params (dict) – additional user input settings.

  • user_incar_settings (dict) – additional incar settings to add to the calculation.

Returns

None

required_params = ['structure', 'nlayers_sub', 'nlayers_2d']
optional_params = ['user_incar_settings', 'override_default_vasp_params', 'vasp_input_set']
run_task(fw_spec)

Write the selective dynamics tags for the 2d-substrate heterostructure configuration and all calculation input file to the specified directory.

Module contents