# 

from numpy        import array
from chemsh       import *
from chemsh.utils import testutils

water = Fragment(coords="water.cjson")


nwchem = NWChem(frag=water, method="hf", basis="3-21g")

sp = SP(theory=nwchem, gradients='2pfd', displace=1.0E-4)

sp.run()

gcalc = sp.result.gradients

# Test result
eref = -75.58528779
gref =  [[ 0.        ,  0.00190925,  0.        ],
         [ 0.01449362, -0.00095463,  0.        ],
         [-0.01449362, -0.00095463,  0.        ]]
gref = array(gref)

testutils.validate(gcalc, gref, tol=1.0E-5)
