Ewalder.jl

A reference implementation for Ewald summation, which calculates the electrostatic energy of a periodic system.
Author SunnySuite
Popularity
1 Star
Updated Last
11 Months Ago
Started In
December 2022

Ewalder

Dev Build Status Coverage

A reference implementation for Ewald summation, which calculates the electrostatic energy of a periodic system.

  • Support for charges and dipoles.
  • Support for sheared volumes.
  • Tin foil boundary conditions.
  • Errors can be controlled to order $10^{-12}$.

Example

Calculate the Madelung constant for NaCl using its primitive cell.

import Ewalder

latvecs = [[1,1,0], [1,0,1], [0,1,1]]
pos = [[0,0,0], [1,1,1]]
charges = [1, -1]
sys = Ewalder.System(; latvecs, pos)
E = Ewalder.energy(sys; charges)
@assert E  -1.74756459

For more explanation, see the package documentation.

Usage examples are contained in Ewalder/test.

Used By Packages

No packages found.