espressomd.plugins package

Submodules

espressomd.plugins.ase module

class espressomd.plugins.ase.ASEInterface(system: System, type_mapping: dict | None, particle_slice: ParticleSlice, export_charges: bool = False, export_masses: bool = False, export_momenta: bool = False, assume_constant_charges: bool = False, assume_constant_masses: bool = False, assume_constant_types: bool = False, use_folded_positions: bool = True)[source]

Bases: object

Interface for ASE [Hjorth Larsen et al., 2017] with calculator support.

integrate(steps: int, calculator) int[source]

Integrate the system for the specified number of steps.

For each step:

  1. Update ASE with current particle data

  2. Get forces from calculator

  3. Set external forces on particles

  4. Run one integration step

Since the particle property ext_force is updated at every time step, cache invalidation is inevitable, and the symplectic Euler method is needed to conserve momentum (espressomd.integrate.SymplecticEuler).

Parameters:
  • steps (int) – Number of integration steps to perform.

  • calculator (ase.calculators.calculator.Calculator) – ASE calculator to use for force calculations.

Returns:

Number of steps actually performed

Return type:

int

reset()[source]

Re-create the ASE atoms object using ESPResSo system properties.

New ASE atom objects are created from the current particle slice with positions, types, periodicity and box dimensions. If export flags are set, charges, masses, and/or momenta are also initialized. If type_mapping is None, atoms are created without symbols.

set_slice(particles)[source]

Set the slice of particles to work on. This results in the re-creation of the ASE atom objects.

update_ase()[source]

Update the arrays in the atom objects based on the desired properties.

The assume_constant_* flags determine which properties to update.

Module contents