File: test_aic.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (14 lines) | stat: -rw-r--r-- 440 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def test_aic():
    """Test Atomic Counter Ion calc forces."""
    import numpy as np
    from ase import Atoms
    from ase.calculators.counterions import AtomicCounterIon as ACI

    atoms = Atoms('2Na', positions=np.array([[0,0,0], [0,0,4]]))

    atoms.calc = ACI(1, 1.6642, 0.0001201186, rc=4.5) 
    f = atoms.get_forces()
    df = atoms.calc.calculate_numerical_forces(atoms, 1e-6) - f
    print(df)
    assert abs(df).max() < 2e-6