Exemplo n.º 1
0
def check_uhf_hf(return_value):
    ref = -55.566057523877
    nre = 7.580905897627

    assert compare_values(ref, qcdb.get_variable('HF TOTAL ENERGY'), 5, 'scf')
    assert compare_values(nre, qcdb.get_variable('NUCLEAR REPULSION ENERGY'),
                          5, 'nre')
Exemplo n.º 2
0
def test_sp_uhf_ccsd(nh2):
    """cfour/sp-uhf-ccsd/input.dat
    #! single-point CCSD/qz2p on NH2

    """
    nh2 = qcdb.set_molecule(nh2)
    qcdb.set_options({
        #'cfour_CALC_level': 'CCSD',
        'cfour_BASIS': 'qz2p',
        'cfour_REFerence': 'UHF',
        'cfour_occupation': [[3, 1, 1, 0], [3, 0, 1, 0]],
        'cfour_SCF_CONV': 12,
        'cfour_CC_CONV': 12,
    })

    qcdb.energy('c4-ccsd', molecule=nh2)

    scftot = -55.5893469688
    mp2tot = -55.784877360093
    ccsdcorl = -0.213298055172
    tnm = sys._getframe().f_code.co_name
    assert compare_values(scftot, qcdb.get_variable('scf total energy'), 6,
                          tnm + 'SCF')
    assert compare_values(mp2tot, qcdb.get_variable('mp2 total energy'), 6,
                          tnm + 'MP2')
    assert compare_values(ccsdcorl,
                          qcdb.get_variable('ccsd correlation energy'), 6,
                          tnm + 'CCSD')
Exemplo n.º 3
0
def test_sp_rhf_ccsd_ao(h2o):
    """cfour/sp-rhf-ccsd-ao/input.dat 
    #! single point CCSD/qz2p on water

    """
    h2o = qcdb.set_molecule(h2o)
    qcdb.set_options({
        #'cfour_CALC_level': 'CCSD',
        'cfour_BASIS': 'qz2p',
        'cfour_abcdtype': 'aobasis',
        'cfour_SCF_CONV': 12,
        'cfour_CC_CONV': 12
    })

    e, jrec = qcdb.energy('c4-ccsd', return_wfn=True, molecule=h2o)

    scftot = -76.062748460117
    mp2tot = -76.332940127333
    ccsdcorl = -0.275705491773
    ccsdtot = -76.338453951890
    tnm = sys._getframe().f_code.co_name
    assert compare_values(scftot, qcdb.get_variable('scf total energy'), 6,
                          tnm + 'SCF')
    assert compare_values(mp2tot, qcdb.get_variable('mp2 total energy'), 6,
                          tnm + 'MP2')
    assert compare_values(ccsdcorl,
                          qcdb.get_variable('ccsd correlation energy'), 6,
                          tnm + 'CCSD corl')
    assert compare_values(ccsdtot, qcdb.get_variable('ccsd total energy'), 6,
                          tnm + 'CCSD')
Exemplo n.º 4
0
def test_tu1_symmetry():
    """tu1-h2o-energy/input.dat
    global testing

    """
    h2o = qcdb.set_molecule("""
  O 
  H 1 1.8
  H 1 1.8 2 104.5
  units au
""")
    print(h2o)
    print(qcdb.get_active_options().print_changed())

    qcdb.set_options({'basis': 'cc-pVDZ', 'memory': '600 mb'})

    qcdb.energy('gms-hf')
    print(qcdb.print_variables())

    print(qcdb.get_variable('THE POINT GROUP OF THE MOLECULE'))
    #    assert compare_values(_ref_h2o_pk_rhf, qcdb.get_variable('THE POINT GROUP OF THE MOLECULE'), 6, sys._getframe().f_code.co_name)
    assert compare_values(_ref_h2o_pk_rhf,
                          qcdb.get_variable('HF TOTAL ENERGY'), 6,
                          sys._getframe().f_code.co_name)
    assert 0
