mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-19 22:41:48 +02:00
Added tests for CIS and CISD
This commit is contained in:
parent
a058a35204
commit
96bd53d83f
38
src/cis/30.cis.bats
Normal file
38
src/cis/30.cis.bats
Normal 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
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
36
src/cisd/30.cisd.bats
Normal 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
|
||||||
|
}
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user