# NWChem NO2 doublet unrestricted DFT (BLYP) single point energy

from chemsh       import *
from chemsh.utils import testutils

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

# default functional is 'blyp'
nwchem = NWChem(frag=no2, method="tddft", nstates=4, basis="3-21g", scftype="uhf", mult=2)

sp = SP(theory=nwchem, gradients=False)
sp.run()

# ground state
eref_0 = -203.894116307583
testutils.validate(sp.result.energy, eref_0)
# excited state 1
eref_1 = -203.797390610083
testutils.validate(sp.result.excitations['energies'][0], eref_1)
# excited state 2
eref_2 = -203.757461322490
testutils.validate(sp.result.excitations['energies'][1], eref_2)
# excited state 3
eref_3 = -203.742336650525
testutils.validate(sp.result.excitations['energies'][2], eref_3, tol=1e-5)
# excited state 4
eref_4 = -203.721068332890
testutils.validate(sp.result.excitations['energies'][3], eref_4)

