gpridge.integrations.units

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

Functions

canonical_system(→ str)

Return metal, real, or kj_nm.

energy_to_eV(→ float)

Convert one energy into eV.

forces_to_eV_per_A(→ numpy.ndarray)

Convert a force array into eV/Angstrom.

positions_to_A(→ numpy.ndarray)

Convert positions into Angstrom. metal and real are already there.

positions_from_A(→ numpy.ndarray)

Convert Angstrom positions into system length units.

Module Contents

gpridge.integrations.units.ELEMENTARY_CHARGE_C = 1.602176634e-19
gpridge.integrations.units.AVOGADRO_PER_MOL = 6.02214076e+23
gpridge.integrations.units.THERMOCHEMICAL_CALORIE_J = 4.184
gpridge.integrations.units.NM_IN_ANGSTROM = 10.0
gpridge.integrations.units.ANGSTROM_IN_NM = 0.1
gpridge.integrations.units.EV_IN_KJ_PER_MOL = 96.48533212331002
gpridge.integrations.units.KJ_MOL_IN_EV = 0.010364269656262174
gpridge.integrations.units.KCAL_MOL_IN_EV = 0.043364104241800934
gpridge.integrations.units.METAL = 'metal'
gpridge.integrations.units.REAL = 'real'
gpridge.integrations.units.KJ_NM = 'kj_nm'
gpridge.integrations.units.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.

gpridge.integrations.units.energy_to_eV(value: float, system: str) → float

Convert one energy into eV.

gpridge.integrations.units.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.

gpridge.integrations.units.positions_to_A(positions, system: str) → numpy.ndarray

Convert positions into Angstrom. metal and real are already there.

gpridge.integrations.units.positions_from_A(positions_A, system: str) → numpy.ndarray

Convert Angstrom positions into system length units.