#! Test parsed and exotic calls to energy() like zapt4, mp2.5, and cisd are working

memory 250 mb

molecule He2 {
0 1
He
He 1 1.0
}

set globals {
    basis 6-31g
    g_convergence gau
    mp2_type conv  # no fitting bases for helium
    scf_type pk  # no fitting bases for helium
    #df_scf_guess cc-pvdz-ri
    df_scf_guess false
}

set scf {
    e_convergence 8
}

set occ do_scs on

banner('gold standard')
energy('sherrill_gold_standard')
compare_values(-5.66406119, get_variable('CBS TOTAL ENERGY'), 7, "[1]  Au std")
clean()

#banner('scf')
#energy('SCF')
#compare_values(-5.551087929000, get_variable('SCF TOTAL ENERGY'), 7, "SCF sp")
#clean()

banner('mp2')
energy('mp2')
compare_values(-5.573453229993, get_variable('MP2 TOTAL ENERGY'), 7, "[2]  MP2 sp")
compare_values(-0.02232850726021, get_variable('MP2 OPPOSITE-SPIN CORRELATION ENERGY'), 7, "      MP2 route check") 
# this second check will fail if a request for a mp2 calc gets routed to detci, rather than the mp2 module
clean()

banner('mp3')
energy('mp3')
compare_values(-5.57903326861, get_variable('MP3 TOTAL ENERGY'), 7, '[3]  MP3 occ')
compare_values(-0.025155295755, get_variable('MP2.5 CORRELATION ENERGY'), 6, '      MP3 route check')
set reference uhf
set_variable('MP3 TOTAL ENERGY',0.0)
energy('mp3')
compare_values(-5.57903326861, get_variable('MP3 TOTAL ENERGY'), 7, '[4]  MP3 detci (energy and route check)')
set reference rhf
clean()

banner('mp4')
energy('mp4')
compare_values(-5.58040727035, get_variable('MP4 TOTAL ENERGY'), 7, '[5]  MP4 fnocc')
clean()

banner('mp11')
energy('mp11')
compare_values(-5.580830858501, get_variable('MP11 TOTAL ENERGY'), 7, "[6]  MP11 sp")
clean()

banner('zapt4')
energy('zapt4')
compare_values(-5.580407221960, get_variable('ZAPT4 TOTAL ENERGY'), 7, "[7]  ZAPT4 sp")
clean()

banner('fci')
energy('fci')
compare_values(-5.580830850570, get_variable('FCI TOTAL ENERGY'), 7, "[8]  FCI sp")
clean()

banner('mp2.5')
energy('mp2.5')
compare_values(-5.576243225099, get_variable('MP2.5 TOTAL ENERGY'), 7, "[9]  MP2.5 sp")
clean()

banner('cbs()')
set scf_type pk
cbs('scf',scf_basis='cc-pvdz')
compare_values(-5.55609846, get_variable('CBS TOTAL ENERGY'), 7, "[10] cbs()")
clean()

set globals {
    basis sto-3g
    df_basis_scf cc-pVDZ-JKFIT
    scf_type df
    e_convergence 8
}

# Try something other than scf
banner('db()')
database('scf','S22',subset=[2,8],benchmark='S22A')
clean()

set globals {
    basis 6-31g
    scf_type pk
}
banner('cisd')
energy('cisd',molecule=He2)
compare_values(-5.580709674676, get_variable('CISD TOTAL ENERGY'), 7, "[12] CISD sp")
clean()

#banner('opt(cbs())')
#optimize('scf',opt_func=cbs,scf_basis='sto-3g',scf_scheme=highest_1)
#compare_values(-5.615567415914, get_variable('SCF TOTAL ENERGY'), 6, 'opt(cbs())')
#clean()

banner('opt(arbitraryorder())')
optimize('mp3')
compare_values(-5.738452948227, get_variable('MP3 TOTAL ENERGY'), 5, '[13] opt(mp3())')

#molecule h2o {
#     O
#     H 1 1.0
#     H 1 1.0 2 104.5
#}

#set basis sto-3g

#energy('b3lyp-d')
#compare_values(-75.319769478, get_variable('CURRENT ENERGY'), 7, 'B3LYP-D2 sp')

