Database

class atomman.library.Database(local: Optional[bool] = None, remote: Optional[bool] = None, localpath: Optional[str] = None, local_name: Optional[str] = None, local_database: Optional[Database] = None, local_style: Optional[str] = None, local_host: Optional[str] = None, local_terms: Optional[dict] = None, remote_name: Optional[str] = None, remote_database: Optional[Database] = None, remote_style: Optional[str] = None, remote_host: Optional[str] = None, remote_terms: Optional[dict] = None, kim_models: Optional[Union[str, list]] = None, kim_api_directory: Optional[Path] = None, kim_models_file: Optional[Path] = None)

Bases: Database

Child of potentials.Database extended for interacting with structure and defect reference records.

download_all(status: Optional[Union[str, list]] = None, downloadfiles: bool = True, overwrite: bool = False, verbose: bool = False)

Downloads potential and structure-related records from the remote location to the local location.

Parameters:
  • status (str, list or None, optional) – Only potential_LAMMPS records with the given status(es) will be downloaded. Allowed values are ‘active’ , ‘superseded’, and ‘retracted’. If None (default) is given, then all potentials will be downloaded.

  • downloadfiles (bool, optional) – If True, the parameter files associated with the potential_LAMMPS record will also be downloaded.

  • overwrite (bool, optional) – Flag indicating if any existing local records with names matching remote records are updated (True) or left unchanged (False). Default value is False.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

download_crystal_prototypes(name: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, commonname: Optional[Union[str, list]] = None, prototype: Optional[Union[str, list]] = None, pearson: Optional[Union[str, list]] = None, strukturbericht: Optional[Union[str, list]] = None, sg_number: Optional[Union[int, list]] = None, sg_hm: Optional[Union[str, list]] = None, sg_schoenflies: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, natypes: Optional[Union[int, list]] = None, overwrite: bool = False, return_records: bool = False, verbose: bool = False) Optional[ndarray]

Downloads crystal prototypes from the remote to the local.

Parameters:
  • name (str or list, optional) – The record name(s) to parse by. For crystal prototype records, the names should correspond to the id.

  • id (str or list, optional) – Prototype ID(s) to search for. These are unique identifiers for each prototype based on comm.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • name – Common name(s) to limit the search by.

  • prototype (str or list, optional) – Prototype identifying composition(s) to limit the search by.

  • pearson (str or list, optional) – The Pearson symbol(s) to limit the search by.

  • strukturbericht (str or list, optional) – The strukturbericht identifier(s) to limit the search by.

  • sg_number (int or list, optional) – The space group number(s) to limit the search by.

  • sg_hm (str or list, optional) – The space group Hermann-Maguin identifier(s) to limit the search by.

  • sg_schoenflies (str or list, optional) – The space group Schoenflies identifier(s) to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system families to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • overwrite (bool, optional) – Flag indicating if any existing local records with names matching remote records are updated (True) or left unchanged (False). Default value is False.

  • return_records (bool, optional) – If True, the retrieved record objects are also returned. Default value is False.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching records - returned if return_records=True

Return type:

numpy.ndarray

download_reference_crystals(name: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, sourcename: Optional[Union[str, list]] = None, sourcelink: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, composition: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, overwrite: bool = False, return_records: bool = False, verbose: bool = False) Optional[ndarray]

Download reference records from the remote and save to localpath.

Parameters:
  • name (str or list, optional) – The record name(s) to parse by. For reference crystal records, the names should correspond to the id.

  • id (str or list, optional) – The record id(s) to parse by. For reference crystal records, the id are letters identifying the source database “mp-”, “mvc-”, or “oqmd-“, followed by the source database’s identification number.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • sourcename (str or list, optional) – The full name of source DFT databases to limit the search by. “Materials Project” or “Open Quantum Materials Database”.

  • sourcelink (str or list, optional) – The web link of the source DFT databases to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system families to limit the search by.

  • composition (str or list, optional) – The reduced compositions of the structures to limit the search by. Element symbols are sorted alphabetically.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natoms (int or list, optional) – The number of unique atoms in the crystal’s unit cell to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • overwrite (bool, optional) – Flag indicating if any existing local records with names matching remote records are updated (True) or left unchanged (False). Default value is False.

  • return_records (bool, optional) – If True, the retrieved record objects are also returned. Default value is False.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching records - returned if return_records=True

