Here I implement in python3 a calculation of Madelung constant of NaCl with the method of expanding cubes :
(Gaio and Silvestrelli, Phys. Rev. B 79, 012102 (2009)).
To run the script in a python3 environment, type the following in the terminal:
python expanding-cube.py N
where
This script hence calculates
This work is based on a school project that I first implemented in Wolfram Mathematica in 2020.
Therefore, this python script is probably not so efficient for experienced users.
I am still learning, so I appreciate your kind understanding and guidance.
Thank you very much for visiting this page.