gpridge.integrations.lammps_oracle ================================== .. py:module:: gpridge.integrations.lammps_oracle .. autoapi-nested-parse:: LAMMPS Python instance as a GPRidge oracle. The instance has already executed its unit style, atom style, box, pair style, and ``atom_modify map yes`` (or ``map array`` / ``map hash``). This class does not read an input file. Each evaluation scatters positions in the caller's atom order, runs the command ``run 0``, and reads ``get_thermo("pe")`` plus forces. ``gather_atoms_subset`` and ``scatter_atoms_subset`` take ``dtype`` 1 (double) and ``count`` 3. The id list is the caller's atom order, so LAMMPS ids do not have to be ``1..N`` and do not have to be consecutive. The LAMMPS manual restricts these calls: an atom map is enabled, the build is not ``-DLAMMPS_BIGBIG``, and the atom count fits in a signed 32-bit integer. Ids passed here are unique and inside that range. ``units metal`` is already eV and Angstrom. ``units real`` converts kcal/mol and kcal/mol/Angstrom. Both styles measure length in Angstrom. Other LAMMPS unit styles are rejected. A non-periodic box stays on ``container_A`` and is not sent as the GPRidge cell. A periodic box is the triclinic cell with rows ``a, b, c``. ``owns`` defaults to false: ``close`` drops this oracle and leaves the LAMMPS instance open. One instance serves one thread. Classes ------- .. autoapisummary:: gpridge.integrations.lammps_oracle.LammpsOracle Module Contents --------------- .. py:class:: LammpsOracle(instance, *, atom_ids, units: str, container_A: numpy.ndarray, owns: bool = False, **kwargs) Bases: :py:obj:`gpridge.integrations.oracle.Oracle` One serial LAMMPS instance, evaluated with ``run 0``. .. py:property:: units :type: str .. py:property:: atom_ids :type: numpy.ndarray .. py:property:: container_A :type: numpy.ndarray LAMMPS box in Angstrom, including a non-periodic container. .. py:method:: from_instance(instance, *, atom_ids, atomic_numbers, units: str, fixed=None, reference_positions_A=None, owns: bool = False) -> LammpsOracle :classmethod: Bind a live ``lammps.lammps`` instance. The import of ``lammps`` is left to the caller, who constructed ``instance``. ``units`` is ``metal`` or ``real``.