torch version of ADMP is initialized by Zheng Cheng (AISI).
This package implements the PME method (for monopoles) and the QEq method in DMFF with PyTorch, allowing not only GPU-accelerated calculation of PME/QEq methods but also further customization and extension of other PyTorch-based models.
This package can be installed by:
git clone https://github.com/ChiahsinChu/torch-admp
pip install torch-admp
For the unit tests, you can install the package with the following command:
git clone https://github.com/ChiahsinChu/torch-admp
pip install torch-admp[test]
- Add doc for usage
- Add unittest for QEq v.s. RuNNer
from torch_admp.qeq import QEqAllForceModule
from torch_admp.pme import setup_ewald_parameters
kappa, kx, ky, kz = setup_ewald_parameters(rcut, box)
module = QEqAllForceModule(q0, chi, hardness, eta, rcut, kappa, (kx, ky, kz))
jit_module = torch.jit.script(module)
out = jit_module(positions, box)
Notation | Description | Unit |
---|---|---|
charge of atom |
charge | |
z-coordinate of atom |
length | |
length of the simulation box in z-direction | length | |
V | volume of supercell | length |
Ewald screening parameter | length |
|
Gaussian width of atom |
length |
Coulomb interaction [ref]
For non-periodic systems, the Coulomb interaction can be calculated directly:
For periodic systems, we consider the Ewald summation under 3D-PBC:
The real space interaction:
The reciprocal interaction:
where the structural factor
The self interaction:
Non-neutral correction (only with which the energy from 3D Ewald summation is independent with
Gaussian damping [ref]
DampingForceModule
While the standard Ewald summation is used to calculate the electrostatic interactions between point charges, an additional Gaussian damping term can be applied to adapt the Ewald summation for the Gaussian charges. The damping term is, in fact, a modification of interactions in the real space:
where
Slab correction [ref]
SlabCorrForceModule
When aiming for 2D periodic boundary conditions, the slab correction can be appiled [ref]:
This is done by treating the system as if it were periodic in z, but inserting empty volume between atom slabs and removing dipole inter-slab interactions so that slab-slab interactions are effectively turned off.
The energy for slab correction is given by:
where
Unlike lammps, where the empty volume can be inserted internally by the program, the users of this package are expected to insert vacuum with sufficient thickness when building the models to avoid interactions between slabs. Empirically, the thickness of the vacuum is suggested to be twice of the slab thickness.
Chemical interaction [ref]
SiteForceModule
In the QEq model, not only the electrostatic interaction but the chemical interaction are considered: