# Gaussian NO2 doublet ROHF optimisation

from chemsh       import *
from chemsh.utils import testutils

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

gaussian = Gaussian(frag=no2, method="hf", basis="3-21g", scftype="rohf", mult=2, threshold=1E-10)

opt = Opt(theory=gaussian,
          algorithm="lbfgs", tolerance=0.0003, trust_radius="energy",
          maxcycle=100, maxene=100, maxstep=1.0)
          
opt.run()

ecalc = opt.result.energy

# Test result from Tcl-ChemShell
# NWChem
eref = -202.836355692611
# Tcl-ChemShell/Gaussian09
eref = -202.836355746000

testutils.validate(ecalc, eref)
