MagneticOrderingsBuilder

class atomate2.common.builders.magnetism.MagneticOrderingsBuilder(tasks, magnetic_orderings, query=None, structure_match_stol=0.3, structure_match_ltol=0.2, structure_match_angle_tol=5, **kwargs)[source]

Bases: Builder

Builder to analyze the results of magnetic orderings calculations.

This job will process the output documents of the calculations and return new documents with relevant parameters (such as the total magnetization, whether the ordering changed, whether the particular ordering is the ground state, etc.). This is especially useful for performing postprocessing of magnetic ordering calculations.

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

  • magnetic_orderings (.Store) – Store for magnetic ordering documents.

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

  • structure_match_stol (float) – Numerical site tolerance for structure equivalence. Default is 0.3.

  • structure_match_ltol (float) – Numerical length tolerance for structure equivalence. Default is 0.3

  • structure_match_angle_tol (float) – Numerical angle tolerance in degrees for structure equivalence. Default is 5.

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

ensure_indexes()[source]

Ensure indices on the tasks and magnetic orderings collections.

Return type:

None

get_items()[source]

Get all items to process into magnetic ordering documents.

This step does a first grouping by formula (which is fast) and then the magnetic orderings are grouped by parent structure.

Yields:

list of dict – A list of magnetic ordering relaxation or static task outputs, grouped by formula.

Return type:

Iterator[list[dict]]

process_item(tasks)[source]

Process magnetic ordering relaxation/static calculations into documents.

The magnetic ordering tasks will be grouped based on their parent structure (i.e., the structure before the magnetic ordering transformation was applied). See _group_orderings for more details.

Parameters:

tasks (list[dict]) – A list of magnetic ordering tasks grouped by same formula.

Returns:

A list of magnetic ordering documents (one for each unique parent structure).

Return type:

list of .MagneticOrderingsDocument

update_targets(items)[source]

Insert new magnetic orderings into the magnetic orderings Store.

Parameters:

items (list of .MagneticOrderingsDocument) – A list of magnetic ordering documents to add to the database.

Return type:

None