From c429ed483a7f05db00df06b8597b9f8a3087fbf3 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 4 Jul 2022 15:20:15 +0200 Subject: [PATCH 01/11] Discussion list QP --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 24d6277e..b03f2ecc 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ https://arxiv.org/abs/1902.08154 * [Download the latest release](http://github.com/QuantumPackage/qp2/releases) * [Read the documentation](https://quantum-package.readthedocs.io) +# Discussion list + +For any questions or announcements regarding QuantumPackage, you can join our discussion list by registering [here](https://groupes.renater.fr/sympa/subscribe/quantum_package) or by sending an email to `quantum_package-request@groupes.renater.fr` . +You can also look over its [archives](https://groupes.renater.fr/sympa/arc/quantum_package). + + # Build status * Master [![master build status](https://travis-ci.com/QuantumPackage/qp2.svg?branch=master)](https://travis-ci.org/QuantumPackage/qp2) From c7f3d2674b95e1973af1619c39cc559606c6a5de Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 1 Aug 2022 08:42:21 +0200 Subject: [PATCH 02/11] Fix basis set --- configure | 8 +------- data/basis/cc-pv5z_ecp_bfd | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 5c38b9f2..b3ed7758 100755 --- a/configure +++ b/configure @@ -180,7 +180,7 @@ if [[ "${PACKAGES}.x" != ".x" ]] ; then fi if [[ ${PACKAGES} = all ]] ; then - PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats" + PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats bse" fi @@ -354,12 +354,6 @@ echo " ||----w | " echo " || || " echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "" -echo "If you have PIP, you can install the Basis Set Exchange command-line tool:" -echo "" -echo " ./configure -i bse" -echo "" -echo "This will enable the usage of qp_basis to install extra basis sets." -echo "" echo "" printf "\e[m\n" diff --git a/data/basis/cc-pv5z_ecp_bfd b/data/basis/cc-pv5z_ecp_bfd index a19ce9d8..84b0300e 100644 --- a/data/basis/cc-pv5z_ecp_bfd +++ b/data/basis/cc-pv5z_ecp_bfd @@ -555,7 +555,7 @@ g 1 1.00 g 1 1.00 1 0.457496 1.000000 -MAGNESIUM +MAGNESIUM s 9 1.00 1 0.030975 0.165290 2 0.062959 0.506272 From 121799148faddaff922bc757488e675b8a9fcda6 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 29 Aug 2022 15:21:10 +0200 Subject: [PATCH 03/11] Fixed Dsyev failed with CSF --- .../diagonalization_hcsf_dressed.irp.f | 3 +- src/davidson/diagonalize_ci.irp.f | 62 ++++++++++++++----- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/src/davidson/diagonalization_hcsf_dressed.irp.f b/src/davidson/diagonalization_hcsf_dressed.irp.f index 7aaaa842..a88330f6 100644 --- a/src/davidson/diagonalization_hcsf_dressed.irp.f +++ b/src/davidson/diagonalization_hcsf_dressed.irp.f @@ -1,4 +1,5 @@ -subroutine davidson_diag_h_csf(dets_in,u_in,dim_in,energies,sze,sze_csf,N_st,N_st_diag,Nint,dressing_state,converged) +subroutine davidson_diag_h_csf(dets_in, u_in, dim_in, energies, sze, sze_csf, & + N_st, N_st_diag, Nint, dressing_state,converged) use bitmasks implicit none BEGIN_DOC diff --git a/src/davidson/diagonalize_ci.irp.f b/src/davidson/diagonalize_ci.irp.f index 6930cc07..befd1907 100644 --- a/src/davidson/diagonalize_ci.irp.f +++ b/src/davidson/diagonalize_ci.irp.f @@ -68,13 +68,21 @@ END_PROVIDER do_csf = s2_eig .and. only_expected_s2 .and. csf_based - if (diag_algorithm == "Davidson") then + if (diag_algorithm == 'Davidson') then if (do_csf) then - if (sigma_vector_algorithm == 'det') then - call davidson_diag_H_csf(psi_det,CI_eigenvectors, & - size(CI_eigenvectors,1),CI_electronic_energy, & - N_det,N_csf,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged) +! if (sigma_vector_algorithm == 'det') then + call davidson_diag_H_csf (psi_det, & + CI_eigenvectors, & + size(CI_eigenvectors,1), & + CI_electronic_energy, & + N_det, & + N_csf, & + min(N_csf,N_states), & + min(N_csf,N_states_diag), & + N_int, & + 0, & + converged) ! else if (sigma_vector_algorithm == 'cfg') then ! call davidson_diag_H_csf(psi_det,CI_eigenvectors, & ! size(CI_eigenvectors,1),CI_electronic_energy, & @@ -82,11 +90,19 @@ END_PROVIDER ! else ! print *, irp_here ! stop 'bug' - endif +! endif else - call davidson_diag_HS2(psi_det,CI_eigenvectors, CI_s2, & - size(CI_eigenvectors,1),CI_electronic_energy, & - N_det,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged) + call davidson_diag_HS2(psi_det, & + CI_eigenvectors, & + CI_s2, & + size(CI_eigenvectors,1), & + CI_electronic_energy, & + N_det, & + min(N_det,N_states), & + min(N_det,N_states_diag), & + N_int, & + 0, & + converged) endif integer :: N_states_diag_save @@ -107,9 +123,17 @@ END_PROVIDER CI_electronic_energy_tmp(1:N_states_diag_save) = CI_electronic_energy(1:N_states_diag_save) CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save) = CI_eigenvectors(1:N_det,1:N_states_diag_save) - call davidson_diag_H_csf(psi_det,CI_eigenvectors_tmp, & - size(CI_eigenvectors_tmp,1),CI_electronic_energy_tmp, & - N_det,N_csf,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged) + call davidson_diag_H_csf (psi_det, & + CI_eigenvectors_tmp, & + size(CI_eigenvectors_tmp,1), & + CI_electronic_energy_tmp, & + N_det, & + N_csf, & + min(N_csf,N_states), & + min(N_csf,N_states_diag), & + N_int, & + 0, & + converged) CI_electronic_energy(1:N_states_diag_save) = CI_electronic_energy_tmp(1:N_states_diag_save) CI_eigenvectors(1:N_det,1:N_states_diag_save) = CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save) @@ -127,9 +151,17 @@ END_PROVIDER CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save) = CI_eigenvectors(1:N_det,1:N_states_diag_save) CI_s2_tmp(1:N_states_diag_save) = CI_s2(1:N_states_diag_save) - call davidson_diag_HS2(psi_det,CI_eigenvectors_tmp, CI_s2_tmp, & - size(CI_eigenvectors_tmp,1),CI_electronic_energy_tmp, & - N_det,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged) + call davidson_diag_HS2(psi_det, & + CI_eigenvectors_tmp, & + CI_s2_tmp, & + size(CI_eigenvectors_tmp,1), & + CI_electronic_energy_tmp, & + N_det, & + min(N_det,N_states), & + min(N_det,N_states_diag), & + N_int, & + 0, & + converged) CI_electronic_energy(1:N_states_diag_save) = CI_electronic_energy_tmp(1:N_states_diag_save) CI_eigenvectors(1:N_det,1:N_states_diag_save) = CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save) From 0a254628e5af2bd8f5dc50ed0aaef8dba738707d Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 21 Apr 2022 13:39:01 +0200 Subject: [PATCH 04/11] Update test values --- src/fci/40.fci.bats | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fci/40.fci.bats b/src/fci/40.fci.bats index 1a0c5507..b8528e97 100644 --- a/src/fci/40.fci.bats +++ b/src/fci/40.fci.bats @@ -71,7 +71,7 @@ function run_stoch() { @test "HBO" { # 13.3144s [[ -n $TRAVIS ]] && skip qp set_file hbo.ezfio - run -100.214099486337 1.e-3 100000 + run -100.213 1.e-3 100000 } @test "H2O" { # 11.3727s @@ -89,7 +89,7 @@ function run_stoch() { @test "SO" { # 13.4952s [[ -n $TRAVIS ]] && skip qp set_file so.ezfio - run -26.0176563764039 1.e-3 100000 + run -26.014 5.e-3 100000 } @test "H2S" { # 13.6745s @@ -119,7 +119,7 @@ function run_stoch() { @test "SiH3" { # 15.99s [[ -n $TRAVIS ]] && skip qp set_file sih3.ezfio - run -5.57241217753818 5.e-4 100000 + run -5.572 1.e-3 100000 } @test "CH4" { # 16.1612s @@ -153,7 +153,7 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file n2.ezfio qp set_mo_class --core="[1,2]" --act="[3-40]" --del="[41-60]" - run -109.287917088107 1.5e-3 100000 + run -109.288 2.e-3 100000 } @test "N2H4" { # 18.5006s From 058cf26ae4eac62d1de71c2e3db2de40e437cb70 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 21 Apr 2022 13:42:10 +0200 Subject: [PATCH 05/11] Update test values --- src/fci/40.fci.bats | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fci/40.fci.bats b/src/fci/40.fci.bats index b8528e97..d890d586 100644 --- a/src/fci/40.fci.bats +++ b/src/fci/40.fci.bats @@ -42,7 +42,7 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file f2.ezfio qp set_frozen_core - run_stoch -199.304922384814 3.e-4 100000 + run_stoch -199.304922384814 3.e-3 100000 } @test "NH3" { # 10.6657s @@ -89,7 +89,7 @@ function run_stoch() { @test "SO" { # 13.4952s [[ -n $TRAVIS ]] && skip qp set_file so.ezfio - run -26.014 5.e-3 100000 + run -26.015 3.e-3 100000 } @test "H2S" { # 13.6745s @@ -146,7 +146,7 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file c2h2.ezfio qp set_mo_class --act="[1-30]" --del="[31-36]" - run -12.3685464085969 2.e-3 100000 + run -12.367 3.e-3 100000 } @test "N2" { # 18.0198s @@ -182,6 +182,6 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file hcn.ezfio qp set_mo_class --core="[1,2]" --act="[3-40]" --del="[41-55]" - run -93.0777619629755 1.e-3 100000 + run -93.078 2.e-3 100000 } From d7424f50df6aa2fc0710f6908f7c6974c5b74809 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 29 Aug 2022 15:32:36 +0200 Subject: [PATCH 06/11] Fixing tests --- external/qp2-dependencies | 2 +- src/cisd/30.cisd.bats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/qp2-dependencies b/external/qp2-dependencies index 90ee61f5..242151e0 160000 --- a/external/qp2-dependencies +++ b/external/qp2-dependencies @@ -1 +1 @@ -Subproject commit 90ee61f5041c7c94a0c605625a264860292813a0 +Subproject commit 242151e03d1d6bf042387226431d82d35845686a diff --git a/src/cisd/30.cisd.bats b/src/cisd/30.cisd.bats index 58d996f8..69b862b0 100644 --- a/src/cisd/30.cisd.bats +++ b/src/cisd/30.cisd.bats @@ -4,7 +4,7 @@ source $QP_ROOT/tests/bats/common.bats.sh source $QP_ROOT/quantum_package.rc function run() { - thresh=1.e-5 + thresh=2.e-5 test_exe cisd || skip qp edit --check qp set determinants n_states 2 From c8109a1f516b9e7e7f71ecbfe61c9f6386755e8a Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 29 Aug 2022 15:32:36 +0200 Subject: [PATCH 07/11] Fixing tests --- external/qp2-dependencies | 2 +- src/cisd/30.cisd.bats | 2 +- src/fci/40.fci.bats | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/external/qp2-dependencies b/external/qp2-dependencies index 90ee61f5..242151e0 160000 --- a/external/qp2-dependencies +++ b/external/qp2-dependencies @@ -1 +1 @@ -Subproject commit 90ee61f5041c7c94a0c605625a264860292813a0 +Subproject commit 242151e03d1d6bf042387226431d82d35845686a diff --git a/src/cisd/30.cisd.bats b/src/cisd/30.cisd.bats index 58d996f8..69b862b0 100644 --- a/src/cisd/30.cisd.bats +++ b/src/cisd/30.cisd.bats @@ -4,7 +4,7 @@ source $QP_ROOT/tests/bats/common.bats.sh source $QP_ROOT/quantum_package.rc function run() { - thresh=1.e-5 + thresh=2.e-5 test_exe cisd || skip qp edit --check qp set determinants n_states 2 diff --git a/src/fci/40.fci.bats b/src/fci/40.fci.bats index d890d586..4523d0e0 100644 --- a/src/fci/40.fci.bats +++ b/src/fci/40.fci.bats @@ -71,7 +71,7 @@ function run_stoch() { @test "HBO" { # 13.3144s [[ -n $TRAVIS ]] && skip qp set_file hbo.ezfio - run -100.213 1.e-3 100000 + run -100.213 1.5e-3 100000 } @test "H2O" { # 11.3727s @@ -167,7 +167,7 @@ function run_stoch() { [[ -n $TRAVIS ]] && skip qp set_file co2.ezfio qp set_mo_class --core="[1,2]" --act="[3-30]" --del="[31-42]" - run -187.970184372047 1.5e-3 100000 + run -187.970184372047 1.6e-3 100000 } From d4dc02363e1a89f71354c7e8050f347177ba3999 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 14 Sep 2022 18:25:11 +0200 Subject: [PATCH 08/11] Introducing slowly shells in basis --- src/ao_basis/EZFIO.cfg | 5 +- src/ao_basis/aos.irp.f | 59 ++++++++------- src/basis/EZFIO.cfg | 1 - src/basis/basis.irp.f | 159 +++++++++++++++++++++++++---------------- 4 files changed, 134 insertions(+), 90 deletions(-) diff --git a/src/ao_basis/EZFIO.cfg b/src/ao_basis/EZFIO.cfg index 51d726da..2099ad59 100644 --- a/src/ao_basis/EZFIO.cfg +++ b/src/ao_basis/EZFIO.cfg @@ -36,13 +36,13 @@ interface: ezfio, provider type: double precision doc: Primitive coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs. size: (ao_basis.ao_num,ao_basis.ao_prim_num_max) -interface: ezfio, provider +interface: ezfio [ao_expo] type: double precision doc: Exponents for each primitive of each |AO| size: (ao_basis.ao_num,ao_basis.ao_prim_num_max) -interface: ezfio, provider +interface: ezfio [ao_md5] type: character*(32) @@ -67,3 +67,4 @@ doc: Use normalized primitive functions interface: ezfio, provider default: true + diff --git a/src/ao_basis/aos.irp.f b/src/ao_basis/aos.irp.f index 1cbd3976..9d8cf018 100644 --- a/src/ao_basis/aos.irp.f +++ b/src/ao_basis/aos.irp.f @@ -1,11 +1,3 @@ -BEGIN_PROVIDER [ integer, ao_prim_num_max ] - implicit none - BEGIN_DOC - ! Max number of primitives. - END_DOC - ao_prim_num_max = maxval(ao_prim_num) -END_PROVIDER - BEGIN_PROVIDER [ integer, ao_shell, (ao_num) ] implicit none BEGIN_DOC @@ -23,6 +15,32 @@ BEGIN_PROVIDER [ integer, ao_shell, (ao_num) ] END_PROVIDER + +BEGIN_PROVIDER [ double precision, ao_coef , (ao_num,ao_prim_num_max) ] +&BEGIN_PROVIDER [ double precision, ao_expo , (ao_num,ao_prim_num_max) ] + implicit none + BEGIN_DOC +! Primitive coefficients and exponents for each atomic orbital. Copied from shell info. + END_DOC + + integer :: i, l + do i=1,ao_num + l = ao_shell(i) + ao_coef(i,:) = shell_coef(l,:) + ao_expo(i,:) = shell_expo(l,:) + end do + +END_PROVIDER + + +BEGIN_PROVIDER [ integer, ao_prim_num_max ] + implicit none + BEGIN_DOC + ! Max number of primitives. + END_DOC + ao_prim_num_max = shell_prim_num_max +END_PROVIDER + BEGIN_PROVIDER [ integer, ao_first_of_shell, (shell_num) ] implicit none BEGIN_DOC @@ -44,20 +62,20 @@ END_PROVIDER BEGIN_DOC ! Coefficients including the |AO| normalization END_DOC + + do i=1,ao_num + l = ao_shell(i) + ao_coef_normalized(i,:) = shell_coef(l,:) * shell_normalization_factor(l) + end do + double precision :: norm,overlap_x,overlap_y,overlap_z,C_A(3), c integer :: l, powA(3), nz integer :: i,j,k nz=100 - C_A(1) = 0.d0 - C_A(2) = 0.d0 - C_A(3) = 0.d0 - ao_coef_normalized = 0.d0 + C_A = 0.d0 do i=1,ao_num -! powA(1) = ao_power(i,1) + ao_power(i,2) + ao_power(i,3) -! powA(2) = 0 -! powA(3) = 0 powA(1) = ao_power(i,1) powA(2) = ao_power(i,2) powA(3) = ao_power(i,3) @@ -67,18 +85,9 @@ END_PROVIDER do j=1,ao_prim_num(i) call overlap_gaussian_xyz(C_A,C_A,ao_expo(i,j),ao_expo(i,j), & powA,powA,overlap_x,overlap_y,overlap_z,norm,nz) - ao_coef_normalized(i,j) = ao_coef(i,j)/dsqrt(norm) - enddo - else - do j=1,ao_prim_num(i) - ao_coef_normalized(i,j) = ao_coef(i,j) + ao_coef_normalized(i,j) = ao_coef_normalized(i,j)/dsqrt(norm) enddo endif - - powA(1) = ao_power(i,1) - powA(2) = ao_power(i,2) - powA(3) = ao_power(i,3) - ! Normalization of the contracted basis functions if (ao_normalized) then norm = 0.d0 diff --git a/src/basis/EZFIO.cfg b/src/basis/EZFIO.cfg index a6864418..342fd4cc 100644 --- a/src/basis/EZFIO.cfg +++ b/src/basis/EZFIO.cfg @@ -72,4 +72,3 @@ doc: Exponents in the shell size: (basis.prim_num) interface: ezfio, provider - diff --git a/src/basis/basis.irp.f b/src/basis/basis.irp.f index b750d75a..0fe84506 100644 --- a/src/basis/basis.irp.f +++ b/src/basis/basis.irp.f @@ -1,67 +1,11 @@ -BEGIN_PROVIDER [ double precision, shell_normalization_factor , (shell_num) ] - implicit none - BEGIN_DOC - ! Number of primitives per |AO| - END_DOC - - logical :: has - PROVIDE ezfio_filename - if (mpi_master) then - if (size(shell_normalization_factor) == 0) return - - call ezfio_has_basis_shell_normalization_factor(has) - if (has) then - write(6,'(A)') '.. >>>>> [ IO READ: shell_normalization_factor ] <<<<< ..' - call ezfio_get_basis_shell_normalization_factor(shell_normalization_factor) - else - - double precision :: norm,overlap_x,overlap_y,overlap_z,C_A(3), c - integer :: l, powA(3), nz - integer :: i,j,k - nz=100 - C_A(1) = 0.d0 - C_A(2) = 0.d0 - C_A(3) = 0.d0 - - do i=1,shell_num - - powA(1) = shell_ang_mom(i) - powA(2) = 0 - powA(3) = 0 - - norm = 0.d0 - do k=1, prim_num - if (shell_index(k) /= i) cycle - do j=1, prim_num - if (shell_index(j) /= i) cycle - call overlap_gaussian_xyz(C_A,C_A,prim_expo(j),prim_expo(k), & - powA,powA,overlap_x,overlap_y,overlap_z,c,nz) - norm = norm+c*prim_coef(j)*prim_coef(k) * prim_normalization_factor(j) * prim_normalization_factor(k) - enddo - enddo - shell_normalization_factor(i) = 1.d0/dsqrt(norm) - enddo - - endif - endif - IRP_IF MPI_DEBUG - print *, irp_here, mpi_rank - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - IRP_ENDIF - IRP_IF MPI - include 'mpif.h' - integer :: ierr - call MPI_BCAST( shell_normalization_factor, (shell_num), MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - stop 'Unable to read shell_normalization_factor with MPI' - endif - IRP_ENDIF - - call write_time(6) - +BEGIN_PROVIDER [ integer, shell_prim_num_max ] + implicit none + BEGIN_DOC + ! Max number of primitives. + END_DOC + shell_prim_num_max = maxval(shell_prim_num) END_PROVIDER - BEGIN_PROVIDER [ double precision, prim_normalization_factor , (prim_num) ] implicit none BEGIN_DOC @@ -120,3 +64,94 @@ BEGIN_PROVIDER [ double precision, prim_normalization_factor , (prim_num) ] call write_time(6) END_PROVIDER + + BEGIN_PROVIDER [ double precision, shell_coef , (shell_num, shell_prim_num_max) ] +&BEGIN_PROVIDER [ double precision, shell_expo , (shell_num, shell_prim_num_max) ] + implicit none + BEGIN_DOC +! Primitive coefficients and exponents for each shell. + END_DOC + + integer :: i, idx + integer :: count(shell_num) + + count(:) = 0 + do i=1, prim_num + idx = shell_index(i) + count(idx) += 1 + shell_coef(idx, count(idx)) = prim_coef(i) + shell_expo(idx, count(idx)) = prim_expo(i) + end do +END_PROVIDER + + + BEGIN_PROVIDER [ double precision, shell_coef_normalized, (shell_num,shell_prim_num_max) ] +&BEGIN_PROVIDER [ double precision, shell_normalization_factor, (shell_num) ] + implicit none + BEGIN_DOC + ! Coefficients including the |shell| normalization + END_DOC + logical :: has + PROVIDE ezfio_filename + + shell_normalization_factor(:) = 1.d0 + if (mpi_master) then + if (size(shell_normalization_factor) == 0) return + + call ezfio_has_basis_shell_normalization_factor(has) + if (has) then + write(6,'(A)') '.. >>>>> [ IO READ: shell_normalization_factor ] <<<<< ..' + call ezfio_get_basis_shell_normalization_factor(shell_normalization_factor) + endif + endif + IRP_IF MPI_DEBUG + print *, irp_here, mpi_rank + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + IRP_ENDIF + IRP_IF MPI + include 'mpif.h' + integer :: ierr + call MPI_BCAST( shell_normalization_factor, (shell_num), MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + stop 'Unable to read shell_normalization_factor with MPI' + endif + IRP_ENDIF + + call write_time(6) + double precision :: norm,overlap_x,overlap_y,overlap_z,C_A(3), c + integer :: l, powA(3), nz + integer :: i,j,k + nz=100 + C_A = 0.d0 + powA = 0 + shell_coef_normalized = 0.d0 + + do i=1,shell_num + + powA(1) = shell_ang_mom(i) + + ! Normalization of the primitives + if (primitives_normalized) then + do j=1,shell_prim_num(i) + call overlap_gaussian_xyz(C_A,C_A,shell_expo(i,j),shell_expo(i,j), & + powA,powA,overlap_x,overlap_y,overlap_z,norm,nz) + shell_coef_normalized(i,j) = shell_coef(i,j)/dsqrt(norm) + enddo + else + do j=1,shell_prim_num(i) + shell_coef_normalized(i,j) = shell_coef(i,j) + enddo + endif + + ! Normalization of the contracted basis functions + norm = 0.d0 + do j=1,shell_prim_num(i) + do k=1,shell_prim_num(i) + call overlap_gaussian_xyz(C_A,C_A,shell_expo(i,j),shell_expo(i,k),powA,powA,overlap_x,overlap_y,overlap_z,c,nz) + norm = norm+c*shell_coef_normalized(i,j)*shell_coef_normalized(i,k) + enddo + enddo + shell_normalization_factor(i) *= 1.d0/dsqrt(norm) + enddo +END_PROVIDER + From 1727f547f78e92a2e6fa6076c15f08245c64ca53 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 15 Sep 2022 18:12:06 +0200 Subject: [PATCH 09/11] Fix normalization in qp_edit --- src/determinants/determinants.irp.f | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/determinants/determinants.irp.f b/src/determinants/determinants.irp.f index e1c14bfe..5f1c92a2 100644 --- a/src/determinants/determinants.irp.f +++ b/src/determinants/determinants.irp.f @@ -537,6 +537,7 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) double precision, intent(in) :: psicoef(dim_psicoef,nstates) integer*8, allocatable :: psi_det_save(:,:,:) double precision, allocatable :: psi_coef_save(:,:) + double precision, allocatable :: psi_coef_save2(:,:) double precision :: accu_norm integer :: i,j,k, ndet_qp_edit @@ -572,18 +573,17 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) enddo call ezfio_set_determinants_psi_coef(psi_coef_save) - deallocate (psi_coef_save) - allocate (psi_coef_save(ndet_qp_edit,nstates)) + allocate (psi_coef_save2(ndet_qp_edit,nstates)) do k=1,nstates do i=1,ndet_qp_edit - psi_coef_save(i,k) = psicoef(i,k) + psi_coef_save2(i,k) = psi_coef_save(i,k) enddo - call normalize(psi_coef_save(1,k),ndet_qp_edit) enddo - call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save) + call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save2) deallocate (psi_coef_save) + deallocate (psi_coef_save2) call write_int(6,ndet,'Saved determinants') endif From 71693637b65c82160fb3476bd4623c33af198fe8 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 15 Sep 2022 18:12:06 +0200 Subject: [PATCH 10/11] Fix normalization in qp_edit --- src/determinants/determinants.irp.f | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/determinants/determinants.irp.f b/src/determinants/determinants.irp.f index eeadf779..b6b11485 100644 --- a/src/determinants/determinants.irp.f +++ b/src/determinants/determinants.irp.f @@ -537,6 +537,7 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) double precision, intent(in) :: psicoef(dim_psicoef,nstates) integer*8, allocatable :: psi_det_save(:,:,:) double precision, allocatable :: psi_coef_save(:,:) + double precision, allocatable :: psi_coef_save2(:,:) double precision :: accu_norm integer :: i,j,k, ndet_qp_edit @@ -572,18 +573,17 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) enddo call ezfio_set_determinants_psi_coef(psi_coef_save) - deallocate (psi_coef_save) - allocate (psi_coef_save(ndet_qp_edit,nstates)) + allocate (psi_coef_save2(ndet_qp_edit,nstates)) do k=1,nstates do i=1,ndet_qp_edit - psi_coef_save(i,k) = psicoef(i,k) + psi_coef_save2(i,k) = psi_coef_save(i,k) enddo - call normalize(psi_coef_save(1,k),ndet_qp_edit) enddo - call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save) + call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save2) deallocate (psi_coef_save) + deallocate (psi_coef_save2) call write_int(6,ndet,'Saved determinants') endif From 34f996064e61f9006c069206418e16ae4f6e6c7c Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 26 Sep 2022 18:42:06 +0200 Subject: [PATCH 11/11] Doc in qp_set_frozen_core --- bin/qp_set_frozen_core | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/qp_set_frozen_core b/bin/qp_set_frozen_core index bc6f6834..f9761144 100755 --- a/bin/qp_set_frozen_core +++ b/bin/qp_set_frozen_core @@ -11,8 +11,8 @@ Usage: Options: -q --query Prints in the standard output the number of frozen MOs - -l --large Use a small core - -s --small Use a large core + -l --large Use a large core + -s --small Use a small core -u --unset Unset frozen core