from itertools import combinations
def lennard_jones_energy(points):
total = 0.0
for a, b in combinations(points, 2):
r2 = sum((ai - bi) ** 2 for ai, bi in zip(a, b))
inv6 = r2 ** -3
total += 4 * (inv6 * inv6 - inv6)
return totalThe values for $n=2,3,4$ are exact by (2). The remaining values are transcribed from the Cambridge Cluster Database table [2] at the six decimal places printed by the source.
The generator recomputes the Lennard-Jones energy in (1) from the source coordinate archive [3] for every $3\leq n\leq150$ and checks that every recomputed coordinate energy is within $5\cdot10^{-6}$ of the printed value. It also checks that 125 of the 148 coordinate rows agree to the printed sixth decimal; among the others, the largest discrepancy from the printed value is less than $1.34\cdot10^{-6}$, caused by the rounded coordinates published in the archive.