Exemplo n.º 5
0
def test_6b():
    h2 = system1()
    refene = test6_ene
    tnm = sys._getframe().f_code.co_name + " [6] MP2/cc-pV[TQ]Z Optimized R"
    assert compare_values(0.529177208590000 * a2a,
                          h2.nuclear_repulsion_energy(), 9,
                          "Nuclear repulsion energy")

    ene, jrec = qcdb.optking('c4-MP2/cc-pV[TQ]Z', return_wfn=True, molecule=h2)
    assert compare_values(refene, ene, 6, tnm)
    assert compare_values(refene, jrec['qcvars']['CURRENT ENERGY'].data, 4,
                          tnm)
    assert compare_values(refene, qcdb.get_variable('CURRENT ENERGY'), 4, tnm)
    assert compare_values(
        0.0,
        np.sqrt(np.mean(np.square(jrec['qcvars']['CURRENT GRADIENT'].data))),
        4, tnm)
    assert compare_values(
        0.0,
        np.sqrt(np.mean(np.square(qcdb.get_variable('CURRENT GRADIENT')))), 4,
        tnm)
    assert compare_values(test6_R, h2.R, 4, tnm)
    #print(jrec['provenance'])

    tnm = sys._getframe().f_code.co_name + " [7] CI2/cc-pV[DT]Z Optimized R"
Exemplo n.º 6
0
def test_sp_rhf_scf_b():
    """cfour/sp-rhf-scf/input.dat 
    #! single-point HF/qz2p on water

    """
    h2o = qcdb.set_molecule("""
        O
        H 1 R
        H 1 R 2 A
        
        R=0.958
        A=104.5
    """)

    qcdb.set_options({
        'cfour_calc_level': 'hf',
        'cfour_basis': 'qz2p',
        'cfour_scf_conv': 12
    })

    e, jrec = qcdb.energy('c4-cfour', return_wfn=True)

    ans = -76.0627484601
    tnm = sys._getframe().f_code.co_name
    assert compare_values(ans, qcdb.get_variable('scf total energy'), 6,
                          tnm + ' SCF')
    assert compare_values(ans, qcdb.get_variable('current energy'), 6,
                          tnm + ' SCF')
    assert compare_values(ans, jrec['qcvars']['SCF TOTAL ENERGY'].data, 6, tnm)
    assert compare_values(ans, jrec['qcvars']['CURRENT ENERGY'].data, 6, tnm)
Exemplo n.º 7
0
def test_sp_uhf_scf():
    """cfour/sp-uhf-scf/input.dat
    UHF-SCF energy calculation
    #global testing

    """
    nh2 = qcdb.set_molecule("""
        0 2
        N
        H 1 R
        H 1 R 2 A
        
        R=1.008
        A=105.0
    """)

    qcdb.set_options({
        #'cfour_CALC_level': 'HF',
        'cfour_BASIS': 'qz2p',
        'cfour_REFerence': 'UHF',
        'cfour_occupation': [[3, 1, 1, 0], [3, 0, 1, 0]],
        'cfour_SCF_CONV': 12
    })

    qcdb.energy('c4-hf')

    ans = -55.5893469688
    tnm = sys._getframe().f_code.co_name
    assert compare_values(ans, qcdb.get_variable('scf total energy'), 6,
                          tnm + 'SCF')  #TEST
    assert compare_values(ans, qcdb.get_variable('current energy'), 6,
                          tnm + 'Current')  #TEST
    assert compare_values(ans, qcdb.get_variable('current reference energy'),
                          6, tnm + 'Current ref')  #TEST
Exemplo n.º 8
0
def check_mp2(return_value, is_df):
    if is_df:
        ref = -76.026760737428
        one = -123.137568018334
        two = 37.923473040741
        mp2_total = -76.230777733733
        scs_mp2_total = -76.226922314540
    else:
        ref = -76.026760737428
        one = -123.137568018334
        two = 37.923473040741
        mp2_total = -76.230777733733
        scs_mp2_total = -76.226922314540

    assert compare_values(ref, qcdb.get_variable('Total SCF energy'), 5,
                          'scf total')
    assert compare_values(one, qcdb.get_variable('One-electron energy'), 5,
                          'one electron scf energy')
    assert compare_values(two, qcdb.get_variable('Two-electron energy'), 5,
                          'two electron scf energy')
    assert compare_values(mp2_total, qcdb.get_variable('Total MP2 energy'), 5,
                          'mp2 energy')
    assert compare_values(scs_mp2_total,
                          qcdb.get_variable('Total SCS-MP2 energy'), 5,
                          'scs-mp2 energy')
