From c4fa0677e33b9fcf71368fe3ac899648747b9e81 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 28 Dec 2018 20:18:34 +0100 Subject: [PATCH 1/3] Fixed a few tests --- src/ezfio_files/00.create.bats | 18 ++++++++++-------- src/ezfio_files/01.convert.bats | 4 ++-- src/hartree_fock/20.hf.bats | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/ezfio_files/00.create.bats b/src/ezfio_files/00.create.bats index a7fb2043..9064cf23 100644 --- a/src/ezfio_files/00.create.bats +++ b/src/ezfio_files/00.create.bats @@ -3,14 +3,15 @@ source $QP_ROOT/tests/bats/common.bats.sh function run { - INPUT=$1 - EZ=${INPUT/.xyz/.ezfio} - EZ=${EZ/.zmt/.ezfio} - MULT=$2 - CHARGE=$3 - BASIS=$4 + set -x + local INPUT=$1 + local EZ=${INPUT/.xyz/.ezfio} + local EZ=${EZ/.zmt/.ezfio} + local MULT=$2 + local CHARGE=$3 + local BASIS=$4 if [[ -n $5 ]] ; then - PSEUDO="-p $5" + local PSEUDO="-p $5" fi cp ${QP_ROOT}/tests/input/$INPUT . rm -rf $EZ @@ -18,6 +19,7 @@ function run { $INPUT -b "$BASIS" -m $MULT -c $CHARGE $PSEUDO -o $EZ qp_edit -c $EZ echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals + set +x } @@ -30,7 +32,7 @@ function run { } @test "qp_create dhno.xyz" { - run dhno.xyz 2 0 chipman-dzp + run dhno.xyz 2 0 "chipman-dzp" } @test "qp_create h3coh.xyz" { diff --git a/src/ezfio_files/01.convert.bats b/src/ezfio_files/01.convert.bats index f0dc5608..da8e291c 100644 --- a/src/ezfio_files/01.convert.bats +++ b/src/ezfio_files/01.convert.bats @@ -3,8 +3,8 @@ source $QP_ROOT/tests/bats/common.bats.sh function run { - INPUT=$1 - EZ=$2 + local INPUT=$1 + local EZ=$2 cp ${QP_ROOT}/tests/input/$INPUT . qp_convert_output_to_ezfio $INPUT -o $EZ qp_edit -c $EZ diff --git a/src/hartree_fock/20.hf.bats b/src/hartree_fock/20.hf.bats index 35cf901c..fa9fef1f 100644 --- a/src/hartree_fock/20.hf.bats +++ b/src/hartree_fock/20.hf.bats @@ -24,7 +24,7 @@ function run() { run h2o.ezfio -0.760270218692179E+02 } -@test "SCF H2O" { +@test "SCF [Cu(NH3)4]2+" { run cu_nh3_4_2plus.ezfio -1862.97590388214 } From 0fc96409f874a7a9f6a6eb54e0569e47b2170650 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 30 Dec 2018 14:51:10 +0100 Subject: [PATCH 2/3] All Hartree-Fock tests OK --- src/ezfio_files/00.create.bats | 2 - src/hartree_fock/20.hf.bats | 77 +++++++++++++++++++++++++++++++++- src/hartree_fock/EZFIO.cfg | 1 - src/scf_utils/EZFIO.cfg | 2 +- 4 files changed, 77 insertions(+), 5 deletions(-) diff --git a/src/ezfio_files/00.create.bats b/src/ezfio_files/00.create.bats index 9064cf23..af010e44 100644 --- a/src/ezfio_files/00.create.bats +++ b/src/ezfio_files/00.create.bats @@ -3,7 +3,6 @@ source $QP_ROOT/tests/bats/common.bats.sh function run { - set -x local INPUT=$1 local EZ=${INPUT/.xyz/.ezfio} local EZ=${EZ/.zmt/.ezfio} @@ -19,7 +18,6 @@ function run { $INPUT -b "$BASIS" -m $MULT -c $CHARGE $PSEUDO -o $EZ qp_edit -c $EZ echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals - set +x } diff --git a/src/hartree_fock/20.hf.bats b/src/hartree_fock/20.hf.bats index fa9fef1f..8661dc1c 100644 --- a/src/hartree_fock/20.hf.bats +++ b/src/hartree_fock/20.hf.bats @@ -28,8 +28,83 @@ function run() { run cu_nh3_4_2plus.ezfio -1862.97590388214 } -@test "SCF DHNO chipman-dzp" { +@test "SCF C2H2" { + run c2h2.ezfio -12.12144019495306 +} + +@test "SCF ClO" { + run clo.ezfio -534.2496714154559 +} + +@test "SCF DHNO" { run dhno.ezfio -130.4278777822 } +@test "SCF H3COH" { + run h3coh.ezfio -114.9865030596373 +} + +@test "SCF HCN" { + run hcn.ezfio -92.88717500035233 +} + +@test "SCF N2" { + run n2.ezfio -108.9834897852979 +} + +@test "SCF SIH2_3B1" { + run sih2_3b1.ezfio -289.9529166224221 +} + +@test "SCF SO" { + run so.ezfio -25.71752633718843 +} + +@test "SCF CH4" { + run ch4.ezfio -40.21363716169098 +} + +@test "SCF CO2" { + run co2.ezfio -187.6507108861204 +} + +@test "SCF F2" { + run f2.ezfio -198.7643578233773 +} + +@test "SCF HCO" { + run hco.ezfio -113.0862778269114 +} + +@test "SCF NH3" { + run nh3.ezfio -56.19561966890940 +} + +@test "SCF SiH3" { + run sih3.ezfio -5.455398769158780 +} + +@test "SCF ClF" { + run clf.ezfio -558.8442570663570 +} + +@test "SCF H2O2" { + run h2o2.ezfio -150.7806608469964 +} + +@test "SCF H2S" { + run h2s.ezfio -398.6944130421982 +} + +@test "SCF N2H4" { + run n2h4.ezfio -111.1799916679009 +} + +@test "SCF OH" { + run oh.ezfio -75.42025413469165 +} + +@test "SCF SO2" { + run so2.ezfio -41.55800190733211 +} diff --git a/src/hartree_fock/EZFIO.cfg b/src/hartree_fock/EZFIO.cfg index 35f5c69b..fcee8830 100644 --- a/src/hartree_fock/EZFIO.cfg +++ b/src/hartree_fock/EZFIO.cfg @@ -2,5 +2,4 @@ type: Threshold doc: Energy HF interface: ezfio -default: 0. diff --git a/src/scf_utils/EZFIO.cfg b/src/scf_utils/EZFIO.cfg index af42dddc..97563d39 100644 --- a/src/scf_utils/EZFIO.cfg +++ b/src/scf_utils/EZFIO.cfg @@ -26,7 +26,7 @@ default: 500 type: Positive_float doc: Energy shift on the virtual MOs to improve SCF convergence interface: ezfio,provider,ocaml -default: 0.1 +default: 0. [scf_algorithm] type: character*(32) From 74b50a4a0539d3411499a8618116cb13e4e1756e Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 30 Dec 2018 20:00:14 +0100 Subject: [PATCH 3/3] Tests for CIS fail --- src/cis/30.cis.bats | 104 ++++++++++++++++++++++---- src/ezfio_files/00.create.bats | 46 ++++++------ src/ezfio_files/01.convert.bats | 7 +- src/hartree_fock/20.hf.bats | 50 ++++++------- src/hartree_fock/fock_matrix_hf.irp.f | 11 +-- src/scf_utils/roothaan_hall_scf.irp.f | 6 +- 6 files changed, 153 insertions(+), 71 deletions(-) diff --git a/src/cis/30.cis.bats b/src/cis/30.cis.bats index d64788a2..d9b5a65d 100644 --- a/src/cis/30.cis.bats +++ b/src/cis/30.cis.bats @@ -2,14 +2,15 @@ source $QP_ROOT/tests/bats/common.bats.sh -function run_CIS() { - thresh=5.e-9 +function run() { + thresh=5.e-7 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 - + ezfio set davidson threshold_davidson 1.e-12 +# echo "Write" > $1/mo_two_e_integrals/disk_access_mo_integrals + qp_set_frozen_core $1 qp_run cis $1 energy1="$(ezfio get cis energy | tr '[]' ' ' | cut -d ',' -f 1)" energy2="$(ezfio get cis energy | tr '[]' ' ' | cut -d ',' -f 2)" @@ -21,18 +22,95 @@ function run_CIS() { -#=== H2O - -@test "qp_set_mo_class H2O cc-pVDZ" { - qp_set_mo_class h2o.ezfio -core "[1]" -act "[2-12]" -del "[13-24]" +@test "HBO" { + run hbo.ezfio -100.018582307658 -99.6982685747284 -99.6982685747283 } -@test "CIS H2O cc-pVDZ" { - run_CIS h2o.ezfio -76.0270218693035 -75.6812512934229 -75.6174524564961 +@test "H2O" { + run h2o.ezfio -76.0270218681105 -75.6854407469221 -75.6196755733432 } -@test "CIS H2O VDZ pseudo" { - qp_set_frozen_core h2o_pseudo.ezfio - run_CIS h2o_pseudo.ezfio -16.9483703905542 -16.5790993717898 -16.5074569116264 +@test "[Cu(NH3)4]2+" { + run cu_nh3_4_2plus.ezfio -1862.97958709248 -1862.92454796197 -1862.91130872182 +} + +@test "C2H2" { + run c2h2.ezfio -12.1214401949631 -11.86823108084437 -11.86823108084389 +} + +@test "ClO" { + run clo.ezfio -534.263560525680 -534.256601571199 -534.062020844428 +} + +@test "DHNO" { + run dhno.ezfio -130.447228845699 -130.357180876975 -130.219625729558 +} + +@test "H3COH" { + run h3coh.ezfio -114.986503059639 -114.649121836046 -114.578365912794 +} + +@test "HCN" { + run hcn.ezfio -92.8871750003801 -92.6089719727410 -92.6089719727409 +} + +@test "N2" { + run n2.ezfio -108.9834897853049 -108.6496539410780 -108.6496539410771 +} + +@test "SiH2_3B1" { + run sih2_3b1.ezfio -289.952916622430 -289.901707301173 -289.715063453770 +} + +@test "SO" { + run so.ezfio -25.7502241401925 -25.5862791897799 -25.5829342971276 +} + +@test "CH4" { + run ch4.ezfio -40.1996180778616 -39.7936150141939 -39.7936150141734 +} + +@test "CO2" { + run co2.ezfio -187.650710886151 -187.291641391714 -187.291641391713 +} + +@test "F2" { + run f2.ezfio -198.764357823385 -198.575548537096 -198.575548537096 +} + +@test "HCO" { + run hco.ezfio -113.094024225042 -113.002362525915 -112.894730863318 +} + +@test "NH3" { + run nh3.ezfio -56.2178342898186 -55.9199930723028 -55.8475617160862 +} + +@test "SiH3" { + run sih3.ezfio -5.45916474249436 -5.23512810272682 -5.23512806272007 +} + +@test "ClF" { + run clf.ezfio -558.844257066356 -558.664418728406 -558.664418728405 +} + +@test "H2O2" { + run h2o2.ezfio -150.780660847001 -150.546208866263 -150.483274551717 +} + +@test "H2S" { + run h2s.ezfio -398.694413042222 -398.447164835271 -398.412784774083 +} + +@test "N2H4" { + run n2h4.ezfio -111.179991667947 -110.894116344878 -110.855788839735 +} + +@test "OH" { + run oh.ezfio -75.4314648243896 -75.4254639668256 -75.2707675632313 +} + +@test "SO2" { + run so2.ezfio -41.5580019075504 -41.3823293845389 -41.3551232664878 } diff --git a/src/ezfio_files/00.create.bats b/src/ezfio_files/00.create.bats index af010e44..11853f71 100644 --- a/src/ezfio_files/00.create.bats +++ b/src/ezfio_files/00.create.bats @@ -17,87 +17,87 @@ function run { qp_create_ezfio_from_xyz \ $INPUT -b "$BASIS" -m $MULT -c $CHARGE $PSEUDO -o $EZ qp_edit -c $EZ - echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals +# echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals } -@test "qp_create c2h2.xyz" { +@test "C2H2" { run c2h2.xyz 1 0 vdz-bfd bfd } -@test "qp_create clo.xyz" { +@test "ClO" { run clo.xyz 2 0 cc-pvdz } -@test "qp_create dhno.xyz" { +@test "DHNO" { run dhno.xyz 2 0 "chipman-dzp" } -@test "qp_create h3coh.xyz" { +@test "H3COH" { run h3coh.xyz 1 0 6-31g } -@test "qp_create hcn.xyz" { +@test "HCN" { run hcn.xyz 1 0 aug-cc-pvdz } -@test "qp_create n2.xyz" { +@test "N2" { run n2.xyz 1 0 cc-pvtz } -@test "qp_create sih2_3b1.xyz" { +@test "SiH2_3B1" { run sih2_3b1.xyz 1 0 6-31g } -@test "qp_create so.xyz" { +@test "SO" { run so.xyz 3 0 vdz-bfd bfd } -@test "qp_create ch4.xyz" { - run ch4.xyz 1 0 aug-cc-pvtz +@test "CH4" { + run ch4.xyz 1 0 aug-cc-pvdz } -@test "qp_create co2.xyz" { +@test "CO2" { run co2.xyz 1 0 cc-pvdz } -@test "qp_create f2.zmt" { +@test "F2" { run f2.zmt 1 0 "Def2-TZVP" } -@test "qp_create hco.xyz" { +@test "HCO" { run hco.xyz 2 0 "Ahlrichs VDZ" } -@test "qp_create nh3.xyz" { - run nh3.xyz 1 0 cc-pvdz +@test "NH3" { + run nh3.xyz 1 0 cc-pvtz } -@test "qp_create sih3.xyz" { +@test "SiH3" { run sih3.xyz 2 0 vdz-bfd bfd } -@test "qp_create clf.xyz" { +@test "ClF" { run clf.xyz 1 0 cc-pvdz } -@test "qp_create h2o2.zmt" { +@test "H2O2" { run h2o2.zmt 1 0 cc-pvdz } -@test "qp_create h2s.xyz" { +@test "H2S" { run h2s.xyz 1 0 cc-pvdz } -@test "qp_create n2h4.zmt" { +@test "N2H4" { run n2h4.zmt 1 0 cc-pvdz } -@test "qp_create oh.xyz" { +@test "OH" { run oh.xyz 2 0 "Roos Augmented Double Zeta ANO" } -@test "qp_create so2.xyz" { +@test "SO2" { run so2.xyz 1 0 vtz-bfd bfd } diff --git a/src/ezfio_files/01.convert.bats b/src/ezfio_files/01.convert.bats index da8e291c..b1d4c4d3 100644 --- a/src/ezfio_files/01.convert.bats +++ b/src/ezfio_files/01.convert.bats @@ -11,15 +11,14 @@ function run { echo "Write" > ${EZ}/ao_two_e_integrals/disk_access_ao_integrals } -#=== Convert -@test "gamess convert hbo.gms.out" { +@test "HBO GAMESS" { run hbo.gms.out hbo.ezfio } -@test "g09 convert h2o.log" { +@test "H2O G09" { run h2o.log h2o.ezfio } -@test "gamess convert cu_nh3_4_2plus.gms.out" { +@test "[Cu(NH3)4]2+ GAMESS" { run cu_nh3_4_2plus.gms.out cu_nh3_4_2plus.ezfio } diff --git a/src/hartree_fock/20.hf.bats b/src/hartree_fock/20.hf.bats index 8661dc1c..fe662503 100644 --- a/src/hartree_fock/20.hf.bats +++ b/src/hartree_fock/20.hf.bats @@ -16,95 +16,95 @@ function run() { -@test "SCF HBO" { +@test "HBO" { run hbo.ezfio -100.018582259096 } -@test "SCF H2O" { +@test "H2O" { run h2o.ezfio -0.760270218692179E+02 } -@test "SCF [Cu(NH3)4]2+" { +@test "[Cu(NH3)4]2+" { run cu_nh3_4_2plus.ezfio -1862.97590388214 } -@test "SCF C2H2" { +@test "C2H2" { run c2h2.ezfio -12.12144019495306 } -@test "SCF ClO" { +@test "ClO" { run clo.ezfio -534.2496714154559 } -@test "SCF DHNO" { +@test "DHNO" { run dhno.ezfio -130.4278777822 } -@test "SCF H3COH" { +@test "H3COH" { run h3coh.ezfio -114.9865030596373 } -@test "SCF HCN" { +@test "HCN" { run hcn.ezfio -92.88717500035233 } -@test "SCF N2" { +@test "N2" { run n2.ezfio -108.9834897852979 } -@test "SCF SIH2_3B1" { +@test "SiH2_3B1" { run sih2_3b1.ezfio -289.9529166224221 } -@test "SCF SO" { +@test "SO" { run so.ezfio -25.71752633718843 } -@test "SCF CH4" { - run ch4.ezfio -40.21363716169098 +@test "CH4" { + run ch4.ezfio -40.19961807784367 } -@test "SCF CO2" { +@test "CO2" { run co2.ezfio -187.6507108861204 } -@test "SCF F2" { +@test "F2" { run f2.ezfio -198.7643578233773 } -@test "SCF HCO" { +@test "HCO" { run hco.ezfio -113.0862778269114 } -@test "SCF NH3" { - run nh3.ezfio -56.19561966890940 +@test "NH3" { + run nh3.ezfio -56.21783428976567 } -@test "SCF SiH3" { +@test "SiH3" { run sih3.ezfio -5.455398769158780 } -@test "SCF ClF" { +@test "ClF" { run clf.ezfio -558.8442570663570 } -@test "SCF H2O2" { +@test "H2O2" { run h2o2.ezfio -150.7806608469964 } -@test "SCF H2S" { +@test "H2S" { run h2s.ezfio -398.6944130421982 } -@test "SCF N2H4" { +@test "N2H4" { run n2h4.ezfio -111.1799916679009 } -@test "SCF OH" { +@test "OH" { run oh.ezfio -75.42025413469165 } -@test "SCF SO2" { +@test "SO2" { run so2.ezfio -41.55800190733211 } diff --git a/src/hartree_fock/fock_matrix_hf.irp.f b/src/hartree_fock/fock_matrix_hf.irp.f index dd2e2043..c655ce9c 100644 --- a/src/hartree_fock/fock_matrix_hf.irp.f +++ b/src/hartree_fock/fock_matrix_hf.irp.f @@ -20,7 +20,7 @@ if (do_direct_integrals) then !$OMP PARALLEL DEFAULT(NONE) & - !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,p,q,r,s,i0,j0,k0,l0, & + !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,keys,values,p,q,r,s,i0,j0,k0,l0, & !$OMP ao_bi_elec_integral_alpha_tmp,ao_bi_elec_integral_beta_tmp, c0, c1, c2, & !$OMP local_threshold)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& @@ -34,7 +34,7 @@ ao_bi_elec_integral_beta_tmp = 0.d0 q = ao_num*ao_num*ao_num*ao_num - !$OMP DO SCHEDULE(dynamic) + !$OMP DO SCHEDULE(static,1) do p=1_8,q call bielec_integrals_index_reverse(kk,ii,ll,jj,p) if ( (kk(1)>ao_num).or. & @@ -100,7 +100,7 @@ PROVIDE ao_bielec_integrals_in_map integer(omp_lock_kind) :: lck(ao_num) - integer*8 :: i8 + integer(map_size_kind) :: i8 integer :: ii(8), jj(8), kk(8), ll(8), k2 integer(cache_map_size_kind) :: n_elements_max, n_elements integer(key_kind), allocatable :: keys(:) @@ -120,7 +120,6 @@ ao_bi_elec_integral_beta_tmp = 0.d0 !$OMP DO SCHEDULE(static,1) - !DIR$ NOVECTOR do i8=0_8,ao_integrals_map%map_size n_elements = n_elements_max call get_cache_map(ao_integrals_map,i8,keys,values,n_elements) @@ -144,10 +143,12 @@ enddo enddo enddo - !$OMP END DO NOWAIT + !$OMP END DO + !$OMP BARRIER !$OMP CRITICAL ao_bi_elec_integral_alpha += ao_bi_elec_integral_alpha_tmp !$OMP END CRITICAL + !$OMP BARRIER !$OMP CRITICAL ao_bi_elec_integral_beta += ao_bi_elec_integral_beta_tmp !$OMP END CRITICAL diff --git a/src/scf_utils/roothaan_hall_scf.irp.f b/src/scf_utils/roothaan_hall_scf.irp.f index f3f252d8..460ebcf6 100644 --- a/src/scf_utils/roothaan_hall_scf.irp.f +++ b/src/scf_utils/roothaan_hall_scf.irp.f @@ -110,7 +110,11 @@ END_DOC do while (Delta_energy_SCF .ge. 0.d0) mo_coef(1:ao_num,1:mo_tot_num) = mo_coef_save TOUCH mo_coef - level_shift = level_shift * 2.0d0 + if (level_shift <= 0.d0) then + level_shift = 1.d0 + else + level_shift = level_shift * 2.0d0 + endif mo_coef(1:ao_num,1:mo_tot_num) = eigenvectors_Fock_matrix_MO(1:ao_num,1:mo_tot_num) if(no_oa_or_av_opt)then call reorder_active_orb