gpridge.integrations.openmm_oracle ================================== .. py:module:: gpridge.integrations.openmm_oracle .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: gpridge.integrations.openmm_oracle.OpenMMOracle Module Contents --------------- .. py:class:: OpenMMOracle(reader, **kwargs) Bases: :py:obj:`gpridge.integrations.oracle.Oracle` Single-point energy and forces from one OpenMM context. .. py:method:: from_context(context, atomic_numbers, *, fixed=None, reference_positions_A=None, unit_module=None) -> OpenMMOracle :classmethod: Bind a live ``openmm.Context``. ``unit_module`` defaults to ``openmm.unit`` and is imported only on this path. .. py:method:: from_reader(reader, atomic_numbers, *, fixed=None, reference_positions_A=None) -> OpenMMOracle :classmethod: Bind a reader that already speaks nanometres and kJ/mol.