ElasticBuilder

class atomate2.vasp.builders.elastic.ElasticBuilder(tasks, elasticity, query=None, symprec=SETTINGS.SYMPREC, fitting_method=SETTINGS.ELASTIC_FITTING_METHOD, structure_match_tol=1e-5, **kwargs)[source]

Bases: Builder

The elastic builder compiles deformation tasks into an elastic document.

The process can be summarised as:

  1. Find all deformation documents with the same formula.

  2. Group the deformations by their parent structures.

  3. Create an ElasticDocument from the group of tasks.

Parameters:
  • tasks (.Store) – Store of task documents.

  • elasticity (.Store) – Store for final elastic documents.

  • query (dict) – Dictionary query to limit tasks to be analyzed.

  • sympec (float) – Symmetry precision for desymmetrising deformations.

  • fitting_method (str) – The method used to fit the elastic tensor. See pymatgen for more details on the methods themselves. The options are: - “finite_difference” (note this is required if fitting a 3rd order tensor) - “independent” - “pseudoinverse”

  • structure_match_tol (float) – Numerical tolerance for structure equivalence.

  • **kwargs – Keyword arguments that will be passed to the Builder init.

  • symprec (float)

ensure_indexes()[source]

Ensure indices on the tasks and elasticity collections.

Return type:

None

get_items()[source]

Get all items to process into elastic documents.

Yields:

list of dict – A list of deformation tasks aggregated by formula and containing the required data to generate elasticity documents.

Return type:

Generator

process_item(tasks)[source]

Process deformation tasks into elasticity documents.

The deformation tasks will be grouped based on their parent structure (i.e., the structure before the deformation was applied).

Parameters:

tasks (list of dict) – A list of deformation task, all with the same formula.

Returns:

A list of elastic documents for each unique parent structure.

Return type:

list of .ElasticDocument

update_targets(items)[source]

Insert new elastic documents into the elasticity store.

Parameters:

items (list of .ElasticDocument) – A list of elasticity documents.

Return type:

None