From ec874e261521155241698fd1f8776040b1670e02 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 10 Dec 2020 10:43:13 +0100 Subject: [PATCH 1/4] Added seniority keyword in cipsi --- src/cipsi/selection.irp.f | 14 ++++++++++++++ src/fci/EZFIO.cfg | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/cipsi/selection.irp.f b/src/cipsi/selection.irp.f index fd434c1e..2c35a98f 100644 --- a/src/cipsi/selection.irp.f +++ b/src/cipsi/selection.irp.f @@ -821,6 +821,19 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d enddo endif + if (seniority >= 0) then + !TODO : Check if 1st determinant should be used for all states + integer :: s + s = 0 + do k=1,N_int + s = s + popcnt(ieor(det(k,1),det(k,2))) + enddo + + if (s > seniority) then + e_pert(:) = 0.d0 + endif + endif + ! ! Gram-Schmidt using input overlap matrix ! do istate=1,N_states @@ -900,6 +913,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d ! w = dble(n) * w + if(w <= buf%mini) then call add_to_selection_buffer(buf, det, w) end if diff --git a/src/fci/EZFIO.cfg b/src/fci/EZFIO.cfg index d5526673..69b6c502 100644 --- a/src/fci/EZFIO.cfg +++ b/src/fci/EZFIO.cfg @@ -10,4 +10,8 @@ doc: Calculated |FCI| energy + |PT2| interface: ezfio size: (determinants.n_states) - +[seniority] +type: integer +doc: Using -1 selects all determinants +interface: ezfio,ocaml,provider +default: -1 From a854d5a4c57d8b4eb3d7269564fb9ae3444ff489 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 10 Dec 2020 17:54:50 +0100 Subject: [PATCH 2/4] Moved seniority in CIPSI --- src/cipsi/EZFIO.cfg | 6 ++++++ src/fci/EZFIO.cfg | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cipsi/EZFIO.cfg b/src/cipsi/EZFIO.cfg index 5110b776..64918756 100644 --- a/src/cipsi/EZFIO.cfg +++ b/src/cipsi/EZFIO.cfg @@ -3,3 +3,9 @@ type: logical doc: If true, computes the one- and two-body rdms with perturbation theory interface: ezfio,provider,ocaml default: False + +[seniority] +type: integer +doc: Using -1 selects all determinants +interface: ezfio,ocaml,provider +default: -1 diff --git a/src/fci/EZFIO.cfg b/src/fci/EZFIO.cfg index 69b6c502..d897428a 100644 --- a/src/fci/EZFIO.cfg +++ b/src/fci/EZFIO.cfg @@ -10,8 +10,3 @@ doc: Calculated |FCI| energy + |PT2| interface: ezfio size: (determinants.n_states) -[seniority] -type: integer -doc: Using -1 selects all determinants -interface: ezfio,ocaml,provider -default: -1 From 936c3cdf2233fed61b6edb3f4d337e4ca71f8ae7 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 10 Dec 2020 18:22:16 +0100 Subject: [PATCH 3/4] Added excitation_max --- src/cipsi/EZFIO.cfg | 23 +++++++++++++++++-- src/cipsi/selection.irp.f | 47 +++++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/cipsi/EZFIO.cfg b/src/cipsi/EZFIO.cfg index 64918756..7d3a5fde 100644 --- a/src/cipsi/EZFIO.cfg +++ b/src/cipsi/EZFIO.cfg @@ -4,8 +4,27 @@ doc: If true, computes the one- and two-body rdms with perturbation theory interface: ezfio,provider,ocaml default: False -[seniority] +[seniority_max] type: integer -doc: Using -1 selects all determinants +doc: Maximum number of allowed open shells. Using -1 selects all determinants interface: ezfio,ocaml,provider default: -1 + +[excitation_max] +type: integer +doc: Maximum number of excitation with respect to the Hartree-Fock determinant. Using -1 selects all determinants +interface: ezfio,ocaml,provider +default: -1 + +[excitation_alpha_max] +type: integer +doc: Maximum number of excitation for alpha determinants with respect to the Hartree-Fock determinant. Using -1 selects all determinants +interface: ezfio,ocaml,provider +default: -1 + +[excitation_beta_max] +type: integer +doc: Maximum number of excitation for beta determinants with respect to the Hartree-Fock determinant. Using -1 selects all determinants +interface: ezfio,ocaml,provider +default: -1 + diff --git a/src/cipsi/selection.irp.f b/src/cipsi/selection.irp.f index 2c35a98f..b8cba9a5 100644 --- a/src/cipsi/selection.irp.f +++ b/src/cipsi/selection.irp.f @@ -678,11 +678,6 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d double precision :: delta_E, val, Hii, w, tmp, alpha_h_psi double precision, external :: diag_H_mat_elem_fock double precision :: E_shift - - logical, external :: detEq - double precision, allocatable :: values(:) - integer, allocatable :: keys(:,:) - integer :: nkeys double precision :: s_weight(N_states,N_states) do jstate=1,N_states do istate=1,N_states @@ -761,6 +756,36 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d if (.not.is_a_1h1p(det)) cycle endif + if (seniority_max >= 0) then + integer :: s + s = 0 + do k=1,N_int + s = s + popcnt(ieor(det(k,1),det(k,2))) + enddo + + if (s > seniority_max) cycle + endif + + + if (excitation_max >= 0) then + integer :: degree + call get_excitation_degree(ref_bitmask(1,1),det(1,1),degree,N_int) + if (degree > excitation_max) cycle + endif + + + if (excitation_alpha_max >= 0) then + call get_excitation_degree_spin(ref_bitmask(1,1),det(1,1),degree,N_int) + if (degree > excitation_alpha_max) cycle + endif + + + if (excitation_beta_max >= 0) then + call get_excitation_degree_spin(ref_bitmask(1,2),det(1,2),degree,N_int) + if (degree > excitation_beta_max) cycle + endif + + Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) w = 0d0 @@ -821,18 +846,6 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d enddo endif - if (seniority >= 0) then - !TODO : Check if 1st determinant should be used for all states - integer :: s - s = 0 - do k=1,N_int - s = s + popcnt(ieor(det(k,1),det(k,2))) - enddo - - if (s > seniority) then - e_pert(:) = 0.d0 - endif - endif ! ! Gram-Schmidt using input overlap matrix From b09586d261bf4eb22fc462a20a762ac1425ae551 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 11 Dec 2020 00:13:28 +0100 Subject: [PATCH 4/4] Updated submodules --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 8e852dd0..73299cba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "external/ezfio"] path = external/ezfio - url = https://gitlab.com/scemama/ezfio + url = https://gitlab.com/scemama/ezfio.git [submodule "external/irpf90"] path = external/irpf90 - url = https://gitlab.com/scemama/irpf90 + url = https://gitlab.com/scemama/irpf90.git