Exemplo n.º 9
0
def test_sp_rhf_mp2(h2o):
    """cfour/sp-rhf-mp2/input.dat 
    #! single-point MP2/qz2p on water

    """
    h2o = qcdb.set_molecule(h2o)
    qcdb.set_options({'cfour_BASIS': 'qz2p', 'd_convergence': 12})

    e, jrec = qcdb.energy('c4-mp2', return_wfn=True, molecule=h2o)

    scftot = -76.0627484601
    mp2corl = -0.270191667216
    mp2tot = -76.332940127333
    tnm = sys._getframe().f_code.co_name
    assert compare_values(scftot, qcdb.get_variable('scf total energy'), 6,
                          tnm + ' SCF')
    assert compare_values(mp2corl, qcdb.get_variable('mp2 correlation energy'),
                          6, tnm + ' MP2 corl')
    assert compare_values(mp2tot, qcdb.get_variable('mp2 total energy'), 6,
                          tnm + ' MP2')
    assert compare_values(scftot, jrec['qcvars']['HF TOTAL ENERGY'].data, 6,
                          tnm)
    assert compare_values(mp2corl,
                          jrec['qcvars']['MP2 CORRELATION ENERGY'].data, 6,
                          tnm)
    assert compare_values(mp2tot, jrec['qcvars']['CURRENT ENERGY'].data, 6,
                          tnm)
Exemplo n.º 10
0
def test_sp_rohf_mp2_sc(nh2):

    nh2 = qcdb.set_molecule(nh2)
    qcdb.set_options({
        #cfour_CALC_level=MP2
        'cfour_BASIS': 'qz2p',
        'cfour_REFerence': 'ROHF',
        'cfour_OCCUPATION': [[3, 1, 1, 0], [3, 0, 1, 0]],
        'cfour_SCF_CONV': 12,
        'cfour_CC_CONV': 12
    })

    qcdb.energy('c4-mp2', molecule=nh2)

    scftot = -55.5847372601
    scorl = -0.002983751786
    oscorl = -0.155770420921
    sscorl = -0.041785354569
    mp2corl = -0.200539527276
    mp2tot = -55.785276787341
    tnm = sys._getframe().f_code.co_name
    assert compare_values(scftot, qcdb.get_variable('scf total energy'), 6,
                          tnm + ' SCF')
    assert compare_values(scorl, qcdb.get_variable('mp2 singles energy'), 6,
                          tnm + ' MP2 singles')
    # non printed assert compare_values(oscorl, qcdb.get_variable('mp2 opposite-spin correlation energy'), 6, tnm + ' MP2 OS corl')
    # not printed assert compare_values(sscorl, qcdb.get_variable('mp2 same-spin correlation energy'), 6, tnm + ' MP2 SS corl')
    assert compare_values(mp2corl, qcdb.get_variable('mp2 correlation energy'),
                          6, tnm + ' MP2 corl')
    assert compare_values(mp2corl - scorl,
                          qcdb.get_variable('mp2 doubles energy'), 6,
                          tnm + ' MP2 corl')
    assert compare_values(mp2tot, qcdb.get_variable('mp2 total energy'), 6,
                          tnm + ' MP2')
