# ORCA DFT (BLYP) single point energy

from chemsh       import *
from chemsh.utils import testutils

water = Fragment(coords='another_water.xyz')

# YL: this geometry optimisation converges only with "ExtremeSCF" and coordinates printed in float (instead of scientific_notation)
orca = ORCA(frag=water,
            method='ri-mp2',
            basis='def2-TZVPP',
            ri='def2/J def2-TZVPP/C RIJCOSX',
            sci_notation=False,
            threshold=1.0e-12)

opt = Opt(theory=orca,
          algorithm='lbfgs', trust_radius='energy',
          tolerance=0.00003, maxcycle=1000, maxene=1000, maxstep=1.0)

opt.run(dryrun=False)

ecalc = opt.result.energy

# standalone ORCA v5.0.3 TightOpt with TightSCF
eref = -76.32364235

testutils.validate(ecalc, eref)
