Learn practical skills, build real-world projects, and advance your career

Ewald summation

# share by jovian
import numpy
from numpy.linalg import norm 
from scipy.special import erfc
from math import cos, sin, exp, pi, sqrt
from itertools import product
import jovian
[jovian] Updating notebook "sabg0430/ewaldsum-f4c50" on https://jovian.ai/ [jovian] Committed successfully! https://jovian.ai/sabg0430/ewaldsum-f4c50


  • Aim : Calculate potential energy of ion(ii) within unit cell. (periodic boundary condition)

    ϕ(i)=lIj=1nqjlri(rj+la)\phi(i) = \sum_{l \in I} \sum^{n}_{j=1} \frac{q^{l}_{j}}{\left| r_i -\left(r_j + la \right) \right|}
  • charge density
    qjl=(qjlρ(i,l))+ρ(i,l)q^l_j = \left( q^l_j -\rho(i,l) \right) +\rho(i,l)

    ϕ(i)=lIj=1n(qjlρ(i,l))+ρ(i,l)ri(rj+la)\phi(i) = \sum_{l \in I} \sum^{n}_{j=1} \frac{\left( q^l_j -\rho(i,l) \right) +\rho(i,l)}{\left| r_i -\left(r_j + la \right) \right|}

    ϕ(i)=ϕ1(i)+ϕ2(i)\to \phi(i) = \phi_1(i) + \phi_2(i)

The total potential are separated into two different but related potentials.