Return type:

numpy.ndarray

download_relaxed_crystals(name: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, method: Optional[Union[str, list]] = None, standing: Optional[Union[str, list]] = None, family: Optional[Union[str, list]] = None, parent_key: Optional[Union[str, list]] = None, potential_LAMMPS_id: Optional[Union[str, list]] = None, potential_LAMMPS_key: Optional[Union[str, list]] = None, potential_id: Optional[Union[str, list]] = None, potential_key: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, overwrite: bool = False, return_records: bool = False, verbose: bool = False) Optional[ndarray]

Download citation records from the remote and save to localpath.

Parameters:
  • name (str or list) – The record name(s) to parse by. For relaxed crystal records, the names should correspond to the key.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • method (str or list or None, optional) – The relaxation method used. Allowed values are dynamic, static and box.

  • standing (str or list or None, optional) – “good” records are the unique crystals found with the most rigorous relaxation, and with known prototypes over DFT structures. “bad” are records filtered out, usually for being duplicates.

  • family (str or atomman.library.CrystalPrototype or list, optional) – The crystal family associated with the relaxed crystal - either crystal prototype name or MP/OQMD database entry name.

  • parent_key (str or list, optional) – The UUID4 key(s) assigned to the calculation that the record is based on.

  • potential_LAMMPS_id (str or list, optional) – The id for a LAMMPS implemented potential to limit the search by.

  • potential_LAMMPS_key (str or list, optional) – The UUID4 for a LAMMPS implemented potential to limit the search by.

  • potential_id (str or list, optional) – The id for a potential to limit the search by.

  • potential_key (str or list, optional) – The UUID4 for a potential to limit the search by.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natypes (int or list, optional) – The number of unique element model symbols in the crystal to limit the search by.

  • natoms (int or list, optional) – The number of unique atoms in the crystal’s unit cell to limit the search by.

  • overwrite (bool, optional) – Flag indicating if any existing local records with names matching remote records are updated (True) or left unchanged (False). Default value is False.

  • return_records (bool, optional) – If True, the retrieved record objects are also returned. Default value is False.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching records - returned if return_records=True

Return type:

numpy.ndarray

fetch_mp_crystal(id: str, api_key: Optional[str] = None) Record

Retrieves a single reference crystal from Materials Project based on id.

Parameters:
  • id (str) – The structure id of the crystal to retrieve.

  • api_key (str, optional) – The user’s Materials Project API key. If not given, will use “MAPI_KEY” environment variable.

Returns:

The retrieved reference crystal.

Return type:

Record

fetch_mp_crystals(id: str, api_key: Optional[str] = None) list

Retrieves reference crystals from Materials Project based on id(s).

Parameters:
  • id (str or list) – The structure id(s) of the crystals to retrieve.

  • api_key (str, optional) – The user’s Materials Project API key or path to a file containing the key. If not given, will use the “MAPI_KEY” environment variable.

Returns:

All matching reference crystals retrieved.

Return type:

list

fetch_oqmd_crystal(id: str) Record

Retrieves a single reference crystal from OQMD based on id.

Parameters:

id (str) – The OQMD entry number with “oqmd-” prefix.

Returns:

The retrieved reference crystal.

Return type:

Record

fetch_reference_crystal(id: str, api_key: Optional[str] = None, local: Optional[bool] = None, remote: Optional[bool] = None, refresh_cache: bool = False, verbose: bool = False) Record

Retrieves a single reference crystal. First, the database is checked for matches with the DOI, then with the record name. If no matches are found in the database, then the corresponding crystal structure is downloaded from the source database.

Parameters:
  • id (str) – The reference crystal’s unique id. Combines a database tag “mp-” or “oqmd-” and the DFT database’s entry id.

  • api_key (str, optional) – The user’s Materials Project API key or path to a file containing the key. Only needed for fetching structures from Materials Project and if the key is not set to the “MAPI_KEY” environment variable.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching reference crystal record.

Return type:

yabadaba.record.Record

get_crystal_prototype(name: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, commonname: Optional[Union[str, list]] = None, prototype: Optional[Union[str, list]] = None, pearson: Optional[Union[str, list]] = None, strukturbericht: Optional[Union[str, list]] = None, sg_number: Optional[Union[int, list]] = None, sg_hm: Optional[Union[str, list]] = None, sg_schoenflies: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, refresh_cache: bool = False, verbose: bool = False) Record

