gpridge.integrations.openmm_oracle

OpenMM Context as a GPRidge oracle.

OpenMM measures positions in nanometres, energy in kJ/mol, and forces in kJ/mol/nm. The context already holds a System and an Integrator. Each evaluation sets positions, recomputes virtual sites, and reads getState(energy=True, forces=True). It does not call step or applyConstraints.

The gradient is the derivative of the energy getState reports. Holonomic constraints are not projected. A particle whose mass is exactly 0 is fixed, which is how OpenMM tells an integrator to leave a particle in place, and it is added to the caller’s fixed mask. Virtual-site coordinates follow their parent particles; their force contributions are distributed to those parents by OpenMM.

When System.usesPeriodicBoundaryConditions() is false, the oracle cell is absent. The context is not closed by this class: Context has no close method. The caller keeps it alive until Oracle.close.

Classes

OpenMMOracle

Single-point energy and forces from one OpenMM context.

Module Contents

class gpridge.integrations.openmm_oracle.OpenMMOracle(reader, **kwargs)

Bases: gpridge.integrations.oracle.Oracle

Single-point energy and forces from one OpenMM context.

classmethod from_context(context, atomic_numbers, *, fixed=None, reference_positions_A=None, unit_module=None) → OpenMMOracle

Bind a live openmm.Context.

unit_module defaults to openmm.unit and is imported only on this path.

classmethod from_reader(reader, atomic_numbers, *, fixed=None, reference_positions_A=None) → OpenMMOracle

Bind a reader that already speaks nanometres and kJ/mol.