gpridge.integrations.examples.harmonic_oracle ============================================= .. py:module:: gpridge.integrations.examples.harmonic_oracle .. autoapi-nested-parse:: Two-atom spring in the oracle layout. Atom 0 is fixed at the origin. Atom 1 starts at 1.25 Angstrom on x. The spring constant is 2 eV/Angstrom^2 and the rest length is 1 Angstrom. The energy at that geometry is 0.0625 eV. The gradient on atom 1 is 0.5 eV/Angstrom along x. The gradient on atom 0 is 0 because that atom is fixed, after the evaluator has computed the pair force. Run this module with ``gpridge`` on ``PYTHONPATH``. The process status is 0 when the three printed values match those figures. Energy is in eV and the gradient is in eV/Angstrom. Attributes ---------- .. autoapisummary:: gpridge.integrations.examples.harmonic_oracle.K_EV_PER_A2 gpridge.integrations.examples.harmonic_oracle.R0_A gpridge.integrations.examples.harmonic_oracle.REFERENCE_A Functions --------- .. autoapisummary:: gpridge.integrations.examples.harmonic_oracle.spring_energy_forces gpridge.integrations.examples.harmonic_oracle.build_oracle gpridge.integrations.examples.harmonic_oracle.main Module Contents --------------- .. py:data:: K_EV_PER_A2 :value: 2.0 .. py:data:: R0_A :value: 1.0 .. py:data:: REFERENCE_A .. py:function:: spring_energy_forces(positions_A, cell_A) Pair energy in eV and forces in eV/Angstrom. ``cell_A`` is unused. .. py:function:: build_oracle() -> gpridge.integrations.Oracle Oracle for the reference geometry, with atom 0 fixed. .. py:function:: main() -> int Evaluate the oracle at its reference geometry and print the result. Returns 0 when the energy and gradient equal the known values for the spring (0.0625 eV and 0.5 eV/Angstrom on atom 1 along x), 1 otherwise.