Exemplo n.º 11
0
def test_2a():
    system1()
    lbl = "[2a] SCF/cc-pVDZ, Psi4, dertype=1"

    scf_dz, jrec = qcdb.hessian('SCF/cc-pVDZ', return_wfn=True, hess_dertype=1)
    print('HESS OUT')
    print(scf_dz)
    assert compare_arrays(ref_hess_scf_dz, scf_dz, 6, lbl)
    assert compare_arrays(ref_hess_scf_dz,
                          qcdb.get_variable('CURRENT HESSIAN'), 6, lbl)
    assert compare_arrays(ref_hess_scf_dz,
                          jrec['qcvars']['CURRENT HESSIAN'].data, 6, lbl)
    assert compare_arrays(ref_scf_dz, jrec['qcvars']['CURRENT GRADIENT'].data,
                          6, lbl)
    assert compare_arrays(ref_scf_dz, qcdb.get_variable('CURRENT GRADIENT'), 6,
                          lbl)
    assert compare_values(ref_e_scf_dz, jrec['qcvars']['CURRENT ENERGY'].data,
                          6, lbl)
    assert compare_values(ref_e_scf_dz, qcdb.get_variable('CURRENT ENERGY'), 6,
                          lbl)
    #    assert compare_arrays(ref_hess_scf_dz, jrec['qcvars']['HF TOTAL HESSIAN'].data, 6, lbl)
    #    assert compare_arrays(ref_scf_dz, jrec['qcvars']['HF TOTAL GRADIENT'].data, 6, lbl)
    assert compare_values(ref_e_scf_dz, jrec['qcvars']['HF TOTAL ENERGY'].data,
                          6, lbl)
    #assert compare_arrays(ref_hess_scf_dz, jrec['qcvars']['HF/CC-PVDZ TOTAL HESSIAN'].data, 6, lbl)
    #assert compare_arrays(ref_scf_dz, jrec['qcvars']['HF/CC-PVDZ TOTAL GRADIENT'].data, 6, lbl)
    #assert compare_values(ref_e_scf_dz, jrec['qcvars']['HF/CC-PVDZ TOTAL ENERGY'].data, 6, lbl)
    # TODO provenance kill list
    assert ['QCDB',
            'Psi4'] == [d['creator'] for d in jrec['provenance']], "[1a] prov"
    print(jrec['provenance'])
Exemplo n.º 12
0
def test_2b():
    system1()
    lbl = "[2b] SCF/cc-pVDZ, Cfour, dertype=1"

    scf_dz, jrec = qcdb.hessian('c4-SCF/cc-pVDZ',
                                return_wfn=True,
                                hess_dertype=1)
    assert compare_arrays(ref_hess_scf_dz, scf_dz, 6, lbl)
    assert compare_arrays(ref_hess_scf_dz,
                          qcdb.get_variable('CURRENT HESSIAN'), 6, lbl)
    assert compare_arrays(ref_hess_scf_dz,
                          jrec['qcvars']['CURRENT HESSIAN'].data, 6, lbl)
    assert compare_arrays(ref_scf_dz, jrec['qcvars']['CURRENT GRADIENT'].data,
                          6, lbl)
    assert compare_arrays(ref_scf_dz, qcdb.get_variable('CURRENT GRADIENT'), 6,
                          lbl)
    #    assert compare_values(ref_e_scf_dz, jrec['qcvars']['CURRENT ENERGY'].data, 6, lbl)
    #    assert compare_values(ref_e_scf_dz, qcdb.get_variable('CURRENT ENERGY'), 6, lbl)
    #    assert compare_arrays(ref_hess_scf_dz, jrec['qcvars']['HF TOTAL HESSIAN'].data, 6, lbl)
    #    assert compare_arrays(ref_scf_dz, jrec['qcvars']['HF TOTAL GRADIENT'].data, 6, lbl)
    assert compare_values(ref_e_scf_dz, jrec['qcvars']['HF TOTAL ENERGY'].data,
                          6, lbl)
    #assert compare_arrays(ref_hess_scf_dz, jrec['qcvars']['HF/CC-PVDZ TOTAL HESSIAN'].data, 6, lbl)
    #assert compare_arrays(ref_scf_dz, jrec['qcvars']['HF/CC-PVDZ TOTAL GRADIENT'].data, 6, lbl)
    #assert compare_values(ref_e_scf_dz, jrec['qcvars']['HF/CC-PVDZ TOTAL ENERGY'].data, 6, lbl)
    assert 'CFOUR' == jrec['provenance']['creator'], "[1b] prov"
Exemplo n.º 13
0
def check_dft(return_value, is_df):
    if is_df:
        ref     =   -75.234018772521
    else:
        ref     =   -74.964662543238
        
    assert compare_values(ref, qcdb.get_variable('DFT TOTAL ENERGY'), 5, 'DFT total')  #TEST
    assert compare_values(ref, qcdb.get_variable('HF TOTAL ENERGY'), 5, 'SCF total')  #TEST
