from chemsh import *
from chemsh.utils import testutils

carbon = Fragment(coords='carbon.cjson')

# By default cp2k.sopt is run, others can be specified using the path option
# To
cp2k = CP2K(frag=carbon,
            functional='PBE',
            basis='DZVP-GTH-PADE')

# Options for specifying different forms of CP2K execution (default: cp2k.sopt)
#            path='cp2k.psmp',
#            sysmpi='mpirun -np 2',

sp = SP(theory=cp2k, gradients=True).run()

ecalc = sp.result.energy

# Regression test reference using CP2K 2022.2
eref = -5.004703937427

testutils.validate(ecalc, eref)
