EwaldModel¶
- class torch_sim.models.electrostatics.EwaldModel(cutoff=10.0, *, accuracy=1e-6, device=None, dtype=torch.float64, compute_forces=True, compute_stress=True, neighbor_list_fn=torchsim_nl)[source]¶
Bases:
ModelInterfaceClassical Ewald summation as a
ModelInterface.Uses the
nvalchemiopsEwald kernel for exact 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 Ewald parameters.
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.