sponge.function.coulomb_interaction
- sponge.function.coulomb_interaction(q_i: Tensor, q_j: Tensor, r_ij: Tensor, mask: Tensor = None, coulomb_const: float = 1)[source]
Calculate Coulomb interaction.
Math:
\[E_{coulomb}(r_{ij}) = k \frac{q_i q_j}{r_{ij}}\]- Parameters
q_i (Tensor) – Tensor of shape (…). Data type is float. Charge of the \(i\)-th atom \(q_i\).
q_j (Tensor) – Tensor of shape (…). Data type is float. Charge of the \(j\)-th atom \(q_j\).
r_ij (Tensor) – Tensor of shape (…). Data type is float. Distance \(r_{ij}\) between atoms \(i\) and \(i\).
mask (Tensor) – Tensor of shape (…). Data type is bool. Mask for distance \(r_{ij}\). Default:
None
.coulomb_const (float) – Coulomb constant \(k\). Default: 1
- Returns
E_coulomb (Tensor), Tensor of shape (…). Data type is float.
- Supported Platforms:
Ascend
GPU