# LSDalton HF optimisation

from chemsh       import *
from chemsh.utils import testutils

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

# check lsdalton exists

lsdalton = LSDalton(frag=water, method="hf", basis="3-21G")

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

ecalc = opt.result.energy

# Test result from ChemShell 3
eref = -75.58595974


testutils.validate(ecalc, eref)
