From 4f332ee494b8a5de628107f9b3d58948aa566a53 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 1 Oct 2019 10:38:29 +0200 Subject: [PATCH 1/4] Fixed 6-31G and quickstart (#65) * Fixed 6-31 basis sets * Bug in quickstart --- data/basis/6-31++g | 10 ++++++++++ data/basis/6-31++g_star_star | 25 +++++++++++++++++++------ data/basis/6-31+g_star | 16 ++++++++++++++++ data/basis/6-311++g_2d_2p | 12 ++++++++++++ data/basis/6-311+g_star | 20 ++++++++++++++++++++ data/basis/6-311G_star | 20 ++++++++++++++++++++ data/basis/6-31g_star | 16 ++++++++++++++++ docs/source/users_guide/quickstart.rst | 2 +- 8 files changed, 114 insertions(+), 7 deletions(-) diff --git a/data/basis/6-31++g b/data/basis/6-31++g index 7e36d0f9..e1994202 100644 --- a/data/basis/6-31++g +++ b/data/basis/6-31++g @@ -8,6 +8,16 @@ S 1 S 1 1 0.0360000 1.0000000 +HELIUM +S 3 +1 0.3842163400E+02 0.4013973935E-01 +2 0.5778030000E+01 0.2612460970E+00 +3 0.1241774000E+01 0.7931846246E+00 +S 1 +1 0.2979640000E+00 1.0000000 +S 1 +1 0.8600000000E-01 0.1000000000E+01 + LITHIUM S 6 1 642.4189200 0.0021426 diff --git a/data/basis/6-31++g_star_star b/data/basis/6-31++g_star_star index ae124833..4f4ead25 100644 --- a/data/basis/6-31++g_star_star +++ b/data/basis/6-31++g_star_star @@ -1,14 +1,27 @@ + HYDROGEN S 3 - 1 18.7311370 0.03349460 - 2 2.8253937 0.23472695 - 3 0.6401217 0.81375733 +1 0.1873113696E+02 0.3349460434E-01 +2 0.2825394365E+01 0.2347269535E+00 +3 0.6401216923E+00 0.8137573261E+00 S 1 - 1 0.1612778 1.0000000 +1 0.1612777588E+00 1.0000000 S 1 - 1 0.0360000 1.0000000 +1 0.3600000000E-01 0.1000000000E+01 P 1 - 1 1.1000000 1.0000000 +1 0.1100000000E+01 1.0000000 + +HELIUM +S 3 +1 0.3842163400E+02 0.4013973935E-01 +2 0.5778030000E+01 0.2612460970E+00 +3 0.1241774000E+01 0.7931846246E+00 +S 1 +1 0.2979640000E+00 1.0000000 +S 1 +1 0.8600000000E-01 0.1000000000E+01 +P 1 +1 0.1100000000E+01 1.0000000 LITHIUM S 6 diff --git a/data/basis/6-31+g_star b/data/basis/6-31+g_star index 663f7af8..bc112c64 100644 --- a/data/basis/6-31+g_star +++ b/data/basis/6-31+g_star @@ -1,3 +1,19 @@ +HYDROGEN +S 3 +1 0.1873113696E+02 0.3349460434E-01 +2 0.2825394365E+01 0.2347269535E+00 +3 0.6401216923E+00 0.8137573261E+00 +S 1 +1 0.1612777588E+00 1.0000000 + +HELIUM +S 3 +1 0.3842163400E+02 0.4013973935E-01 +2 0.5778030000E+01 0.2612460970E+00 +3 0.1241774000E+01 0.7931846246E+00 +S 1 +1 0.2979640000E+00 1.0000000 + LITHIUM S 6 1 642.4189200 0.0021426 diff --git a/data/basis/6-311++g_2d_2p b/data/basis/6-311++g_2d_2p index 5cf54355..de8f54b4 100644 --- a/data/basis/6-311++g_2d_2p +++ b/data/basis/6-311++g_2d_2p @@ -14,6 +14,18 @@ P 1 P 1 1 0.3750000 1.0000000 +HELIUM +S 3 +1 98.12430 0.0287452 +2 14.76890 0.208061 +3 3.318830 0.837635 +S 1 +1 0.874047 1.000000 +S 1 +1 0.244564 1.000000 +P 1 +1 0.750 1.000000 + LITHIUM S 6 1 900.4600000 0.00228704 diff --git a/data/basis/6-311+g_star b/data/basis/6-311+g_star index 9a6bd86f..14ec3a44 100644 --- a/data/basis/6-311+g_star +++ b/data/basis/6-311+g_star @@ -1,3 +1,23 @@ +HYDROGEN +S 3 +1 33.86500 0.0254938 +2 5.094790 0.190373 +3 1.158790 0.852161 +S 1 +1 0.325840 1.000000 +S 1 +1 0.102741 1.000000 + +HELIUM +S 3 +1 98.12430 0.0287452 +2 14.76890 0.208061 +3 3.318830 0.837635 +S 1 +1 0.874047 1.000000 +S 1 +1 0.244564 1.000000 + LITHIUM S 6 1 900.4600000 0.00228704 diff --git a/data/basis/6-311G_star b/data/basis/6-311G_star index 21621a45..c9cb224c 100644 --- a/data/basis/6-311G_star +++ b/data/basis/6-311G_star @@ -1,3 +1,23 @@ +HYDROGEN +S 3 +1 33.86500 0.0254938 +2 5.094790 0.190373 +3 1.158790 0.852161 +S 1 +1 0.325840 1.000000 +S 1 +1 0.102741 1.000000 + +HELIUM +S 3 +1 98.12430 0.0287452 +2 14.76890 0.208061 +3 3.318830 0.837635 +S 1 +1 0.874047 1.000000 +S 1 +1 0.244564 1.000000 + LITHIUM S 6 1 900.4600000 0.00228704 diff --git a/data/basis/6-31g_star b/data/basis/6-31g_star index 2e79dff2..12291b80 100644 --- a/data/basis/6-31g_star +++ b/data/basis/6-31g_star @@ -1,3 +1,19 @@ +HYDROGEN +S 3 + 1 18.7311370 0.03349460 + 2 2.8253937 0.23472695 + 3 0.6401217 0.81375733 +S 1 + 1 0.1612778 1.0000000 + +HELIUM +S 3 + 1 38.4216340 0.0237660 + 2 5.7780300 0.1546790 + 3 1.2417740 0.4696300 +S 1 + 1 0.2979640 1.0000000 + LITHIUM S 6 1 642.4189200 0.0021426 diff --git a/docs/source/users_guide/quickstart.rst b/docs/source/users_guide/quickstart.rst index 2883ed96..f0620c5a 100644 --- a/docs/source/users_guide/quickstart.rst +++ b/docs/source/users_guide/quickstart.rst @@ -115,7 +115,7 @@ create an |EZFIO| database with the 6-31G basis set: .. code:: bash - qp create_ezfio -b "6-31G" hcn.xyz -o hcn + qp create_ezfio -b "6-31g" hcn.xyz -o hcn The EZFIO database now contains data relative to the nuclear coordinates and the atomic basis set: From 304c682a6060a6ecb5ff028753292b1235afd041 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 17 Oct 2019 23:50:42 +0200 Subject: [PATCH 2/4] Biblio (#66) --- docs/source/research.bib | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/source/research.bib b/docs/source/research.bib index a57bf58a..145fd64e 100644 --- a/docs/source/research.bib +++ b/docs/source/research.bib @@ -9,20 +9,23 @@ url = {https://arxiv.org/abs/1908.09914} } -@article{Giner2019Jul, +%%%% PUBLISHED PAPERS + +@article{Giner2019Oct, author = {Giner, Emmanuel and Scemama, Anthony and Toulouse, Julien and Loos, Pierre-Fran{\c{c}}ois}, - title = {{Chemically Accurate Excitation Energies With Small Basis Sets}}, - journal = {arXiv}, + title = {{Chemically accurate excitation energies with small basis sets}}, + journal = {J. Chem. Phys.}, + volume = {151}, + number = {14}, + pages = {144118}, year = {2019}, - month = {Jul}, - eprint = {1907.01245}, - url = {https://arxiv.org/abs/1907.01245} + month = {Oct}, + issn = {0021-9606}, + publisher = {American Institute of Physics}, + doi = {10.1063/1.5122976} } - - -%%%% PUBLISHED PAPERS @article{Burton2019Sep, author = {Burton, Hugh G. A. and Thom, Alex J. W.}, title = {{General Approach for Multireference Ground and Excited States Using Nonorthogonal Configuration Interaction}}, From 1bf836d4a3794a789a8beb7ddbea25d200e8bbc8 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 21 Oct 2019 15:00:36 +0200 Subject: [PATCH 3/4] Bugfix (#67) * Fixing opam installation * Fixed 6-31 basis sets * Bug in quickstart * Use irpf90 v1.7.6 * Fix IRPF90 Path --- configure | 68 ++++++++++++++++++++++----------------------------- etc/irpf90.rc | 2 +- 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/configure b/configure index 641e01da..21df1b71 100755 --- a/configure +++ b/configure @@ -9,6 +9,22 @@ eval set -- "$TEMP" export QP_ROOT="$( cd "$(dirname "$0")" ; pwd -P )" echo "QP_ROOT="$QP_ROOT +# When updating version, update also etc files + +BATS_URL="https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz" +BUBBLE_URL="https://github.com/projectatomic/bubblewrap/releases/download/v0.3.3/bubblewrap-0.3.3.tar.xz" +DOCOPT_URL="https://github.com/docopt/docopt/archive/0.6.2.tar.gz" +EZFIO_URL="https://gitlab.com/scemama/EZFIO/-/archive/v1.4.0/EZFIO-v1.4.0.tar.gz" +F77ZMQ_URL="https://github.com/scemama/f77_zmq/archive/v4.2.5.tar.gz" +GMP_URL="ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2" +IRPF90_URL="https://gitlab.com/scemama/irpf90/-/archive/v1.7.6/irpf90-v1.7.6.tar.gz" +LIBCAP_URL="https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/snapshot/libcap-2.25.tar.gz" +NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip" +OCAML_URL="https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh" +RESULTS_URL="https://gitlab.com/scemama/resultsFile/-/archive/master/resultsFile-master.tar.gz" +ZEROMQ_URL="https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz" +ZLIB_URL="https://www.zlib.net/zlib-1.2.11.tar.gz" + function help() { @@ -183,9 +199,7 @@ for PACKAGE in ${PACKAGES} ; do if [[ ${PACKAGE} = ninja ]] ; then - download \ - "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip" \ - "${QP_ROOT}"/external/ninja.zip + download ${NINJA_URL} "${QP_ROOT}"/external/ninja.zip execute << EOF rm -f "\${QP_ROOT}"/bin/ninja unzip "\${QP_ROOT}"/external/ninja.zip -d "\${QP_ROOT}"/bin @@ -194,9 +208,7 @@ EOF elif [[ ${PACKAGE} = gmp ]] ; then - download \ - "ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2" \ - "${QP_ROOT}"/external/gmp.tar.bz2 + download ${GMP_URL} "${QP_ROOT}"/external/gmp.tar.bz2 execute << EOF cd "\${QP_ROOT}"/external tar --bzip2 --extract --file gmp.tar.bz2 @@ -208,9 +220,7 @@ EOF elif [[ ${PACKAGE} = libcap ]] ; then - download \ - "https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/snapshot/libcap-2.25.tar.gz" \ - "${QP_ROOT}"/external/libcap.tar.gz + download ${LIBCAP_URL} "${QP_ROOT}"/external/libcap.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file libcap.tar.gz @@ -221,9 +231,7 @@ EOF elif [[ ${PACKAGE} = bwrap ]] ; then - download \ - "https://github.com/projectatomic/bubblewrap/releases/download/v0.3.3/bubblewrap-0.3.3.tar.xz" \ - "${QP_ROOT}"/external/bwrap.tar.xz + download ${BUBBLE_URL} "${QP_ROOT}"/external/bwrap.tar.xz execute << EOF cd "\${QP_ROOT}"/external tar --xz --extract --file bwrap.tar.xz @@ -236,9 +244,7 @@ EOF elif [[ ${PACKAGE} = irpf90 ]] ; then # When changing version of irpf90, don't forget to update etc/irpf90.rc - download \ - "https://gitlab.com/scemama/irpf90/-/archive/v1.7.5/irpf90-v1.7.5.tar.gz" \ - "${QP_ROOT}"/external/irpf90.tar.gz + download ${IRPF90_URL} "${QP_ROOT}"/external/irpf90.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file irpf90.tar.gz @@ -250,9 +256,7 @@ EOF elif [[ ${PACKAGE} = zeromq ]] ; then - download \ - "https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz" \ - "${QP_ROOT}"/external/zeromq.tar.gz + download ${ZEROMQ_URL} "${QP_ROOT}"/external/zeromq.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file zeromq.tar.gz @@ -266,9 +270,7 @@ EOF elif [[ ${PACKAGE} = f77zmq ]] ; then - download \ - "https://github.com/scemama/f77_zmq/archive/v4.2.5.tar.gz" \ - "${QP_ROOT}"/external/f77_zmq.tar.gz + download ${F77ZMQ_URL} "${QP_ROOT}"/external/f77_zmq.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file f77_zmq.tar.gz @@ -284,9 +286,7 @@ EOF elif [[ ${PACKAGE} = ocaml ]] ; then - download \ - "https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh" \ - "${QP_ROOT}"/external/opam_installer.sh + download ${OCAML_URL} "${QP_ROOT}"/external/opam_installer.sh if [[ -n ${TRAVIS} ]] ; then # Special commands for Travis CI @@ -338,9 +338,7 @@ EOF elif [[ ${PACKAGE} = ezfio ]] ; then - download \ - "https://gitlab.com/scemama/EZFIO/-/archive/v1.4.0/EZFIO-v1.4.0.tar.gz" \ - "${QP_ROOT}"/external/ezfio.tar.gz + download ${EZFIO_URL} "${QP_ROOT}"/external/ezfio.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file ezfio.tar.gz @@ -351,9 +349,7 @@ EOF elif [[ ${PACKAGE} = zlib ]] ; then - download \ - "https://www.zlib.net/zlib-1.2.11.tar.gz" \ - "${QP_ROOT}"/external/zlib.tar.gz + download ${ZLIB_URL} "${QP_ROOT}"/external/zlib.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file zlib.tar.gz @@ -366,9 +362,7 @@ EOF elif [[ ${PACKAGE} = docopt ]] ; then - download \ - "https://github.com/docopt/docopt/archive/0.6.2.tar.gz" \ - "${QP_ROOT}"/external/docopt.tar.gz + download ${DOCOPT_URL} "${QP_ROOT}"/external/docopt.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file docopt.tar.gz @@ -379,9 +373,7 @@ EOF elif [[ ${PACKAGE} = resultsFile ]] ; then - download \ - "https://gitlab.com/scemama/resultsFile/-/archive/master/resultsFile-master.tar.gz" \ - "${QP_ROOT}"/external/resultsFile.tar.gz + download ${RESULTS_URL} "${QP_ROOT}"/external/resultsFile.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar --gunzip --extract --file resultsFile.tar.gz @@ -391,9 +383,7 @@ EOF elif [[ ${PACKAGE} = bats ]] ; then - download \ - "https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz" \ - "${QP_ROOT}"/external/bats.tar.gz + download ${BATS_URL} "${QP_ROOT}"/external/bats.tar.gz execute << EOF cd "\${QP_ROOT}"/external tar -zxf bats.tar.gz diff --git a/etc/irpf90.rc b/etc/irpf90.rc index 474af1a2..42ec4502 100644 --- a/etc/irpf90.rc +++ b/etc/irpf90.rc @@ -1,7 +1,7 @@ # Configuration of IRPF90 package # Set the path of IRPF90 here: -export IRPF90_PATH=${QP_ROOT}/external/irpf90-v1.7.5 +export IRPF90_PATH=${QP_ROOT}/external/irpf90-v1.7.6 export PATH=${PATH}:${IRPF90_PATH}/bin export IRPF90=${IRPF90_PATH}/bin/irpf90 From 6a41ec1da4b46eecb6d217a25cc3216d3a76cfee Mon Sep 17 00:00:00 2001 From: eginer Date: Mon, 21 Oct 2019 19:19:26 +0200 Subject: [PATCH 4/4] casscf really good --- src/casscf/NEED | 2 +- src/casscf/casscf.irp.f | 85 +--------------- src/casscf/change_bitmasks.irp.f | 14 --- src/casscf/cipsi_routines.irp.f | 75 --------------- src/casscf/cisd_routine.irp.f | 85 ---------------- src/casscf/cisdtq_routine.irp.f | 47 --------- src/casscf/densities.irp.f | 2 +- src/casscf/gradient.irp.f | 2 - src/casscf/h_apply.irp.f | 18 ---- src/casscf/hessian.irp.f | 71 ++++---------- src/generators_fluid/NEED | 1 - src/generators_fluid/README.rst | 0 src/generators_fluid/extract_cas.irp.f | 23 ----- src/generators_fluid/generators.irp.f | 101 -------------------- src/generators_fluid/generators_cas.irp.f | 69 ------------- src/generators_fluid/generators_hf.irp.f | 51 ---------- src/generators_fluid/generators_hf_sd.irp.f | 80 ---------------- 17 files changed, 26 insertions(+), 700 deletions(-) delete mode 100644 src/casscf/change_bitmasks.irp.f delete mode 100644 src/casscf/cipsi_routines.irp.f delete mode 100644 src/generators_fluid/NEED delete mode 100644 src/generators_fluid/README.rst delete mode 100644 src/generators_fluid/extract_cas.irp.f delete mode 100644 src/generators_fluid/generators.irp.f delete mode 100644 src/generators_fluid/generators_cas.irp.f delete mode 100644 src/generators_fluid/generators_hf.irp.f delete mode 100644 src/generators_fluid/generators_hf_sd.irp.f diff --git a/src/casscf/NEED b/src/casscf/NEED index b992ff71..d9da718e 100644 --- a/src/casscf/NEED +++ b/src/casscf/NEED @@ -1,4 +1,4 @@ cipsi selectors_full -generators_fluid +generators_cas two_body_rdm diff --git a/src/casscf/casscf.irp.f b/src/casscf/casscf.irp.f index 8b5a365f..8fe77fcc 100644 --- a/src/casscf/casscf.irp.f +++ b/src/casscf/casscf.irp.f @@ -4,86 +4,9 @@ program casscf ! TODO : Put the documentation of the program here END_DOC no_vvvv_integrals = .True. - SOFT_TOUCH no_vvvv_integrals - threshold_davidson = 1.d-7 - touch threshold_davidson - if(cisd_guess)then - logical :: converged - integer :: iteration - double precision :: energy - print*,'*******************************' - print*,'*******************************' - print*,'*******************************' - print*,'USING A CISD WAVE FUNCTION AS GUESS FOR THE MCSCF WF' - print*,'*******************************' - print*,'*******************************' - converged = .False. - iteration = 0 - generators_type = "HF" - touch generators_type - read_wf = .False. - touch read_wf - logical :: do_cisdtq - do_cisdtq = .True. - double precision :: thr - thr = 5.d-3 - do while (.not.converged) - call cisd_scf_iteration(converged,iteration,energy,thr) - if(HF_index.ne.1.and.iteration.gt.0)then - print*,'*******************************' - print*,'*******************************' - print*,'The HF determinant is not the dominant determinant in the CISD WF ...' - print*,'Therefore we skip the CISD WF ..' - print*,'*******************************' - print*,'*******************************' - do_cisdtq = .False. - exit - endif - if(iteration.gt.15.and..not.converged)then - print*,'It seems that the orbital optimization for the CISD WAVE FUNCTION CANNOT CONVERGE ...' - print*,'Passing to CISDTQ WAVE FUNCTION' - exit - endif - enddo - if(do_cisdtq)then - print*,'*******************************' - print*,'*******************************' - print*,'*******************************' - print*,'SWITCHING WITH A CISDTQ WAVE FUNCTION AS GUESS FOR THE MCSCF WF' - print*,'*******************************' - print*,'*******************************' - converged = .False. - iteration = 0 - read_wf = .False. - touch read_wf - pt2_max = 0.01d0 - touch pt2_max - energy = 0.d0 - do while (.not.converged) - call cisdtq_scf_iteration(converged,iteration,energy,thr) - if(HF_index.ne.1.and.iteration.gt.0)then - print*,'*******************************' - print*,'*******************************' - print*,'The HF determinant is not the dominant determinant in the CISDTQ WF ...' - print*,'Therefore we skip the CISDTQ WF ..' - print*,'*******************************' - print*,'*******************************' - exit - endif - if(iteration.gt.15.and..not.converged)then - print*,'It seems that the orbital optimization for the CISDTQ WAVE FUNCTION CANNOT CONVERGE ...' - print*,'Passing to CISDTQ WAVE FUNCTION' - exit - endif - enddo - endif - endif - read_wf = .False. - touch read_wf - pt2_max = 0.0d0 - touch pt2_max -! call run_cipsi_scf - call run + pt2_max = 0.02 + SOFT_TOUCH no_vvvv_integrals pt2_max + call run end subroutine run @@ -107,7 +30,7 @@ subroutine run call write_double(6,energy_improvement, 'Predicted energy improvement') converged = dabs(energy_improvement) < thresh_scf -! pt2_max = dabs(energy_improvement / pt2_relative_error) + pt2_max = dabs(energy_improvement / pt2_relative_error) mo_coef = NewOrbs call save_mos diff --git a/src/casscf/change_bitmasks.irp.f b/src/casscf/change_bitmasks.irp.f deleted file mode 100644 index cad6ec38..00000000 --- a/src/casscf/change_bitmasks.irp.f +++ /dev/null @@ -1,14 +0,0 @@ -subroutine only_act_bitmask - implicit none - integer :: i,j,k - do k = 1, N_generators_bitmask - do j = 1, 6 - do i = 1, N_int - generators_bitmask(i,1,j,k) = act_bitmask(i,1) - generators_bitmask(i,2,j,k) = act_bitmask(i,2) - enddo - enddo - enddo - touch generators_bitmask -end - diff --git a/src/casscf/cipsi_routines.irp.f b/src/casscf/cipsi_routines.irp.f deleted file mode 100644 index 272a7116..00000000 --- a/src/casscf/cipsi_routines.irp.f +++ /dev/null @@ -1,75 +0,0 @@ -subroutine run_cipsi_scf - implicit none - double precision :: energy_old, energy, extrap,extrap_old,pt2_max_begin - logical :: converged - integer :: iteration - print*,'*********************************' - print*,'*********************************' - print*,' DOING THE CIPSI-SCF ' - print*,'*********************************' - converged = .False. - pt2_max_begin = pt2_max - energy = 0.d0 - extrap = 0.d0 - mo_label = "MCSCF" - iteration = 1 - threshold_davidson = 1.d-09 - touch threshold_davidson - do while (.not.converged) - print*,'' - call write_int(6,iteration,'CI STEP OF THE ITERATION = ') - call write_double(6,pt2_max,'PT2 MAX = ') - !call cisd_guess_wf - generators_type = "CAS" - touch generators_type - call run_stochastic_cipsi - call change_orb_cipsi(converged,iteration,energy) - if(iteration.gt.n_it_scf_max.and..not.converged)then - print*,'It seems that the orbital optimization for the CISDTQ WAVE FUNCTION CANNOT CONVERGE ...' - print*,'The required delta E was :',thresh_scf - print*,'The obtained delta E was :',extrap - extrap_old - print*,'After ',iteration,'iterations ...' - print*,'Getting out of the SCF loop ...' - exit - endif - iteration += 1 - enddo - -end - -subroutine change_orb_cipsi(converged,iteration,energy) - implicit none - double precision :: energy_old, extrap,extrap_old,pt2_max_begin - double precision, intent(inout):: energy - logical, intent(out) :: converged - integer, intent(in) :: iteration - extrap_old = energy - energy = eone+etwo+ecore - extrap = extrapolated_energy(2,1) - - call write_time(6) - call write_int(6,iteration,'CAS-SCF iteration') - call write_double(6,energy,'CAS-SCF variational energy') - call write_double(6,extrap,'CAS-SCF extrapolated energy') - call write_double(6,extrap - extrap_old,'Change in extrapolated energy') - energy = extrap - call write_double(6,energy_improvement, 'Predicted energy improvement') - - converged = dabs(extrap - extrap_old) < thresh_scf - pt2_max = dabs(extrap - extrap_old) * 10.d0 - pt2_max = min(pt2_max,1.d-2) - pt2_max = max(pt2_max,1.d-10) - if(N_det.gt.10**6)then - pt2_max = max(pt2_max,1.d-2) - endif - - mo_coef = NewOrbs - call save_mos - call map_deinit(mo_integrals_map) - N_det = N_det/2 - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - read_wf = .True. - FREE mo_integrals_map mo_two_e_integrals_in_map - SOFT_TOUCH mo_coef N_det pt2_max psi_det psi_coef -end diff --git a/src/casscf/cisd_routine.irp.f b/src/casscf/cisd_routine.irp.f index a4cbfcfb..e69de29b 100644 --- a/src/casscf/cisd_routine.irp.f +++ b/src/casscf/cisd_routine.irp.f @@ -1,85 +0,0 @@ -subroutine cisd_scf_iteration(converged,iteration,energy,thr) - implicit none - double precision, intent(in) :: thr - logical, intent(out) :: converged - integer, intent(inout) :: iteration - double precision, intent(out) :: energy - converged = .False. - call only_act_bitmask - N_det = N_det_generators - psi_coef = psi_coef_generators - psi_det = psi_det_generators - touch N_det psi_coef psi_det - call run_cisd - call change_orb_cisd(converged,iteration,energy,thr) -end - - -subroutine cisd_guess_wf - implicit none - call only_act_bitmask - N_det = N_det_generators - psi_coef = psi_coef_generators - psi_det = psi_det_generators - touch N_det psi_coef psi_det - generators_type = "HF" - touch generators_type - call run_cisd - touch N_det psi_coef psi_det psi_coef_sorted psi_det_sorted psi_det_sorted_order psi_average_norm_contrib_sorted - -end - - - -subroutine change_orb_cisd(converged,iteration,energy,thr) - implicit none - double precision, intent(in) :: thr - logical, intent(inout) :: converged - integer, intent(inout) :: iteration - double precision, intent(inout) :: energy - double precision :: energy_old - energy_old = energy - - energy = eone+etwo+ecore - - call write_time(6) - call write_int(6,iteration,'CISD-SCF iteration') - call write_double(6,energy,'CISD-SCF energy') - call write_double(6,energy_improvement, 'Predicted energy improvement') - converged = dabs(energy_improvement) < thr - - mo_coef = NewOrbs - call save_mos - call map_deinit(mo_integrals_map) - FREE mo_integrals_map mo_two_e_integrals_in_map - iteration += 1 - -end - -subroutine run_cisd - implicit none - integer :: i - - if(pseudo_sym)then - call H_apply_cisd_sym - else - call H_apply_cisd - endif - print *, 'N_det = ', N_det - print*,'******************************' - print *, 'Energies of the states:' - do i = 1,N_states - print *, i, CI_energy(i) - enddo - if (N_states > 1) then - print*,'******************************' - print*,'Excitation energies ' - do i = 2, N_states - print*, i ,CI_energy(i) - CI_energy(1) - enddo - endif - psi_coef = ci_eigenvectors - SOFT_TOUCH psi_coef - call save_wavefunction - -end diff --git a/src/casscf/cisdtq_routine.irp.f b/src/casscf/cisdtq_routine.irp.f index 0479d462..e69de29b 100644 --- a/src/casscf/cisdtq_routine.irp.f +++ b/src/casscf/cisdtq_routine.irp.f @@ -1,47 +0,0 @@ -subroutine cisdtq_scf_iteration(converged,iteration,energy,thr) - implicit none - double precision, intent(in) :: thr - logical, intent(out) :: converged - integer, intent(inout) :: iteration - double precision, intent(inout) :: energy - converged = .False. - call only_act_bitmask - generators_type = "HF_SD" - threshold_generators = 0.99d0 - touch threshold_generators - touch generators_type - selection_factor = 5 - touch selection_factor - call run_stochastic_cipsi - call change_orb_cisdtq(converged,iteration,energy,thr) -end - -subroutine change_orb_cisdtq(converged,iteration,energy,thr) - implicit none - double precision, intent(in) :: thr - logical, intent(inout) :: converged - integer, intent(inout) :: iteration - double precision, intent(inout) :: energy - double precision :: extrap,extrap_old,pt2_max_begin - extrap_old = energy - extrap = extrapolated_energy(2,1) - energy = extrap - - call write_time(6) - call write_int(6,iteration,'CISDTQ-SCF iteration') - call write_double(6,energy,'CISDTQ-SCF variational energy') - call write_double(6,extrap,'CISDTQ-SCF extrapolated energy') - call write_double(6,extrap - extrap_old,'Change in extrapolated energy') - - converged = dabs(extrap - extrap_old) < thr - pt2_max = dabs(extrap - extrap_old) * 10.d0 - pt2_max = max(pt2_max,1.d-10) - - mo_coef = NewOrbs - call save_mos - call map_deinit(mo_integrals_map) - FREE mo_integrals_map mo_two_e_integrals_in_map - iteration += 1 - -end - diff --git a/src/casscf/densities.irp.f b/src/casscf/densities.irp.f index 292067b4..3d1ff0f9 100644 --- a/src/casscf/densities.irp.f +++ b/src/casscf/densities.irp.f @@ -56,8 +56,8 @@ BEGIN_PROVIDER [real*8, P0tuvx, (n_act_orb,n_act_orb,n_act_orb,n_act_orb) ] uu = list_act(u) do t = 1, n_act_orb tt = list_act(t) -! P0tuvx(t,u,v,x) = state_av_act_two_rdm_openmp_spin_trace_mo(t,v,u,x) P0tuvx(t,u,v,x) = state_av_act_two_rdm_spin_trace_mo(t,v,u,x) +! P0tuvx(t,u,v,x) = act_two_rdm_spin_trace_mo(t,v,u,x) enddo enddo enddo diff --git a/src/casscf/gradient.irp.f b/src/casscf/gradient.irp.f index f00bc7c8..6bf8b93b 100644 --- a/src/casscf/gradient.irp.f +++ b/src/casscf/gradient.irp.f @@ -171,11 +171,9 @@ BEGIN_PROVIDER [real*8, gradvec2, (nMonoEx)] norm_grad+=gradvec2(indx)*gradvec2(indx) end do norm_grad=sqrt(norm_grad) -! if (bavard) then write(6,*) write(6,*) ' Norm of the orbital gradient (via D, P and integrals): ', norm_grad write(6,*) -! endif END_PROVIDER diff --git a/src/casscf/h_apply.irp.f b/src/casscf/h_apply.irp.f index 6fcb2900..e69de29b 100644 --- a/src/casscf/h_apply.irp.f +++ b/src/casscf/h_apply.irp.f @@ -1,18 +0,0 @@ -! Generates subroutine H_apply_cisd -! ---------------------------------- - -BEGIN_SHELL [ /usr/bin/env python2 ] -from generate_h_apply import H_apply -H = H_apply("cisd",do_double_exc=True) -print H - -from generate_h_apply import H_apply -H = H_apply("cisdtq",do_double_exc=True) -H.set_selection_pt2("epstein_nesbet_2x2") -print H - -H = H_apply("cisd_sym",do_double_exc=True) -H.filter_only_connected_to_hf() -print H -END_SHELL - diff --git a/src/casscf/hessian.irp.f b/src/casscf/hessian.irp.f index 06aed6ef..52be1b76 100644 --- a/src/casscf/hessian.irp.f +++ b/src/casscf/hessian.irp.f @@ -536,9 +536,6 @@ real*8 function hessmat_taub(t,a,u,b) integer :: v3,x3 real*8 :: term,t1,t2,t3 - double precision,allocatable :: P0tuvx_no_t(:,:,:) - double precision :: bielec_pqxx_no_2(n_act_orb,n_act_orb) - double precision :: bielec_pxxq_no_2(n_act_orb,n_act_orb) tt=list_act(t) aa=list_virt(a) if (t == u) then @@ -548,87 +545,59 @@ real*8 function hessmat_taub(t,a,u,b) t2=0.D0 t3=0.D0 t1-=occnum(tt)*Fipq(tt,tt) - do x=1,n_act_orb - xx=list_act(x) - x3=x+n_core_inact_orb - do v=1,n_act_orb - vv=list_act(v) - v3=v+n_core_inact_orb - t2+=P0tuvx_no(t,t,v,x)*bielec_pqxx_no(aa,aa,v3,x3) - end do - end do do v=1,n_act_orb vv=list_act(v) v3=v+n_core_inact_orb do x=1,n_act_orb xx=list_act(x) x3=x+n_core_inact_orb - t2+=(P0tuvx_no(t,x,v,t)+P0tuvx_no(t,x,t,v))* & - bielec_pxxq_no(aa,x3,v3,aa) - end do - end do - do y=1,n_act_orb - do x=1,n_act_orb - xx=list_act(x) - do v=1,n_act_orb - t3-=P0tuvx_no(t,v,x,y)*bielecCI_no(t,v,y,xx) + t2+=2.D0*(P0tuvx_no(t,t,v,x)*bielec_pqxx_no(aa,aa,v3,x3) & + +(P0tuvx_no(t,x,v,t)+P0tuvx_no(t,x,t,v))* & + bielec_pxxq_no(aa,x3,v3,aa)) + do y=1,n_act_orb + t3-=2.D0*P0tuvx_no(t,v,x,y)*bielecCI_no(t,v,y,xx) end do end do end do - term=t1+2.d0*(t2+t3) + term=t1+t2+t3 else bb=list_virt(b) ! ta/tb b/=a - term=0.5d0*occnum(tt)*Fipq(aa,bb) - do x=1,n_act_orb - xx=list_act(x) - x3=x+n_core_inact_orb - do v=1,n_act_orb - vv=list_act(v) - v3=v+n_core_inact_orb - term = term + P0tuvx_no(t,t,v,x)*bielec_pqxx_no(aa,bb,v3,x3) - end do - end do + term=occnum(tt)*Fipq(aa,bb) do v=1,n_act_orb vv=list_act(v) v3=v+n_core_inact_orb do x=1,n_act_orb xx=list_act(x) x3=x+n_core_inact_orb - term= term + (P0tuvx_no(t,x,v,t)+P0tuvx_no(t,x,t,v)) & - *bielec_pxxq_no(aa,x3,v3,bb) + term+=2.D0*(P0tuvx_no(t,t,v,x)*bielec_pqxx_no(aa,bb,v3,x3) & + +(P0tuvx_no(t,x,v,t)+P0tuvx_no(t,x,t,v)) & + *bielec_pxxq_no(aa,x3,v3,bb)) end do end do - term += term end if else ! ta/ub t/=u uu=list_act(u) bb=list_virt(b) - allocate(P0tuvx_no_t(n_act_orb,n_act_orb,n_act_orb)) - P0tuvx_no_t(:,:,:) = P0tuvx_no(t,:,:,:) - do x=1,n_act_orb - x3=x+n_core_inact_orb - do v=1,n_act_orb - v3=v+n_core_inact_orb - bielec_pqxx_no_2(v,x) = bielec_pqxx_no(aa,bb,v3,x3) - bielec_pxxq_no_2(v,x) = bielec_pxxq_no(aa,v3,x3,bb) - end do - end do term=0.D0 - do x=1,n_act_orb - do v=1,n_act_orb - term += P0tuvx_no_t(u,v,x)*bielec_pqxx_no_2(v,x) - term += bielec_pxxq_no_2(x,v) * (P0tuvx_no_t(x,v,u)+P0tuvx_no_t(x,u,v)) + do v=1,n_act_orb + vv=list_act(v) + v3=v+n_core_inact_orb + do x=1,n_act_orb + xx=list_act(x) + x3=x+n_core_inact_orb + term+=2.D0*(P0tuvx_no(t,u,v,x)*bielec_pqxx_no(aa,bb,v3,x3) & + +(P0tuvx_no(t,x,v,u)+P0tuvx_no(t,x,u,v)) & + *bielec_pxxq_no(aa,x3,v3,bb)) end do end do - term = 6.d0*term if (a.eq.b) then term-=0.5D0*(occnum(tt)*Fipq(uu,tt)+occnum(uu)*Fipq(tt,uu)) do v=1,n_act_orb do y=1,n_act_orb do x=1,n_act_orb - term-=P0tuvx_no_t(v,x,y)*bielecCI_no(x,y,v,uu) + term-=P0tuvx_no(t,v,x,y)*bielecCI_no(x,y,v,uu) term-=P0tuvx_no(u,v,x,y)*bielecCI_no(x,y,v,tt) end do end do diff --git a/src/generators_fluid/NEED b/src/generators_fluid/NEED deleted file mode 100644 index d3d4d2c7..00000000 --- a/src/generators_fluid/NEED +++ /dev/null @@ -1 +0,0 @@ -determinants diff --git a/src/generators_fluid/README.rst b/src/generators_fluid/README.rst deleted file mode 100644 index e69de29b..00000000 diff --git a/src/generators_fluid/extract_cas.irp.f b/src/generators_fluid/extract_cas.irp.f deleted file mode 100644 index 9cdaf27f..00000000 --- a/src/generators_fluid/extract_cas.irp.f +++ /dev/null @@ -1,23 +0,0 @@ -subroutine extract_cas - implicit none - BEGIN_DOC - ! Replaces the total wave function by the normalized projection on the CAS. - END_DOC - - integer :: i,j,k - do k=1,N_states - do j=1,N_det_generators - psi_coef(j,k) = psi_coef_generators(j,k) - enddo - enddo - - do j=1,N_det_generators - do k=1,N_int - psi_det(k,1,j) = psi_det_generators(k,1,j) - psi_det(k,2,j) = psi_det_generators(k,2,j) - enddo - enddo - N_det = N_det_generators - - SOFT_TOUCH N_det psi_det psi_coef -end diff --git a/src/generators_fluid/generators.irp.f b/src/generators_fluid/generators.irp.f deleted file mode 100644 index 153ab605..00000000 --- a/src/generators_fluid/generators.irp.f +++ /dev/null @@ -1,101 +0,0 @@ -use bitmasks - -BEGIN_PROVIDER [ character*(32), generators_type] - implicit none - generators_type = trim("CAS") - -END_PROVIDER - -BEGIN_PROVIDER [ integer, N_det_generators ] - implicit none - BEGIN_DOC - ! Number of generator detetrminants - END_DOC - if(generators_type == "CAS")then - N_det_generators = N_det_generators_CAS - else if (generators_type == "HF")then - N_det_generators = N_det_generators_HF - else if (generators_type == "HF_SD")then - N_det_generators = N_det_generators_HF_SD - endif - N_det_generators = max(N_det_generators,1) - call write_int(6,N_det_generators,'Number of generators') -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_generators, (psi_det_size,N_states) ] - implicit none - BEGIN_DOC - ! For Single reference wave functions, the generator is the - ! Hartree-Fock determinant - END_DOC - - if(generators_type == "CAS")then - psi_det_generators(1:N_int,1:2,1:N_det_generators_CAS) = psi_det_generators_CAS(1:N_int,1:2,1:N_det_generators_CAS) - psi_coef_generators(1:N_det_generators_CAS,1:N_states) = psi_coef_generators_CAS(1:N_det_generators_CAS,1:N_states) - else if (generators_type == "HF")then - psi_det_generators(1:N_int,1:2,1:N_det_generators_HF) = psi_det_generators_HF(1:N_int,1:2,1:N_det_generators_HF) - psi_coef_generators(1:N_det_generators_HF,1:N_states) = psi_coef_generators_HF(1:N_det_generators_HF,1:N_states) - else if (generators_type == "HF_SD")then - psi_det_generators(1:N_int,1:2,1:N_det_generators_HF_SD) = psi_det_generators_HF_SD(1:N_int,1:2,1:N_det_generators_HF_SD) - psi_coef_generators(1:N_det_generators_HF_SD,1:N_states) = psi_coef_generators_HF_SD(1:N_det_generators_HF_SD,1:N_states) - endif - -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_sorted_gen, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_sorted_gen, (psi_det_size,N_states) ] -&BEGIN_PROVIDER [ integer, psi_det_sorted_gen_order, (psi_det_size) ] - - implicit none - BEGIN_DOC - ! For Single reference wave functions, the generator is the - ! Hartree-Fock determinant - END_DOC - if(generators_type == "CAS")then - psi_det_sorted_gen = psi_det_sorted_gen_CAS - psi_coef_sorted_gen = psi_coef_sorted_gen_CAS - psi_det_sorted_gen_order = psi_det_sorted_gen_CAS_order - else if(generators_type == "HF")then - psi_det_sorted_gen = 0_bit_kind - psi_coef_sorted_gen = 0.d0 - psi_det_sorted_gen_order = 0 - else if(generators_type == "HF_SD")then - psi_det_sorted_gen = psi_det_sorted_gen_HF_SD - psi_coef_sorted_gen = psi_coef_sorted_gen_HF_SD - psi_det_sorted_gen_order = psi_det_sorted_gen_HF_SD_order - endif -END_PROVIDER - - -BEGIN_PROVIDER [integer, degree_max_generators] - implicit none - BEGIN_DOC -! Max degree of excitation (respect to HF) of the generators - END_DOC - integer :: i,degree - degree_max_generators = 0 - do i = 1, N_det_generators - call get_excitation_degree(HF_bitmask,psi_det_generators(1,1,i),degree,N_int) - if(degree .gt. degree_max_generators)then - degree_max_generators = degree - endif - enddo -END_PROVIDER - -BEGIN_PROVIDER [ integer, size_select_max] - implicit none - BEGIN_DOC - ! Size of the select_max array - END_DOC - size_select_max = 10000 -END_PROVIDER - -BEGIN_PROVIDER [ double precision, select_max, (size_select_max) ] - implicit none - BEGIN_DOC - ! Memo to skip useless selectors - END_DOC - select_max = huge(1.d0) -END_PROVIDER - diff --git a/src/generators_fluid/generators_cas.irp.f b/src/generators_fluid/generators_cas.irp.f deleted file mode 100644 index b6d83e0a..00000000 --- a/src/generators_fluid/generators_cas.irp.f +++ /dev/null @@ -1,69 +0,0 @@ -use bitmasks - -BEGIN_PROVIDER [ integer, N_det_generators_CAS ] - implicit none - BEGIN_DOC - ! Number of generator detetrminants - END_DOC - integer :: i,k,l - logical :: good - integer, external :: number_of_holes,number_of_particles - call write_time(6) - N_det_generators_CAS = 0 - do i=1,N_det - good = ( number_of_holes(psi_det_sorted(1,1,i)) ==0).and.(number_of_particles(psi_det_sorted(1,1,i))==0 ) - if (good) then - N_det_generators_CAS += 1 - endif - enddo - N_det_generators_CAS = max(N_det_generators_CAS,1) - call write_int(6,N_det_generators_CAS,'Number of generators_CAS') -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators_CAS, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_generators_CAS, (psi_det_size,N_states) ] -&BEGIN_PROVIDER [ integer(bit_kind), psi_det_sorted_gen_CAS, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_sorted_gen_CAS, (psi_det_size,N_states) ] -&BEGIN_PROVIDER [ integer, psi_det_sorted_gen_CAS_order, (psi_det_size) ] - implicit none - BEGIN_DOC - ! For Single reference wave functions, the gen_CASerator is the - ! Hartree-Fock determinant - END_DOC - integer :: i, k, l, m - logical :: good - integer, external :: number_of_holes,number_of_particles - integer, allocatable :: nongen_CAS(:) - integer :: inongen_CAS - - allocate(nongen_CAS(N_det)) - - inongen_CAS = 0 - m=0 - do i=1,N_det - good = ( number_of_holes(psi_det_sorted(1,1,i)) ==0).and.(number_of_particles(psi_det_sorted(1,1,i))==0 ) - if (good) then - m = m+1 - psi_det_sorted_gen_CAS_order(i) = m - do k=1,N_int - psi_det_generators_CAS(k,1,m) = psi_det_sorted(k,1,i) - psi_det_generators_CAS(k,2,m) = psi_det_sorted(k,2,i) - enddo - psi_coef_generators_CAS(m,:) = psi_coef_sorted(i,:) - else - inongen_CAS += 1 - nongen_CAS(inongen_CAS) = i - endif - enddo - ASSERT (m == N_det_generators_CAS) - - psi_det_sorted_gen_CAS(:,:,:N_det_generators_CAS) = psi_det_generators_CAS(:,:,:N_det_generators_CAS) - psi_coef_sorted_gen_CAS(:N_det_generators_CAS, :) = psi_coef_generators_CAS(:N_det_generators_CAS, :) - do i=1,inongen_CAS - psi_det_sorted_gen_CAS_order(nongen_CAS(i)) = N_det_generators_CAS+i - psi_det_sorted_gen_CAS(:,:,N_det_generators_CAS+i) = psi_det_sorted(:,:,nongen_CAS(i)) - psi_coef_sorted_gen_CAS(N_det_generators_CAS+i, :) = psi_coef_sorted(nongen_CAS(i),:) - end do - -END_PROVIDER - diff --git a/src/generators_fluid/generators_hf.irp.f b/src/generators_fluid/generators_hf.irp.f deleted file mode 100644 index d4d2e728..00000000 --- a/src/generators_fluid/generators_hf.irp.f +++ /dev/null @@ -1,51 +0,0 @@ - -use bitmasks - -BEGIN_PROVIDER [ integer, N_det_generators_HF ] - implicit none - BEGIN_DOC - ! For Single reference wave functions, the number of generators is 1 : the - ! Hartree-Fock determinant - END_DOC - N_det_generators_HF = 1 -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators_HF, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_generators_HF, (psi_det_size,N_states) ] - implicit none - BEGIN_DOC - ! For Single reference wave functions, the generator is the - ! Hartree-Fock determinant - END_DOC - psi_det_generators_HF = 0_bit_kind - integer :: i,j - integer :: degree - - do i=1,N_int - psi_det_generators_HF(i,1,1) = HF_bitmask(i,1) - psi_det_generators_HF(i,2,1) = HF_bitmask(i,2) - enddo - - do j=1,N_det - call get_excitation_degree(HF_bitmask,psi_det(1,1,j),degree,N_int) - if (degree == 0) then - exit - endif - end do - - psi_det_generators_HF(:,:,1) = psi_det(:,:,j) - psi_coef_generators_HF(1,:) = 1.d0 - -END_PROVIDER - - BEGIN_PROVIDER [ integer , HF_index ] - implicit none - integer :: j,degree - do j=1,N_det - call get_excitation_degree(HF_bitmask,psi_det_sorted(1,1,j),degree,N_int) - if (degree == 0) then - HF_index = j - exit - endif - end do -END_PROVIDER diff --git a/src/generators_fluid/generators_hf_sd.irp.f b/src/generators_fluid/generators_hf_sd.irp.f deleted file mode 100644 index 9c13a5a0..00000000 --- a/src/generators_fluid/generators_hf_sd.irp.f +++ /dev/null @@ -1,80 +0,0 @@ - -use bitmasks - -BEGIN_PROVIDER [ integer, N_det_generators_HF_SD ] - implicit none - BEGIN_DOC - ! For Single reference wave functions, the number of generators is 1 : the - ! Hartree-Fock determinant - END_DOC - N_det_generators_HF_SD = 0 - integer :: i,degree - double precision :: thr - double precision :: accu - accu = 0.d0 - thr = threshold_generators - do i = 1, N_det - call get_excitation_degree(HF_bitmask,psi_det_sorted(1,1,i),degree,N_int) - if(degree.le.2.and. accu .le. thr )then - accu += psi_coef_sorted(i,1)**2 - N_det_generators_HF_SD += 1 - endif - enddo -!print*,'' -!print*,'N_det_generators_HF_SD = ',N_det_generators_HF_SD -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators_HF_SD, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_generators_HF_SD, (psi_det_size,N_states) ] -&BEGIN_PROVIDER [ integer(bit_kind), psi_det_sorted_gen_HF_SD, (N_int,2,psi_det_size) ] -&BEGIN_PROVIDER [ double precision, psi_coef_sorted_gen_HF_SD, (psi_det_size,N_states) ] -&BEGIN_PROVIDER [ integer, psi_det_sorted_gen_HF_SD_order, (psi_det_size) ] - implicit none - BEGIN_DOC - ! For Single reference wave functions, the generator is the - ! Hartree-Fock determinant - END_DOC - psi_det_generators_HF_SD = 0_bit_kind - integer :: i,j,k - integer :: degree - double precision :: thr - double precision :: accu - integer, allocatable :: nongen(:) - integer :: inongen - - allocate(nongen(N_det)) - - thr = threshold_generators - - accu = 0.d0 - k = 0 - inongen = 0 - do j=1,N_det - call get_excitation_degree(HF_bitmask,psi_det_sorted(1,1,j),degree,N_int) - if(degree.le.2.and. accu.le.thr )then - accu += psi_coef_sorted(j,1)**2 - k += 1 - psi_det_sorted_gen_HF_SD_order(j) = k - do i = 1, N_int - psi_det_generators_HF_SD(i,1,k) = psi_det_sorted(i,1,j) - psi_det_generators_HF_SD(i,2,k) = psi_det_sorted(i,2,j) - enddo - do i = 1, N_states - psi_coef_generators_HF_SD(k,i) = psi_coef_sorted(j,i) - enddo - else - inongen += 1 - nongen(inongen) = j - endif - end do - - psi_det_sorted_gen_HF_SD(:,:,:N_det_generators_HF_SD) = psi_det_generators_HF_SD(:,:,:N_det_generators_HF_SD) - psi_coef_sorted_gen_HF_SD(:N_det_generators_HF_SD, :) = psi_coef_generators_HF_SD(:N_det_generators_HF_SD, :) - do i=1,inongen - psi_det_sorted_gen_HF_SD_order(nongen(i)) = N_det_generators_HF_SD+i - psi_det_sorted_gen_HF_SD(:,:,N_det_generators_HF_SD+i) = psi_det_sorted(:,:,nongen(i)) - psi_coef_sorted_gen_HF_SD(N_det_generators_HF_SD+i, :) = psi_coef_sorted(nongen(i),:) - end do - -END_PROVIDER -