PMEModel¶
- class torch_sim.models.electrostatics.PMEModel(cutoff=10.0, *, accuracy=1e-6, mesh_spacing=None, mesh_dimensions=None, spline_order=4, device=None, dtype=torch.float64, compute_forces=True, compute_stress=True, neighbor_list_fn=torchsim_nl)[source]¶
Bases:
ModelInterfaceParticle Mesh Ewald electrostatics as a
ModelInterface.Uses the
nvalchemiopsPME kernel for O(N log N) periodic electrostatics. Returns per-atom energies that are aggregated to per-system. All user-facing quantities are in metal units (Angstrom / eV).Per-atom partial charges are read from
state.partial_charges.Requires periodic boundary conditions.
- Parameters:
cutoff (float) – Real-space cutoff in Angstrom.
accuracy (float) – Target accuracy for auto-estimated parameters.
mesh_spacing (float | None) – Optional mesh spacing (Angstrom) for automatic mesh sizing.
mesh_dimensions (tuple[int, int, int] | None) – Explicit FFT mesh dimensions
(nx, ny, nz).spline_order (int) – B-spline interpolation order. Defaults to 4.
device (device | None) – Compute device. Defaults to CUDA if available, else CPU.
dtype (dtype) – Floating-point dtype. Defaults to
torch.float64.compute_forces (bool) – Whether to return forces. Defaults to True.
compute_stress (bool) – Whether to return stress. Defaults to True.
neighbor_list_fn (Callable) – Neighbor-list constructor. Defaults to
torchsim_nl.