gpridge.ase_bridge¶
ASE overlay helpers for gpridge step / compute surface.
Geometry and oracle wiring shared by GPNEB,
gpridge.session, and optional pyeonclient bridges.
Typical path:
from gpridge.ase_bridge import (
path_matrix_from_images,
neb_oracle_from_calculator,
apply_gpneb_result,
)
Attributes¶
Signature of an oracle. It takes flat positions and returns the energy and the flat gradient. |
Functions¶
|
Create an |
|
Create an |
Import ASE or raise with install hint. |
|
|
Stack ASE Atoms positions into (n_images, 3*n_atoms) float64. |
|
Write path matrix rows into ASE Atoms positions (and optional energy info). |
|
Build ASE image list from endpoints via C++ path init. |
|
Build |
|
|
|
Push |
|
Build and fully initialize |
Module Contents¶
- gpridge.ase_bridge.atoms_config_from_ase(atoms, frozen_indices=None)¶
Create an
AtomsConfigurationfrom an ASEAtomsobject.- Parameters:
- Returns:
atoms_config
- Return type:
- gpridge.ase_bridge.observation_from_ase(atoms_list)¶
Create an
Observationfrom a list of ASEAtomsobjects.Each Atoms object supplies energy and forces via
atoms.get_potential_energy()/atoms.get_forces().
- gpridge.ase_bridge.ase_potential¶
- gpridge.ase_bridge.OracleFn¶
Signature of an oracle. It takes flat positions and returns the energy and the flat gradient.
- gpridge.ase_bridge.require_ase()¶
Import ASE or raise with install hint.
- gpridge.ase_bridge.path_matrix_from_images(images: Sequence[Any]) numpy.ndarray¶
Stack ASE Atoms positions into (n_images, 3*n_atoms) float64.
- gpridge.ase_bridge.apply_path_matrix(images: Sequence[Any], path: numpy.ndarray, *, energies: Sequence[float] | None = None) None¶
Write path matrix rows into ASE Atoms positions (and optional energy info).
- gpridge.ase_bridge.images_from_endpoints(reactant: Any, product: Any, n_intermediate: int, *, path_method: str = 'idpp', spring_constant: float = 0.1, sidpp_alpha: float = 0.33) List[Any]¶
Build ASE image list from endpoints via C++ path init.
- Parameters:
reactant – ASE Atoms (or objects with get_positions / copy / set_positions).
product – ASE Atoms (or objects with get_positions / copy / set_positions).
n_intermediate – Number of interior images (excluding endpoints).
path_method – linear | idpp | idpp_collective | sidpp | sidpp_geodesic.
- gpridge.ase_bridge.neb_oracle_from_calculator(template: Any, calculator: Any, *, gp: Any = None, observers: Any = None) OracleFn¶
Build
(positions_flat) -> (energy, gradient)forgp_neb/run_ocineb.Gradient is
-forces(C++ NEB convention). When gp is given, each evaluation is appended viagp.add_evaluated_observation. When observers (agpridge._observers.OracleObservers) is given, each evaluation is reported to it.
- gpridge.ase_bridge.dimer_force_fn_from_calculator(template: Any, calculator: Any, *, gp: Any = None, observers: Any = None)¶
PotentialWrappercallback: writes forces in place, returns energy.gp and observers receive each evaluation as in
neb_oracle_from_calculator().
- gpridge.ase_bridge.apply_gpneb_result(images: Sequence[Any], result: Any) None¶
Push
GPNEBResultgeometries and energies into ASE images.
- gpridge.ase_bridge.make_atoms_configuration(atoms: Any, *, gp_params: dict | None = None, frozen_indices=None)¶
Build and fully initialize
AtomsConfigurationfor gp_neb.