gpridge.integrations.examples.harmonic_oracle

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

Functions

spring_energy_forces(positions_A, cell_A)

Pair energy in eV and forces in eV/Angstrom. cell_A is unused.

build_oracle(→ gpridge.integrations.Oracle)

Oracle for the reference geometry, with atom 0 fixed.

main(→ int)

Evaluate the oracle at its reference geometry and print the result.

Module Contents

gpridge.integrations.examples.harmonic_oracle.K_EV_PER_A2 = 2.0
gpridge.integrations.examples.harmonic_oracle.R0_A = 1.0
gpridge.integrations.examples.harmonic_oracle.REFERENCE_A
gpridge.integrations.examples.harmonic_oracle.spring_energy_forces(positions_A, cell_A)

Pair energy in eV and forces in eV/Angstrom. cell_A is unused.

gpridge.integrations.examples.harmonic_oracle.build_oracle() → gpridge.integrations.Oracle

Oracle for the reference geometry, with atom 0 fixed.

gpridge.integrations.examples.harmonic_oracle.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.