ase_interface
Full Documentation for hippynn.interfaces.ase_interface
package.
Click here for a summary page.
For using hippynn with the Atomic Simulation Environment (ASE)
- class AseDatabase(directory: str, name: str | List[str], inputs, targets, *args, quiet=False, allow_unfound=False, **kwargs)[source]
Bases:
Database
,Restartable
Database stored as ase database file(s) in a directory.
- Parameters:
directory – directory path where the ase database(s) is stored
name – name or list of names for files for ase databases.
This function loads an ase database(s) ({name}.json/.db) OR ({{name}.extxyz,.xyz}) variable db_name including all inputs and targets.
filenames should end with .json, .db, .extxyz, and .xyz, etc; Anything parsable by ase.io.load
Other arguments: See
Database
.- See: https://databases.fysik.dtu.dk/ase/ase/db/db.html for documentation
on typical columns present in ase database
- load_arrays(directory, filename, inputs, targets, quiet=False, allow_unfound=False)[source]
load arrays load ase database into hippynn database arrays
- Parameters:
directory – directory where database is stored
filename – file or path to file from directory
inputs
targets
quiet
allow_unfound
- Returns:
- class HippynnCalculator(*args: Any, **kwargs: Any)[source]
Bases:
Calculator
ASE calculator based on hippynn graphs. Uses ASE neighbor lists. Not suitable for domain decomposition.
- calculate(atoms=None, properties=None, system_changes=True)[source]
Accepts ‘properties’ and ‘system changes’ but ignores them, purely for compatibility with ASE base calculator
- calculation_required(atoms, properties=None, tol=1e-15)[source]
Returns true if: 1. A property in the list properties is not supported. 2. Atoms are different from stored atoms. This proceeds by short-circuit: * if this check is passed, compare using ase compare_atoms and tolerance tol. * slight difference from ASE implementation: if properties is a string then it is wrapped in a list.
- get_charges(atoms, allow_calculation=True, **kwargs)
- get_dipole(atoms, allow_calculation=True, **kwargs)
- get_dipole_moment(atoms, allow_calculation=True, **kwargs)
- get_energies(atoms, allow_calculation=True, **kwargs)
- get_energy(atoms, allow_calculation=True, **kwargs)
- get_forces(atoms, allow_calculation=True, **kwargs)
- get_free_energy(atoms, allow_calculation=True, **kwargs)
- get_magmom(atoms, allow_calculation=True, **kwargs)
- get_magmoms(atoms, allow_calculation=True, **kwargs)
- get_potential_energies(atoms, allow_calculation=True, **kwargs)
- get_potential_energy(atoms, allow_calculation=True, **kwargs)
- get_stress(atoms, allow_calculation=True, **kwargs)
- get_stresses(atoms, allow_calculation=True, **kwargs)
- calculator_from_model(model, **kwargs)[source]
Attempt to find the energy and charge nodes automatically.
- Parameters:
model –
GraphModule
for the model.kwargs – passed to
HippynnCalculator
Note
If your model has an energy node, but that is not the full energy for simulation, don’t use this function. Similarly for charge.
Submodules