Gets exactly one matching crystal prototype from the database.

Parameters:
  • name (str or list, optional) – The record name(s) to parse by. For crystal prototype records, the names should correspond to the id.

  • id (str or list, optional) – Prototype ID(s) to search for. These are unique identifiers for each prototype based on comm.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • name – Common name(s) to limit the search by.

  • prototype (str or list, optional) – Prototype identifying composition(s) to limit the search by.

  • pearson (str or list, optional) – The Pearson symbol(s) to limit the search by.

  • strukturbericht (str or list, optional) – The strukturbericht identifier(s) to limit the search by.

  • sg_number (int or list, optional) – The space group number(s) to limit the search by.

  • sg_hm (str or list, optional) – The space group Hermann-Maguin identifier(s) to limit the search by.

  • sg_schoenflies (str or list, optional) – The space group Schoenflies identifier(s) to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system family to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • prompt (bool) – If prompt=True (default) then a screen input will ask for a selection if multiple matching potentials are found. If prompt=False, then an error will be thrown if multiple matches are found.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching record object

Return type:

yabadaba.record.Record

get_crystal_prototypes(name: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, commonname: Optional[Union[str, list]] = None, prototype: Optional[Union[str, list]] = None, pearson: Optional[Union[str, list]] = None, strukturbericht: Optional[Union[str, list]] = None, sg_number: Optional[Union[int, list]] = None, sg_hm: Optional[Union[str, list]] = None, sg_schoenflies: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, refresh_cache: bool = False, return_df: bool = False, verbose: bool = False) Union[ndarray, Tuple[ndarray, DataFrame]]

Gets all matching crystal prototypes from the database.

Parameters:
  • name (str or list) – The record name(s) to parse by. For crystal prototype records, the names should correspond to the id.

  • id (str or list, optional) – Prototype ID(s) to search for. These are unique identifiers for each prototype based on comm.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • commonname (str or list, optional) – Common name(s) to limit the search by.

  • prototype (str or list, optional) – Prototype identifying composition(s) to limit the search by.

  • pearson (str or list, optional) – The Pearson symbol(s) to limit the search by.

  • strukturbericht (str or list, optional) – The strukturbericht identifier(s) to limit the search by.

  • sg_number (int or list, optional) – The space group number(s) to limit the search by.

  • sg_hm (str or list, optional) – The space group Hermann-Maguin identifier(s) to limit the search by.

  • sg_schoenflies (str or list, optional) – The space group Schoenflies identifier(s) to limit the search by.

  • crystalfamily (str, optional) – The crystal system family to limit the search by.

  • natypes (int, optional) – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • return_df (bool, optional) – If True, then the corresponding pandas.Dataframe of metadata will also be returned.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

  • numpy.ndarray – The matching record objects

  • pandas.DataFrame – A table of the associated record metadata, returned if return_df = True.

get_reference_crystal(name: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, sourcename: Optional[Union[str, list]] = None, sourcelink: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, composition: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, refresh_cache: bool = False, verbose: bool = False) Record

Gets exactly one matching reference crystal from the database.

Parameters:
  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • name (str or list, optional) – The record name(s) to parse by. For reference crystal records, the names should correspond to the id.

  • id (str or list, optional) – The record id(s) to parse by. For reference crystal records, the id are letters identifying the source database “mp-”, “mvc-”, or “oqmd-“, followed by the source database’s identification number.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • sourcename (str or list, optional) – The full name of source DFT databases to limit the search by. “Materials Project” or “Open Quantum Materials Database”.

  • sourcelink (str or list, optional) – The web link of the source DFT databases to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system families to limit the search by.

  • composition (str or list, optional) – The reduced compositions of the structures to limit the search by. Element symbols are sorted alphabetically.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natoms (int or list, optional) – The number of unique atoms in the crystal’s unit cell to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • prompt (bool) – If prompt=True (default) then a screen input will ask for a selection if multiple matching potentials are found. If prompt=False, then an error will be thrown if multiple matches are found.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching record object

Return type:

yabadaba.record.Record

