md.System

class md.System(*args: Any, **kwargs: Any)[source]

Container for all properties associated with the simulated molecular system (masses, positions, momenta, …). Uses MD unit system defined in schnetpack.units internally.

In order to simulate multiple systems efficiently dynamics properties (positions, momenta, forces) are torch tensors with the following dimensions:

n_replicas x (n_molecules * n_atoms) x 3

Here n_replicas is the number of copies for every molecule. In a normal simulation, these are treated as independent molecules e.g. for sampling purposes. In the case of ring polymer molecular dynamics (using the RingPolymer integrator), these replicas correspond to the beads of the polymer. n_molecules is the number of different molecules constituting the system, these can e.g. be different initial configurations of the same system (once again for sampling) or completely different molecules. Atoms of multiple molecules are concatenated.

Static properties are stored in tensors of the shape:

n_atoms : n_molecules (the same for all replicas) masses : 1 x (n_molecules * n_atoms) x 1 (the same for all replicas) atom_types : (n_molecules * n_atoms) index_m : (n_molecules * n_atoms)

n_atoms contains the number of atoms present in every molecule, masses and atom_types contain the molcular masses and nuclear charges. index_m is an index for mapping atoms to individual molecules.

Finally a dictionary properties stores the results of every calculator call for easy access of e.g. energies and dipole moments.

Parameters:
  • device (str, torch.device) – Computation device (default=’cuda’).

  • precision (int, torch.dtype) – Precision used for floating point numbers (default=32).