# ORCA DFT (BLYP) optimisation

from chemsh       import *
from chemsh.utils import testutils

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

# default: convergence='tightscf'
orca = ORCA(frag=water, method='dft', functional='blyp', basis='3-21g')

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

ecalc = opt.result.energy

# Tcl-ChemShell 3.7.1/ORCA 4.2.1 result
# convergence=normalscf
#eref = -75.951263039661
# convergence=tightscf
#eref = -75.951263002720
# ORCA 5.0.3
eref = -75.95125134


testutils.validate(ecalc, eref)
