Skip to content

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

License

Notifications You must be signed in to change notification settings

SunnySuite/Ewalder.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages