FormationEnergyMaker#

class atomate2.vasp.flows.defect.FormationEnergyMaker(defect_relax_maker=<factory>, bulk_relax_maker=None, name='formation energy', relax_radius=None, perturb=None, validate_charge=True, collect_defect_entry_data=False)[source]#

Bases: FormationEnergyMaker

Maker class to help calculate of the formation energy diagram.

Maker class to calculate formation energy diagrams. The main settings for this maker is the relax_maker which contains the settings for the atomic relaxations that each defect supercell will undergo. The relax_maker uses a ChargeStateRelaxSetGenerator by default but more complex makers like the HSE_DOUBLE_RELAX can be used for more accurate (but expensive) calculations. If the validate_maker is set to True, the maker will check for some basic settings in the relax_maker to make sure the calculations are done correctly.

Variables:
  • defect_relax_maker (Maker) – A maker to perform a atomic-position-only relaxation on the defect charge states. Since these calculations are expensive and the settings might get messy, it is recommended for each implementation of this maker to check some of the most important settings in the relax_maker. Please see FormationEnergyMaker.validate_maker for more details.

  • bulk_relax_maker (Maker) – If None, the same defect_relax_maker will be used for the bulk supercell. A maker to used to perform the bulk supercell calculation. For marginally converged calculations, it might be desirable to perform an additional lattice relaxation on the bulk supercell to make sure the energies are more reliable. However, if you do relax the bulk supercell, you can inadvertently change the grid size used in the calculation and thus the representation of the electrostatic potential which will affect calculation of the Freysoldt finite-size correction. Therefore, if you do want to perform a bulk supercell lattice relaxation, you should manually set the grid size.

  • name (str) – The name of the flow created by this maker.

  • relax_radius – The radius to include around the defect site for the relaxation. If “auto”, the radius will be set to the maximum that will fit inside a periodic cell. If None, all atoms will be relaxed.

  • perturb – The amount to perturb the sites in the supercell. Only perturb the sites with selective dynamics set to True. So this setting only works with relax_radius.

  • collect_defect_entry_data (bool) –

    Whether to collect the defect entry data at the end of the flow. If True, the output of all the charge states for each symmetry distinct defect will be collected into a list of dictionaries that can be used to create a DefectEntry. The data here can be trivially combined with phase diagram data from the materials project API to create the formation energy diagrams.

    Once we remove the requirement for explicit bulk supercell calculations, this setting will be removed. It is only needed because the bulk supercell locpot is currently needed for the finite-size correction calculation.

    Output format for the DefectEntry data: .. code-block:: python [

    {

    ‘bulk_dir_name’: ‘computer1:/folder1’, ‘bulk_locpot’: {…}, ‘bulk_uuid’: ‘48fb6da7-dc2b-4dcb-b1c8-1203c0f72ce3’, ‘defect_dir_name’: ‘computer1:/folder2’, ‘defect_entry’: {…}, ‘defect_locpot’: {…}, ‘defect_uuid’: ‘e9af2725-d63c-49b8-a01f-391540211750’

    }, {

    ’bulk_dir_name’: ‘computer1:/folder3’, ‘bulk_locpot’: {…}, ‘bulk_uuid’: ‘48fb6da7-dc2b-4dcb-b1c8-1203c0f72ce3’, ‘defect_dir_name’: ‘computer1:/folder4’, ‘defect_entry’: {…}, ‘defect_locpot’: {…}, ‘defect_uuid’: ‘a1c31095-0494-4eed-9862-95311f80a993’

    }

    ]

Parameters:
sc_entry_and_locpot_from_prv(previous_dir)[source]#

Copy the output structure from previous directory.

Read the vasprun.xml file from the previous directory and return the structure.

Parameters:

previous_dir (str) – The directory to copy from.

Return type:

ComputedStructureEntry

get_planar_locpot(task_doc)[source]#

Get the planar-averaged electrostatic potential.

Parameters:

task_doc (TaskDoc) –

Return type:

dict

validate_maker()[source]#

Check some key settings in the relax maker.

Since this workflow is pretty complex but allows you to use any relax maker, it can be easy to make mistakes in the settings. This method should check the most important settings and raise an error if something is wrong.

Example: For VASP, the relax maker should have:

ISIF = 2 and use_structure_charge = True

Return type:

None