Convert

Tools for interconverting data between codes.

Module contents

amp.convert.get_Gs_indices(Gs)[source]

Handy function to deal with symmetry function orders.

amp.convert.overwrite_file(filename, log, suffix='.data')[source]

Overwrite files if existent.

amp.convert.save_to_n2p2(desc_pars, model_pars, images=None, log=None, reference_method='PBE')[source]

Generate input files for n2p2 to use its fast force inference. By default,three or four types of files will be generated:

  • scaling.data: scaling information for symmetry functions.

  • input.nn: a settings file, including NN topology and SF setup.

  • weights.xxx.data: NN weights and biases, xxx being the atomic number.

  • input.data (optional): a configuration file includes atomic structures.

Parameters:
  • desc_pars (dict) – AMP descriptor parameters.

  • model_pars (dict) – AMP neural network model parameters.

  • images (list) – List of ASE atoms objects.

  • log (str or Logger instance) – Logging file.

  • reference_method (str) – Method used to generate the reference data.

amp.convert.save_to_n2p2_images_only(images, log=None)[source]

Write the input.data;i.e., the atomic configurations. This is usually used together with the save_to_n2p2 function at above.

amp.convert.save_to_openkim(calc, filename='amp.params', overwrite=False, units='metal')[source]

Saves the calculator in a way that it can be used with OpenKIM.

Parameters:
  • calc (obj) – A trained Amp calculator object.

  • filename (str) – File object or path to the file to write to.

  • overwrite (bool) – If an output file with the same name exists, overwrite it.

  • units (str) – LAMMPS units style to be used with the outfile file.

amp.convert.save_to_prophet(calc, filename='potential_', overwrite=False, units='metal')[source]

Saves the calculator in a way that it can be used with PROPhet.

Parameters:
  • calc (obj) – A trained Amp calculator object.

  • filename (str) – File object or path to the file to write to.

  • overwrite (bool) – If an output file with the same name exists, overwrite it.

  • units (str) – LAMMPS units style to be used with the outfile file.