Exemplo n.º 14
0
def check_tce_mp2(return_value):
    hf          =   -75.645085110552
    mp2_tot     =   -75.934995820774219
    mp2_corl    =    -0.289910710222209

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5, 'hf ref')
    assert compare_values(mp2_tot, qcdb.get_variable('MBPT(2) TOTAL ENERGY'), 5, 'mbpt(2) tot')
    assert compare_values(mp2_corl, qcdb.get_variable('MBPT(2) CORRELATION ENERGY'), 5, 'mbpt(2) corl')
Exemplo n.º 15
0
def check_rhf(return_value, is_df):
    if is_df:
        ref = -76.010496306999
        nre = 9.187334240165
    else:
        ref = -76.010738270124
        nre = 9.347020370478
    assert compare_values(ref, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(nre, qcdb.get_variable('NUCLEAR REPULSION ENERGY'),
                          5, 'nre')
Exemplo n.º 16
0
def check_tce_mp3(return_value):
    hf          =   -75.645085110552
    mp2_tot     =   -75.934995820774219
    mp2_corl    =    -0.289910710222209
    mp3_tot     =   -75.924895885924158
    mp3_corl    =     0.010099934850061

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5, 'hf ref')
    assert compare_values(mp2_tot, qcdb.get_variable('MBPT(2) TOTAL ENERGY'), 5, 'mbpt(2) tot')
    assert compare_values(mp2_corl, qcdb.get_variable('MBPT(2) CORRELATION ENERGY'), 5, 'mbpt(2) corl')
    assert compare_values(mp3_tot, qcdb.get_variable('MBPT(3) TOTAL ENERGY'), 5, 'mp3 tot')
    assert compare_values(mp3_corl, qcdb.get_variable('MBPT(3) CORRELATION ENERGY'), 5, 'mp3 corl')
Exemplo n.º 17
0
def check_cisdtq(return_value):
    hf = -74.506112017320
    cisdtq_tot = -74.788955327897597
    cisdtq_corl = -0.282843310578009

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(cisdtq_tot, qcdb.get_variable('CISDTQ TOTAL ENERGY'),
                          5, 'cisdtq tot')
    assert compare_values(cisdtq_corl,
                          qcdb.get_variable('CISDTQ CORRELATION ENERGY'), 5,
                          'cisdtq corl')
Exemplo n.º 18
0
def check_lccsd(return_value):
    hf = -74.506112017705
    lccsd_tot = -75.013554624840296
    lccsd_corl = -0.050891562718781

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(lccsd_tot, qcdb.get_variable('LCCSD TOTAL ENERGY'),
                          5, 'lccd tot')
    assert compare_values(lccsd_corl,
                          qcdb.get_variable('LCCSD CORRELATION ENERGY'), 5,
                          'lccd corl')
Exemplo n.º 19
0
def tce_uccsd(return_value):

    hf = -74.656470840577
    ccsd_tot = -74.695659393231864
    ccsd_corl = -0.039188552654924

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(ccsd_tot, qcdb.get_variable('CCSD TOTAL ENERGY'), 5,
                          'ccsd tot')
    assert compare_values(ccsd_corl, qcdb.get_variable('CCSD CORRELATION'), 5,
                          'ccsd corl')
Exemplo n.º 20
0
def tce_ccd(return_value):

    hf = -74.506112017705
    ccd_tot = -74.789850325141188
    ccd_corl = -0.283738307435901

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(ccd_tot, qcdb.get_variable('CCD TOTAL ENERGY'), 5,
                          'ccsd tot')
    assert compare_values(ccd_corl, qcdb.get_variable('CCD CORRELATION'), 5,
                          'ccsd corl')
Exemplo n.º 21
0
def check_lccd(return_value):
    hf = -74.506112017705
    lccd_tot = -75.012682861990669
    lccd_corl = -0.049777455819604

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(lccd_tot, qcdb.get_variable('LCCD TOTAL ENERGY'), 5,
                          'lccd tot')
    assert compare_values(lccd_corl,
                          qcdb.get_variable('LCCD CORRELATION ENERGY'), 5,
                          'lccd corl')
