Tests

We build a series of tests to verify the programs we have written are correct.

Charge-charge

Use charge-charge interaction matrix to calculate the Madelung constans as a test to the program.

NaCl

‘tests/NaCl.py’.

See the notes for ‘CsCl’. For NaCl, the value is \(M_0=-0.8738\).

CsCl

‘tests/CsCl.py’.

Note

The value calculated here is per “ion”. For \(N\) pairs of ions,

\[U_{\textrm{coulomb}} = 2 N M_0 e^2/(4\pi\varepsilon_0)\]

where \(2M_0\) is the usual Madelung constant.

For CsCl, the value is \(M_0=-0.8813\), see The Journal of Chemical Physics, 34, 2004 (1961). Also see pp 40 of “Solid State Physics” by Lu Dong; Jiang Ping; Xu Zhizhong.

Dipole-dipole

‘tsets/dipole.py’.

The configuration can be found in Zhong et al (PRB, 52, 6301). Results for comparison is given by Nishimatsu et al in units of Z*^2/epsilon*a0^3 (Phys. Rev. B,82,134106 (2010).

k value
Gamma -2/3*pi
X1 4.84372
X5 -2.42186
M3 -2.67679
M5 1.33839
R25 0
Simga_Lo 2.93226

Displaced charges

‘tsets/displaced_ions.py’.

In this test, we set up a uniformly displaced charegs in a cubic lattice. An application of this type of interaction matrix will be shown in a later publications.

Charge-dipole

‘tsets/test_charge_dipole.py’.

One particular configuration is that

  1. The sign of charge alternates along z.
  2. Each dipole only has the p_z component, which also alternates along z.

The charge-dipole energy is easy to estimate. In the folder “tests/verify_charge-dipole”, we also have a program to directly calculate this value in real space. The result agrees with what we have obtained here using the charge-dipole interaction matrix.