10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-27 23:04:10 +01:00
quantum_package/tests/bats/pseudo.bats

54 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-10-07 19:21:04 +02:00
#!/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
2017-07-12 02:50:34 +02:00
ezfio set hartree_fock thresh_scf 2.e-8
2016-10-07 19:21:04 +02:00
qp_run SCF $1
energy="$(ezfio get hartree_fock energy)"
eq $energy $2 $thresh
}
2018-10-23 22:46:05 +02:00
function run_FCI() {
2016-10-07 19:21:04 +02:00
thresh=5.e-5
2018-10-23 22:46:05 +02:00
test_exe FCI || skip
2016-10-07 19:21:04 +02:00
qp_edit -c $1
ezfio set_file $1
2017-06-26 20:35:07 +02:00
ezfio set perturbation do_pt2 True
2016-10-07 19:21:04 +02:00
ezfio set determinants n_det_max $2
ezfio set davidson threshold_davidson 1.e-10
2018-10-23 22:46:05 +02:00
qp_run FCI $1
energy="$(ezfio get FCI energy | tr '[]' ' ')"
2016-10-07 19:21:04 +02:00
eq $energy $3 $thresh
2018-10-23 22:46:05 +02:00
energy_pt2="$(ezfio get FCI energy_pt2 | tr '[]' ' ')"
2016-10-07 19:21:04 +02:00
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]"
2018-10-23 22:46:05 +02:00
run_FCI h2o_pseudo.ezfio 2000 -17.0399584106077 -17.0400170044515
2016-10-07 19:21:04 +02:00
}