spainn.asetools

generate_db.GenerateDB

class asetools.generate_db.GenerateDB[source]

Generates a SPaiNN database from SHARC outputs

generate(path: str, dbname: str, smooth_nacs: bool = False) None[source]

Searches for all QM.in and QM.out in each subdirectory of given path. Make sure only files you want to add to the database are in the path.

Parameters:
  • path – path to folders with QM.in and QM.out

  • dbname – name of the resulting database

  • smooth_nacs – calculate smooth_nacs

add_smooth_nacs(dbname: str) None[source]

Add smooth NACs to existing DB

parseQMin(file: str) Dict[str, str | ase.Atoms][source]

Parse QM.in file, extract geometry, states and units

Parameters:

file – path to QM.in

parseQMout(file: str, states_dict: Dict[str, int] | None = None) Dict[str, numpy.ndarray][source]

Parse QM.out file and return SPaiNN conform dictionary

Parameters:
  • file – Path to QM.out file

  • states_dict – Dict of states

convert_db.ConvertDB

class asetools.convert_db.ConvertDB[source]

Convert your old SchNarc database to a SPaiNN compatible db, or add smooth NACs to existing SPaiNN db

add_smooth_nacs(olddb: str, newdb: str = '', copy_metadata: bool = True) None[source]

Adds smooth NACs to an existing SPaiNN db

Parameters:
  • olddb – Path of the old SPaiNN db

  • newdb – Path for the extended db, if not passed “_new” will be appended to the old name

  • copy_metadata – Copy metadata from olddb to newdb

convert(olddb: str, newdb: str = '', copy_metadata: bool = True, smooth_nacs: bool = False) None[source]

Converts your db

Parameters:
  • olddb – Path of the old SchNarc db

  • newdb – Path for the converted db, if not passed “_new” will be appended to the old name

  • copy_metadata – Copy metadata from olddb to newdb

  • smooth_nacs – Adds smooth NACs to new db