get_reference_crystals(name: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, sourcename: Optional[Union[str, list]] = None, sourcelink: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, composition: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, refresh_cache: bool = False, return_df: bool = False, verbose: bool = False) Union[ndarray, Tuple[ndarray, DataFrame]]

Gets all matching reference crystals from the database.

Parameters:
  • name (str or list, optional) – The record name(s) to parse by. For reference crystal records, the names should correspond to the id.

  • id (str or list, optional) – The record id(s) to parse by. For reference crystal records, the id are letters identifying the source database “mp-”, “mvc-”, or “oqmd-“, followed by the source database’s identification number.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • sourcename (str or list, optional) – The full name of source DFT databases to limit the search by. “Materials Project” or “Open Quantum Materials Database”.

  • sourcelink (str or list, optional) – The web link of the source DFT databases to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system families to limit the search by.

  • composition (str or list, optional) – The reduced compositions of the structures to limit the search by. Element symbols are sorted alphabetically.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natoms (int or list, optional) – The number of unique atoms in the crystal’s unit cell to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • return_df (bool, optional) – If True, then the corresponding pandas.Dataframe of metadata will also be returned.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

  • numpy.ndarray – The matching record objects

  • pandas.DataFrame – A table of the associated record metadata, returned if return_df = True.

get_relaxed_crystal(name: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, method: Optional[Union[str, list]] = None, standing: Optional[Union[str, list]] = None, family: Optional[Union[str, list]] = None, parent_key: Optional[Union[str, list]] = None, potential_LAMMPS_id: Optional[Union[str, list]] = None, potential_LAMMPS_key: Optional[Union[str, list]] = None, potential_id: Optional[Union[str, list]] = None, potential_key: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, refresh_cache: bool = False, verbose: bool = False) Record

Gets exactly one matching relaxed crystal from the database.

Parameters:
  • name (str or list) – The record name(s) to parse by. For relaxed crystal records, the names should correspond to the key.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • method (str or list or None, optional) – The relaxation method used. Allowed values are dynamic, static and box.

  • standing (str or list or None, optional) – “good” records are the unique crystals found with the most rigorous relaxation, and with known prototypes over DFT structures. “bad” are records filtered out, usually for being duplicates.

  • family (str or atomman.library.CrystalPrototype or list, optional) – The crystal family associated with the relaxed crystal - either crystal prototype name or MP/OQMD database entry name.

  • parent_key (str or list, optional) – The UUID4 key(s) assigned to the calculation that the record is based on.

  • potential_LAMMPS_id (str or list, optional) – The id for a LAMMPS implemented potential to limit the search by.

  • potential_LAMMPS_key (str or list, optional) – The UUID4 for a LAMMPS implemented potential to limit the search by.

  • potential_id (str or list, optional) – The id for a potential to limit the search by.

  • potential_key (str or list, optional) – The UUID4 for a potential to limit the search by.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natypes (int or list, optional) – The number of unique element model symbols in the crystal to limit the search by.

  • natypes – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • prompt (bool) – If prompt=True (default) then a screen input will ask for a selection if multiple matching potentials are found. If prompt=False, then an error will be thrown if multiple matches are found.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

The matching record object

Return type:

yabadaba.record.Record

get_relaxed_crystals(name: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, method: Optional[Union[str, list]] = None, standing: Optional[Union[str, list]] = None, family: Optional[Union[str, list]] = None, parent_key: Optional[Union[str, list]] = None, potential_LAMMPS_id: Optional[Union[str, list]] = None, potential_LAMMPS_key: Optional[Union[str, list]] = None, potential_id: Optional[Union[str, list]] = None, potential_key: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, refresh_cache: bool = False, return_df: bool = False, verbose: bool = False) Union[ndarray, Tuple[ndarray, DataFrame]]

Gets all matching relaxed crystals from the database.

