10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-02 11:25:26 +02:00

Updated tests

This commit is contained in:
Anthony Scemama 2018-12-25 10:55:40 +01:00
parent 81a30fcf1a
commit e4b1f333dc
5 changed files with 20 additions and 58 deletions

View File

@ -31,15 +31,18 @@ def main(arguments):
def append_bats(dirname, filenames):
for f in filenames:
if f.endswith(".bats"):
l_bats.append( os.path.join(dirname,f) )
number, _ = f.split('.',1)
l_bats.append( (int(number), os.path.join(dirname,f)) )
if arguments["-a"]:
for (dirname, _, filenames) in os.walk(QP_SRC, followlinks=False) :
append_bats(dirname, filenames)
if "IRPF90_temp" not in dirname:
append_bats(dirname, filenames)
else:
for (dirname, _, filenames) in os.walk(os.getcwd(), followlinks=False) :
append_bats(dirname, filenames)
print l_bats
if "IRPF90_temp" not in dirname:
append_bats(dirname, filenames)
l_bats = [ y for x,y in sorted(l_bats) ]
# Execute tests
os.chdir(QP_TESTS)

View File

@ -31,5 +31,8 @@ function run_FCI() {
run_FCI h2o.ezfio 2000 -76.1249493055975 -76.1258779921351
}
@test "FCI H2O VDZ pseudo" {
qp_set_mo_class h2o_pseudo.ezfio -core "[1]" -act "[2-12]" -del "[13-23]"
run_FCI h2o_pseudo.ezfio 2000 -17.0399259074535 -17.0400550838545
}

View File

@ -51,3 +51,12 @@ function run_HF() {
run_HF h2o.ezfio -0.760270218692179E+02
}
#=== H2O Pseudo
@test "init H2O VDZ pseudo" {
run_init h2o.xyz "-p bfd -b vdz-bfd" h2o_pseudo.ezfio
}
@test "SCF H2O VDZ pseudo" {
run_HF h2o_pseudo.ezfio -16.9483703905461
}

View File

@ -1,53 +0,0 @@
#!/usr/bin/env bats
source $QP_ROOT/tests/bats/common.bats.sh
function run_init() {
cp "${QP_ROOT}/tests/input/$1" .
qp_create_ezfio_from_xyz $1 -o $3 $2
qp_edit -c $3
}
function run_HF() {
thresh=1.e-7
test_exe scf || skip
qp_edit -c $1
ezfio set_file $1
ezfio set hartree_fock thresh_scf 2.e-8
qp_run scf $1
energy="$(ezfio get hartree_fock energy)"
eq $energy $2 $thresh
}
function run_FCI() {
thresh=5.e-5
test_exe fci || skip
qp_edit -c $1
ezfio set_file $1
ezfio set perturbation do_pt2 True
ezfio set determinants n_det_max $2
ezfio set davidson threshold_davidson 1.e-10
qp_run fci $1
energy="$(ezfio get FCI energy | tr '[]' ' ')"
eq $energy $3 $thresh
energy_pt2="$(ezfio get FCI energy_pt2 | tr '[]' ' ')"
eq $energy_pt2 $4 $thresh
}
#=== H2O Pseudo
@test "init H2O VDZ pseudo" {
run_init h2o.xyz "-p bfd -b vdz-bfd" h2o_pseudo.ezfio
}
@test "SCF H2O VDZ pseudo" {
run_HF h2o_pseudo.ezfio -16.9483703905461
}
@test "FCI H2O VDZ pseudo" {
qp_set_mo_class h2o_pseudo.ezfio -core "[1]" -act "[2-12]" -del "[13-23]"
run_FCI h2o_pseudo.ezfio 2000 -17.0399259074535 -17.0400550838545
}