gpridge.integrations.units ========================== .. py:module:: gpridge.integrations.units .. autoapi-nested-parse:: Conversions into the GPRidge oracle units. Positions are Angstrom, energies are eV, and forces are eV/Angstrom. The factors below are definitions, not fit parameters. The elementary charge and the Avogadro number are the exact SI values. One thermochemical calorie is 4.184 J, which is the calorie LAMMPS documents for ``units real``. One nanometre is 10 Angstrom. Attributes ---------- .. autoapisummary:: gpridge.integrations.units.ELEMENTARY_CHARGE_C gpridge.integrations.units.AVOGADRO_PER_MOL gpridge.integrations.units.THERMOCHEMICAL_CALORIE_J gpridge.integrations.units.NM_IN_ANGSTROM gpridge.integrations.units.ANGSTROM_IN_NM gpridge.integrations.units.EV_IN_KJ_PER_MOL gpridge.integrations.units.KJ_MOL_IN_EV gpridge.integrations.units.KCAL_MOL_IN_EV gpridge.integrations.units.METAL gpridge.integrations.units.REAL gpridge.integrations.units.KJ_NM Functions --------- .. autoapisummary:: gpridge.integrations.units.canonical_system gpridge.integrations.units.energy_to_eV gpridge.integrations.units.forces_to_eV_per_A gpridge.integrations.units.positions_to_A gpridge.integrations.units.positions_from_A Module Contents --------------- .. py:data:: ELEMENTARY_CHARGE_C :value: 1.602176634e-19 .. py:data:: AVOGADRO_PER_MOL :value: 6.02214076e+23 .. py:data:: THERMOCHEMICAL_CALORIE_J :value: 4.184 .. py:data:: NM_IN_ANGSTROM :value: 10.0 .. py:data:: ANGSTROM_IN_NM :value: 0.1 .. py:data:: EV_IN_KJ_PER_MOL :value: 96.48533212331002 .. py:data:: KJ_MOL_IN_EV :value: 0.010364269656262174 .. py:data:: KCAL_MOL_IN_EV :value: 0.043364104241800934 .. py:data:: METAL :value: 'metal' .. py:data:: REAL :value: 'real' .. py:data:: KJ_NM :value: 'kj_nm' .. py:function:: canonical_system(name: str) -> str Return ``metal``, ``real``, or ``kj_nm``. ``metal`` is eV and Angstrom (ASE, LAMMPS ``units metal``, and the GPRidge oracle). ``real`` is kcal/mol and Angstrom (LAMMPS ``units real``). ``kj_nm`` is kJ/mol and nanometres (GROMACS, OpenMM, and PLUMED's internal units). ``gromacs`` and ``openmm`` are names for ``kj_nm``. .. py:function:: energy_to_eV(value: float, system: str) -> float Convert one energy into eV. .. py:function:: forces_to_eV_per_A(forces, system: str) -> numpy.ndarray Convert a force array into eV/Angstrom. ``real`` keeps the Angstrom length, so only the energy factor is applied. ``kj_nm`` divides by 10 because one nanometre is 10 Angstrom and the force is an energy per length. .. py:function:: positions_to_A(positions, system: str) -> numpy.ndarray Convert positions into Angstrom. ``metal`` and ``real`` are already there. .. py:function:: positions_from_A(positions_A, system: str) -> numpy.ndarray Convert Angstrom positions into ``system`` length units.