Parameters:
  • name (str or list) – The record name(s) to parse by. For relaxed crystal records, the names should correspond to the key.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • method (str or list or None, optional) – The relaxation method used. Allowed values are dynamic, static and box.

  • standing (str or list or None, optional) – “good” records are the unique crystals found with the most rigorous relaxation, and with known prototypes over DFT structures. “bad” are records filtered out, usually for being duplicates.

  • family (str or atomman.library.CrystalPrototype or list, optional) – The crystal family associated with the relaxed crystal - either crystal prototype name or MP/OQMD database entry name.

  • parent_key (str or list, optional) – The UUID4 key(s) assigned to the calculation that the record is based on.

  • potential_LAMMPS_id (str or list, optional) – The id for a LAMMPS implemented potential to limit the search by.

  • potential_LAMMPS_key (str or list, optional) – The UUID4 for a LAMMPS implemented potential to limit the search by.

  • potential_id (str or list, optional) – The id for a potential to limit the search by.

  • potential_key (str or list, optional) – The UUID4 for a potential to limit the search by.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • natoms (int or list, optional) – The number of unique atoms in the crystal’s unit cell to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • return_df (bool, optional) – If True, then the corresponding pandas.Dataframe of metadata will also be returned.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Returns:

  • numpy.ndarray – The matching record objects

  • pandas.DataFrame – A table of the associated record metadata, returned if return_df = True.

retrieve_crystal_prototype(name: Optional[Union[str, list]] = None, dest: Optional[Path] = None, id: Optional[Union[str, list]] = None, key: Optional[Union[str, list]] = None, commonname: Optional[Union[str, list]] = None, prototype: Optional[Union[str, list]] = None, pearson: Optional[Union[str, list]] = None, strukturbericht: Optional[Union[str, list]] = None, sg_number: Optional[Union[int, list]] = None, sg_hm: Optional[Union[str, list]] = None, sg_schoenflies: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, format: str = 'json', indent: int = 4, refresh_cache: bool = False, verbose: bool = False)

Gets a single matching crystal prototype from the database and saves it to a file based on the record’s name.

Parameters:
  • name (str or list, optional) – The name(s) of records to limit the search by.

  • dest (path, optional) – The parent directory where the record will be saved to. If not given, will use the current working directory.

  • id (str or list, optional) – Prototype ID(s) to search for. These are unique identifiers for each prototype based on comm.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • name – Common name(s) to limit the search by.

  • prototype (str or list, optional) – Prototype identifying composition(s) to limit the search by.

  • pearson (str or list, optional) – The Pearson symbol(s) to limit the search by.

  • strukturbericht (str or list, optional) – The strukturbericht identifier(s) to limit the search by.

  • sg_number (int or list, optional) – The space group number(s) to limit the search by.

  • sg_hm (str or list, optional) – The space group Hermann-Maguin identifier(s) to limit the search by.

  • sg_schoenflies (str or list, optional) – The space group Schoenflies identifier(s) to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system family to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • prompt (bool, optional) – If prompt=True (default) then a screen input will ask for a selection if multiple matching potentials are found. If prompt=False, then an error will be thrown if multiple matches are found.

  • format (str, optional) – The file format to save the record in: ‘json’ or ‘xml’. Default is ‘json’.

  • indent (int, optional) – The number of space indentation spacings to use in the saved record for the different tiered levels. Default is 4. Giving None will create a compact record.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Raises:
  • ValueError – If local or remote is set to True when the corresponding database interaction has not been set.

  • ValueError – If multiple or no matching records are discovered.

retrieve_reference_crystal(name: Optional[Union[str, list]] = None, dest: Optional[Path] = None, key: Optional[Union[str, list]] = None, id: Optional[Union[str, list]] = None, sourcename: Optional[Union[str, list]] = None, sourcelink: Optional[Union[str, list]] = None, crystalfamily: Optional[Union[str, list]] = None, composition: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, format: str = 'json', indent: int = 4, refresh_cache: bool = False, verbose: bool = False)

Gets a single matching relaxed crystal from the database and saves it to a file based on the record’s name.

