qimpy.grid.Coulomb
- class Coulomb(grid, n_ions)
Bases:
object
Coulomb interactions between fields and point charges. TODO: support non-periodic geometries (truncation).
- Parameters
grid (Grid) –
n_ions (int) –
- __init__(grid, n_ions)
Initialize coulomb interactions.
- Parameters
grid (Grid) – Fields for coulomb interaction will be on this grid.
n_ions (int) – Number of point charges to optimize Ewald sums for.
- Return type
None
Methods
Initialize coulomb interactions.
Compute Ewald energy, and optionally accumulate gradients.
Return stress due to Coulomb interaction between rho1 and rho2.
Update all members that depend on lattice vectors.
Attributes
Grid associated with fields for coulomb interaction
Ion-charge gaussian width for embedding and solvation
Ewald range-separation parameter
Ewald real-space mesh points
Ewald reciprocal-space mesh points
- ewald(positions, Z)
Compute Ewald energy, and optionally accumulate gradients. Each gradient contribution is accumulated to a grad attribute, only if the corresponding requires_grad is enabled. Force contributions are collected in positions.grad. Stress contributions are collected in self.grid.lattice.grad.
- Parameters
positions (Tensor) – Positions (fractional coordinates) of point charges
Z (Tensor) – Charges of each point charge
- Return type
float
- stress(rho1, rho2)
Return stress due to Coulomb interaction between rho1 and rho2. The result has dimensions of energy, appropriate for adding to lattice.grad.
- update_lattice_dependent(n_ions)
Update all members that depend on lattice vectors.
- Parameters
n_ions (int) –
- Return type
None
- iG: Tensor
Ewald reciprocal-space mesh points
- iR: Tensor
Ewald real-space mesh points
- ion_width: float
Ion-charge gaussian width for embedding and solvation
- sigma: float
Ewald range-separation parameter