10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-09-27 12:00:56 +02:00

Added tests for CIS and CISD

This commit is contained in:
Anthony Scemama 2018-12-25 18:40:39 +01:00
parent a058a35204
commit 96bd53d83f
6 changed files with 81 additions and 2 deletions

38
src/cis/30.cis.bats Normal file
View File

@ -0,0 +1,38 @@
#!/usr/bin/env bats
source $QP_ROOT/tests/bats/common.bats.sh
function run_CIS() {
thresh=5.e-9
test_exe cis || skip
qp_edit -c $1
ezfio set_file $1
ezfio set determinants n_states 3
ezfio set davidson threshold_davidson 1.e-10
qp_run cis $1
energy1="$(ezfio get cis energy | tr '[]' ' ' | cut -d ',' -f 1)"
energy2="$(ezfio get cis energy | tr '[]' ' ' | cut -d ',' -f 2)"
energy3="$(ezfio get cis energy | tr '[]' ' ' | cut -d ',' -f 3)"
eq $energy1 $2 $thresh
eq $energy2 $3 $thresh
eq $energy3 $4 $thresh
}
#=== H2O
@test "qp_set_mo_class H2O cc-pVDZ" {
qp_set_mo_class h2o.ezfio -core "[1]" -act "[2-12]" -del "[13-24]"
}
@test "CIS H2O cc-pVDZ" {
run_CIS h2o.ezfio -76.0270218693035 -75.6812512934229 -75.6174524564961
}
@test "CIS H2O VDZ pseudo" {
qp_set_frozen_core h2o_pseudo.ezfio
run_CIS h2o_pseudo.ezfio -16.9483703905542 -16.5790993717898 -16.5074569116264
}

View File

@ -1,6 +1,8 @@
[energy] [energy]
type: double precision type: double precision
doc: Variational CIS energy doc: Variational |CIS| energy
interface: ezfio interface: ezfio
size: (determinants.n_states)

View File

@ -18,6 +18,7 @@ subroutine run
print *, 'energy = ',CI_energy(i) print *, 'energy = ',CI_energy(i)
print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy
enddo enddo
call ezfio_set_cis_energy(CI_energy)
psi_coef = ci_eigenvectors psi_coef = ci_eigenvectors
SOFT_TOUCH psi_coef SOFT_TOUCH psi_coef
call save_wavefunction call save_wavefunction

36
src/cisd/30.cisd.bats Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bats
source $QP_ROOT/tests/bats/common.bats.sh
function run_CISD() {
thresh=5.e-9
test_exe cisd || skip
qp_edit -c $1
ezfio set_file $1
ezfio set determinants n_states 2
ezfio set davidson threshold_davidson 1.e-10
qp_run cisd $1
energy1="$(ezfio get cisd energy | tr '[]' ' ' | cut -d ',' -f 1)"
energy2="$(ezfio get cisd energy | tr '[]' ' ' | cut -d ',' -f 2)"
eq $energy1 $2 $thresh
eq $energy2 $3 $thresh
}
#=== H2O
@test "qp_set_mo_class H2O cc-pVDZ" {
qp_set_mo_class h2o.ezfio -core "[1]" -act "[2-12]" -del "[13-24]"
}
@test "CISD H2O cc-pVDZ" {
run_CISD h2o.ezfio -76.1220030371248 -75.7704139046496
}
@test "CISD H2O VDZ pseudo" {
qp_set_frozen_core h2o_pseudo.ezfio
run_CISD h2o_pseudo.ezfio -17.1526088241466 -16.6975854682481
}

View File

@ -1,6 +1,7 @@
[energy] [energy]
type: double precision type: double precision
doc: Variational CISD energy doc: Variational |CISD| energy
interface: ezfio interface: ezfio
size: (determinants.n_states)

View File

@ -21,5 +21,6 @@ subroutine run
psi_coef = ci_eigenvectors psi_coef = ci_eigenvectors
SOFT_TOUCH psi_coef SOFT_TOUCH psi_coef
call save_wavefunction_truncated(1.d-12) call save_wavefunction_truncated(1.d-12)
call ezfio_set_cisd_energy(CI_energy)
end end