Parameters:
  • name (str or list, optional) – The name(s) of records to limit the search by.

  • dest (path, optional) – The parent directory where the record will be saved to. If not given, will use the current working directory.

  • id (str or list, optional) – The record id(s) to parse by. For reference crystal records, the id are letters identifying the source database “mp-”, “mvc-”, or “oqmd-“, followed by the source database’s identification number.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • sourcename (str or list, optional) – The full name of source DFT databases to limit the search by. “Materials Project” or “Open Quantum Materials Database”.

  • sourcelink (str or list, optional) – The web link of the source DFT databases to limit the search by.

  • crystalfamily (str or list, optional) – The crystal system families to limit the search by.

  • composition (str or list, optional) – The reduced compositions of the structures to limit the search by. Element symbols are sorted alphabetically.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natoms (int or list, optional) – The number of unique atoms in the crystal’s unit cell to limit the search by.

  • natypes (int or list, optional) – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • prompt (bool, optional) – If prompt=True (default) then a screen input will ask for a selection if multiple matching potentials are found. If prompt=False, then an error will be thrown if multiple matches are found.

  • format (str, optional) – The file format to save the record in: ‘json’ or ‘xml’. Default is ‘json’.

  • indent (int, optional) – The number of space indentation spacings to use in the saved record for the different tiered levels. Default is 4. Giving None will create a compact record.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Raises:
  • ValueError – If local or remote is set to True when the corresponding database interaction has not been set.

  • ValueError – If multiple or no matching records are discovered.

retrieve_relaxed_crystal(name: Optional[Union[str, list]] = None, dest: Optional[Path] = None, key: Optional[Union[str, list]] = None, method: Optional[Union[str, list]] = None, standing: Optional[Union[str, list]] = None, family: Optional[Union[str, list]] = None, parent_key: Optional[Union[str, list]] = None, potential_LAMMPS_id: Optional[Union[str, list]] = None, potential_LAMMPS_key: Optional[Union[str, list]] = None, potential_id: Optional[Union[str, list]] = None, potential_key: Optional[Union[str, list]] = None, symbols: Optional[Union[str, list]] = None, natoms: Optional[Union[int, list]] = None, natypes: Optional[Union[int, list]] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, format: str = 'json', indent: int = 4, refresh_cache: bool = False, verbose: bool = False)

Gets a single matching relaxed crystal from the database and saves it to a file based on the record’s name.

Parameters:
  • name (str or list, optional) – The name(s) of records to limit the search by.

  • dest (path, optional) – The parent directory where the record will be saved to. If not given, will use the current working directory.

  • key (str or list, optional) – UUID4 key(s) to search for. Each entry has a unique random-generated UUID4 key.

  • method (str or list or None, optional) – The relaxation method used. Allowed values are dynamic, static and box.

  • standing (str or list or None, optional) – “good” records are the unique crystals found with the most rigorous relaxation, and with known prototypes over DFT structures. “bad” are records filtered out, usually for being duplicates.

  • family (str or atomman.library.CrystalPrototype or list, optional) – The crystal family associated with the relaxed crystal - either crystal prototype name or MP/OQMD database entry name.

  • parent_key (str or list, optional) – The UUID4 key(s) assigned to the calculation that the record is based on.

  • potential_LAMMPS_id (str or list, optional) – The id for a LAMMPS implemented potential to limit the search by.

  • potential_LAMMPS_key (str or list, optional) – The UUID4 for a LAMMPS implemented potential to limit the search by.

  • potential_id (str or list, optional) – The id for a potential to limit the search by.

  • potential_key (str or list, optional) – The UUID4 for a potential to limit the search by.

  • symbols (str or list, optional) – Element symbols in the crystal to limit the search by.

  • natypes (int or list, optional) – The number of unique element model symbols in the crystal to limit the search by.

  • natypes – The number(s) of unique atom types to limit the search by.

  • local (bool, optional) – Indicates if the local location is to be searched. Default value matches the value set when the database was initialized.

  • remote (bool, optional) – Indicates if the remote location is to be searched. Default value matches the value set when the database was initialized.

  • prompt (bool, optional) – If prompt=True (default) then a screen input will ask for a selection if multiple matching potentials are found. If prompt=False, then an error will be thrown if multiple matches are found.

  • format (str, optional) – The file format to save the record in: ‘json’ or ‘xml’. Default is ‘json’.

  • indent (int, optional) – The number of space indentation spacings to use in the saved record for the different tiered levels. Default is 4. Giving None will create a compact record.

  • refresh_cache (bool, optional) – If the local database is of style “local”, indicates if the metadata cache file is to be refreshed. If False, metadata for new records will be added but the old record metadata fields will not be updated. If True, then the metadata for all records will be regenerated, which is needed to update the metadata for modified records.

  • verbose (bool, optional) – If True, info messages will be printed during operations. Default value is False.

Raises:
  • ValueError – If local or remote is set to True when the corresponding database interaction has not been set.

  • ValueError – If multiple or no matching records are discovered.