class, 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.

  • 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 indices on the tasks and magnetic orderings collections.

Return type:



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.


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

Return type:



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.


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


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

Return type:

list of .MagneticOrderingsDocument


Insert new magnetic orderings into the magnetic orderings Store.


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

Return type: