from chemsh import *
from chemsh.utils import testutils

rohf_control = {
    "symmetry": """
    $symmetry d3d
        """,
    "closed_shells": """
    $closed shells
      a1g 1-3 ( 2 )
      a2u 1-2 ( 2 )
      eu 1 ( 2 )
""",
    "open_shells": """
    $open shells type=1
      eg 1 ( 1 )
""",
    "roothaan": """
    $roothaan 1
      a = 1 b = 2
""",
    "rohf": """
""",
}

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

# default: convergence='tightscf'
turbomole = TURBOMOLE(
    frag=o2,
    method="hf",
    basis="SVP",
    scftype="rohf",
    mult=3,
    rohf_control=rohf_control,
    convergence=10,
)

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

ecalc = sp.result.energy

# Taken from TURBOMOLE Manual
eref = -149.4774402753

testutils.validate(ecalc, eref)
