========== Python API ========== Names ----- The public names live in ``python/cpmdc``. Importing ``cpmdc`` does not import ASE. Import ``cpmdc.ase`` for ``CPMDCCalculator``. .. table:: +--------------------------------+--------------------------------------------------------------------+ | Name | Role | +================================+====================================================================+ | ``HARTREE_TO_EV`` | Hartree to eV, the constant in ``src/cpmdc.c`` | +--------------------------------+--------------------------------------------------------------------+ | ``BOHR_TO_ANGSTROM`` | Bohr to Angstrom, the constant in ``src/cpmdc_params.h`` | +--------------------------------+--------------------------------------------------------------------+ | ``CpmdcError`` | failure from the library or from loading it | +--------------------------------+--------------------------------------------------------------------+ | ``Evaluation`` | ``energy_h``, ``forces_h_bohr``, ``stress_h_bohr3`` | +--------------------------------+--------------------------------------------------------------------+ | ``Session`` | one ``CPMDCSession`` handle | +--------------------------------+--------------------------------------------------------------------+ | ``Session.energy_forces`` | one geometry, native units | +--------------------------------+--------------------------------------------------------------------+ | ``Session.version`` | ``cpmdc/`` and the version string | +--------------------------------+--------------------------------------------------------------------+ | ``Session.abi_version`` | numeric ABI generation | +--------------------------------+--------------------------------------------------------------------+ | ``Session.available`` | true when OpenCPMD is linked | +--------------------------------+--------------------------------------------------------------------+ | ``Session.close`` | destroy the handle | +--------------------------------+--------------------------------------------------------------------+ | ``Potential`` | rgpot-shaped provider over one session | +--------------------------------+--------------------------------------------------------------------+ | ``Potential.evaluate`` | eV, eV/Angstrom, optional stress | +--------------------------------+--------------------------------------------------------------------+ | ``Potential.caps`` | ``stress`` true, ``energies`` false | +--------------------------------+--------------------------------------------------------------------+ | ``Potential.close`` | close the owned session | +--------------------------------+--------------------------------------------------------------------+ | ``find_library`` | explicit path, then the three environment variables | +--------------------------------+--------------------------------------------------------------------+ | ``find_schema`` | ``CPMDC_SCHEMA`` or ``schema/Potentials.capnp`` | +--------------------------------+--------------------------------------------------------------------+ | ``forces_to_ev_per_angstrom`` | Hartree/Bohr forces to eV/Angstrom | +--------------------------------+--------------------------------------------------------------------+ | ``stress_to_ev_per_angstrom3`` | row-major Hartree/Bohr\ :sup:`3`\ tensor to eV/Angstrom\ :sup:`3`\ | +--------------------------------+--------------------------------------------------------------------+ | ``CPMDCCalculator`` | ASE calculator: energy, free\ :sub:`energy`\, forces, stress | +--------------------------------+--------------------------------------------------------------------+ | ``CPMDCCalculator.calculate`` | fills energy, free\ :sub:`energy`\, forces, and stress | +--------------------------------+--------------------------------------------------------------------+ | ``CPMDCCalculator.potential`` | the ``Potential`` the calculator owns | +--------------------------------+--------------------------------------------------------------------+ | ``CPMDCCalculator.close`` | close that potential | +--------------------------------+--------------------------------------------------------------------+ ``free_energy`` on ``CPMDCCalculator`` equals ``energy``. A repeated geometry returns the stored step. A null or empty input raises; it does not abort the interpreter.