gpridge._adapters

Adapters for external potential energy surface packages.

Functions

ase_potential(atoms)

Create a potential callback from an ASE Atoms object.

atoms_config_from_ase(atoms[, frozen_indices])

Create an AtomsConfiguration from an ASE Atoms object.

observation_from_ase(atoms_list)

Create an Observation from a list of ASE Atoms objects.

Module Contents

gpridge._adapters.ase_potential(atoms)

Create a potential callback from an ASE Atoms object.

The returned callable has the signature expected by PotentialWrapper:

fn(positions, atomic_numbers, forces, box) -> energy

The Atoms object is updated in-place on every call (positions and cell are overwritten), so the same object can be inspected after the search completes.

Parameters:

atoms (ase.Atoms) – An ASE Atoms object with a calculator attached. The calculator must support get_potential_energy() and get_forces().

Returns:

potential_fn – A function suitable for passing to PotentialWrapper or run_dimer().

Return type:

callable

Raises:

Examples

>>> from ase.build import molecule
>>> from ase.calculators.emt import EMT
>>> h2 = molecule("H2")
>>> h2.calc = EMT()
>>> pot_fn = ase_potential(h2)
gpridge._adapters.atoms_config_from_ase(atoms, frozen_indices=None)

Create an AtomsConfiguration from an ASE Atoms object.

Parameters:
  • atoms (ase.Atoms) – ASE Atoms object.

  • frozen_indices (array-like of int, optional) – Indices of atoms to mark as frozen. If None, all atoms are treated as moving.

Returns:

atoms_config

Return type:

AtomsConfiguration

gpridge._adapters.observation_from_ase(atoms_list)

Create an Observation from a list of ASE Atoms objects.

Each Atoms object supplies energy and forces via atoms.get_potential_energy() / atoms.get_forces().

Parameters:

atoms_list (list of ase.Atoms) – Atoms objects with calculators attached.

Returns:

obs

Return type:

Observation