Exemplo n.º 22
0
def check_cisdt(return_value):
    hf = -74.506112017320
    cisdt_tot = -74.746791001337797
    cisdt_corl = -0.240678984018215

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(cisdt_tot, qcdb.get_variable('CISDT TOTAL ENERGY'),
                          5, 'cisdt tot')
    assert compare_values(cisdt_corl,
                          qcdb.get_variable('CISDT CORRELATION ENERGY'), 5,
                          'cisdt corl')
Exemplo n.º 23
0
def check_mp2(return_value, is5050):
    ref = -76.026760737428
    nre = 9.187334240165
    mp2_tot = -76.230777733733
    scs_mp2_tot = -76.226922314540
    scs_corl = -0.200161577112
    os = -0.152487590397 * (6/5)
    ss = -0.051529405908 * (1/3) 
    a5050corl = 0.5 * (os + ss)
    a5050tot = a5050corl + ref
    assert compare_values(ref, qcdb.get_variable('HF TOTAL ENERGY'), 5, 'scf total')
    assert compare_values(mp2_tot, qcdb.get_variable('MP2 TOTAL ENERGY'), 5, 'mp2 energy')
Exemplo n.º 24
0
def check_cisd(return_value):
    hf = -74.506112017320
    cisd_tot = -74.746025986067849
    cisd_corl = -0.239913968748276

    assert compare_values(hf, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(cisd_tot, qcdb.get_variable('CISD TOTAL ENERGY'), 5,
                          'cisd tot')
    assert compare_values(cisd_corl,
                          qcdb.get_variable('CISD CORRELATION ENERGY'), 5,
                          'cisd corl')
Exemplo n.º 25
0
def check_uhf_mp2(return_value, is_5050):
    ref = -55.566057523877
    mp2_tot = -55.711202243414
    mp2_corl = -0.145144719537
    scs_tot = -55.712082715312
    scs_corl = -0.146025191435
    mp2os = -0.112665713372
    mp2ss = -0.032479006165
    a5050corl = 0.5 * (mp2os + mp2ss)
    a5050tot = a5050corl + ref

    assert compare_values(ref, qcdb.get_variable('HF TOTAL ENERGY'), 5, 'scf')
    assert compare_values(mp2_tot, qcdb.get_variable('MP2 TOTAL ENERGY'), 5,
                          'mp2 tot')
    assert compare_values(mp2_corl,
                          qcdb.get_variable('MP2 CORRELATION ENERGY'), 5,
                          'mp2 corl')
    assert compare_values(scs_tot, qcdb.get_variable('SCS-MP2 TOTAL ENERGY'),
                          5, 'scs mp2 tot')
    assert compare_values(scs_corl,
                          qcdb.getvariable('SCS-MP2 CORRELATION ENERGY'), 5,
                          'scs mp2 corl')
    assert compare_values(
        mp2ss, qcdb.get_variable('MP2 SAME-SPIN CORRELATION ENERGY'), 5,
        'mp2 ss')
    assert compare_values(
        mp2os, qcdb.get_variable('MP2 OPPOSITE-SPIN CORRELATION ENERGY'), 5,
        'mp2 os')
    if is_5050:
        assert compare_values(
            a5050corl, qcdb.get_variable('CUSTOM SCS-MP2 CORRELATION ENERGY'),
            5, 'mp2 scscorl')
        assert compare_values(a5050tot,
                              qcdb.get_variable('CUSTOM SCS-MP2 TOTAL ENERGY'),
                              5, 'mp2 scstot')
Exemplo n.º 26
0
def test_6b():
    system1()
    lbl = '[6b] MP2/cc-pV[DT]Z, Cfour'

    mp2_dtz, jrec = qcdb.hessian('c4-MP2/cc-pV[DT]Z', return_wfn=True)
    assert compare_arrays(ref_hess_mp2_dtz, mp2_dtz, 6, lbl)
    assert compare_arrays(ref_hess_mp2_dtz,
                          qcdb.get_variable('CURRENT HESSIAN'), 6, lbl)
    assert compare_arrays(ref_hess_mp2_dtz,
                          jrec['qcvars']['CURRENT HESSIAN'].data, 6, lbl)
    assert compare_arrays(ref_grad_mp2_dtz,
                          jrec['qcvars']['CURRENT GRADIENT'].data, 6, lbl)
    assert compare_arrays(ref_grad_mp2_dtz,
                          qcdb.get_variable('CURRENT GRADIENT'), 6, lbl)
Exemplo n.º 27
0
def check_ccsdtq(return_value, is_df):
    if is_df:
        ref = -76.010496307018
        ccsdtq = -76.210368642101955
        ccsdtq_corl = -0.199872335037341
    else:
        print("Does not match")

    assert compare_values(ref, qcdb.get_variable('SCF TOTAL ENERGY'), 6,
                          'SCF')  #TEST
    assert compare_values(ccsdtq, qcdb.get_variable('CCSDTQ TOTAL ENERGY'), 6,
                          'CCSDTQ')  #TEST
    assert compare_values(ccsdtq_corl,
                          qcdb.get_variable('CCSDTQ CORRELATION ENERGY'), 6,
                          'CCSDTQ corl')  #TEST
Exemplo n.º 28
0
def check_dft(return_value, is_dft):
    if is_dft:
        dft_ref     =       -95.217126584667
        nre         =         9.187334240165
        ccsdt_tot   =       -95.263267683066744
        ccsdt_corl  =        -0.046141098399779
    else:
        dft_ref     =       -95.217126584667
        ccsdt_tot   =       -95.263267683066744
        ccsdt_corl  =        -0.046141098399779
        nre         =         9.187334240165
    assert compare_values(dft_ref, qcdb.get_variable('DFT TOTAL ENERGY'), 5, 'dft ref')
    assert compare_values(ccsdt_tot, qcdb.get_variable('CCSDT TOTAL ENERGY'), 5, 'ccsdt total')
    assert compare_values(ccsdt_corl, qcdb.get_variable('CCSDT CORRELATION ENERGY'), 5, 'ccsdt corl')
    assert compare_values(nre, qcdb.get_variable('NUCLEAR REPULSION ENERGY'), 'nre')
Exemplo n.º 29
0
def check_ccsd_t_(return_value):
    ref = -76.026760733967
    nre = 9.187333574703
    ccsdcorl = -0.213341251859034
    ccsdtot = -76.240101985825859

    assert compare_values(ref, qcdb.get_variable('HF TOTAL ENERGY'), 5,
                          'hf ref')
    assert compare_values(ccsdcorl,
                          qcdb.get_variable('CCSD CORRELATION ENERGY'), 5,
                          'ccsd corl')
    assert compare_values(ccsdtot, qcdb.get_variable('CCSD TOTAL ENERGY'), 5,
                          'ccsd total')
    assert compare_values(nre, qcdb.get_variable('NUCLEAR REPULSION ENERGY'),
                          5, 'nre')
Exemplo n.º 30
0
def test_5b():
    system1()
    lbl = "[5b] SCF/cc-pV[DTQ]Z, Cfour"

    scf_dtqz, jrec = qcdb.hessian('c4-HF/cc-pV[DTQ]Z', return_wfn=True)
    assert compare_arrays(ref_hess_scf_dtqz, scf_dtqz, 6, lbl)
    assert compare_arrays(ref_hess_scf_dtqz,
                          qcdb.get_variable('CURRENT HESSIAN'), 6, lbl)
    assert compare_arrays(ref_hess_scf_dtqz,
                          jrec['qcvars']['CURRENT HESSIAN'].data, 6, lbl)
    assert compare_arrays(ref_grad_scf_dtqz,
                          jrec['qcvars']['CURRENT GRADIENT'].data, 6, lbl)
    #    assert compare_values(ref_e_scf_dtqz, jrec['qcvars']['CURRENT ENERGY'].data, 6, lbl)
    assert compare_arrays(ref_grad_scf_dtqz,
                          qcdb.get_variable('CURRENT GRADIENT'), 6, lbl)