This is the documentation for asr.database.rmsd-recipe. This recipe is comprised of a single instruction, namely:

Run this recipe through the CLI interface

$ asr run asr.database.rmsd

or as a python module

$ python -m asr.database.rmsd



asr.database.rmsd.main(database, databaseout=None, comparison_keys='', max_rmsd=1.0, skip_distance_calc=False)[source]

Calculate RMSD between materials of a database.

Uses pymatgens StructureMatcher to calculate rmsd. If databaseout is specified a new database will be written to the given filename with extra data for rows where a similar row exists in['results-asr.database.rmsd.json']. The structure of this data is similar to rmsd_by_id. It also stores two extra key-value-pairs row.min_rmsd and row.min_rmsd_uid containing the minimum rmsd of the current material to any other material and uid of that other material.


Please note that for systems <3D the computed RMSD can still be larger than max_rmsd due to a renormalization of the RMSD measure. Normally, a large value is preferred.

The structure of rmsd_by_id is:

    '1': {'2': 0.01},
    '2': {'1': 0.01},
  • database (str) – ASE database filename.

  • databaseout (str or None) – If not None, write a new database with rmsd data. Default is None.

  • comparison_keys (str) – Comma separated string of keys that should be identical between rows to be compared. Eg. ‘magstate,natoms’. Default is ‘’.

  • max_rmsd (float) – Maximum rmsd allowed for RMSD to be calculated.

  • skip_distance_calc (bool) – If true, only use reduced formula and comparison_keys to match structures. Skip calculating distances between structures. The output rmsd’s will be 0 for matching structures.


  • rmsd_by_id: RMSDs between materials. The keys are the uids.

  • uid_key: uid_key of the database.

Return type