1def test_aic(): 2 """Test Atomic Counter Ion calc forces.""" 3 import numpy as np 4 from ase import Atoms 5 from ase.calculators.counterions import AtomicCounterIon as ACI 6 7 atoms = Atoms('2Na', positions=np.array([[0, 0, 0], [0, 0, 4]])) 8 9 atoms.calc = ACI(1, 1.6642, 0.0001201186, rc=4.5) 10 f = atoms.get_forces() 11 df = atoms.calc.calculate_numerical_forces(atoms, 1e-6) - f 12 print(df) 13 assert abs(df).max() < 2e-6 14