From 09b43e57e0d1066a4e1e5c5ebaef2c80f9f0dad1 Mon Sep 17 00:00:00 2001 From: Manu Date: Wed, 11 Jun 2014 00:44:07 +0200 Subject: [PATCH] add CID, CID_selected, CID_SC2_selected, just for fun ... --- src/CID/ASSUMPTIONS.rst | 0 src/CID/H_apply.irp.f | 9 +++ src/CID/Makefile | 8 +++ src/CID/NEEDED_MODULES | 2 + src/CID/README.rst | 43 ++++++++++++ src/CID/cid.irp.f | 20 ++++++ src/CID/cid_lapack.irp.f | 16 +++++ src/CID/do_mono_double.irp.f | 19 +++++ src/CID_SC2_selected/ASSUMPTIONS.rst | 0 src/CID_SC2_selected/H_apply.irp.f | 10 +++ src/CID_SC2_selected/Makefile | 8 +++ src/CID_SC2_selected/NEEDED_MODULES | 1 + src/CID_SC2_selected/README.rst | 40 +++++++++++ src/CID_SC2_selected/cid_sc2_selection.irp.f | 73 ++++++++++++++++++++ src/CID_SC2_selected/do_mono_double.irp.f | 19 +++++ src/CID_selected/ASSUMPTIONS.rst | 0 src/CID_selected/H_apply.irp.f | 31 +++++++++ src/CID_selected/Makefile | 8 +++ src/CID_selected/NEEDED_MODULES | 1 + src/CID_selected/README.rst | 41 +++++++++++ src/CID_selected/cid_selection.irp.f | 34 +++++++++ src/CID_selected/do_mono_double.irp.f | 19 +++++ src/CISD/do_mono_double.irp.f | 19 +++++ src/CISD_SC2_selected/do_mono_double.irp.f | 19 +++++ src/CISD_selected/do_mono_double.irp.f | 19 +++++ src/Dets/H_apply_template.f | 22 ++++-- src/Dets/filter_connected.irp.f | 8 +-- 27 files changed, 478 insertions(+), 11 deletions(-) create mode 100644 src/CID/ASSUMPTIONS.rst create mode 100644 src/CID/H_apply.irp.f create mode 100644 src/CID/Makefile create mode 100644 src/CID/NEEDED_MODULES create mode 100644 src/CID/README.rst create mode 100644 src/CID/cid.irp.f create mode 100644 src/CID/cid_lapack.irp.f create mode 100644 src/CID/do_mono_double.irp.f create mode 100644 src/CID_SC2_selected/ASSUMPTIONS.rst create mode 100644 src/CID_SC2_selected/H_apply.irp.f create mode 100644 src/CID_SC2_selected/Makefile create mode 100644 src/CID_SC2_selected/NEEDED_MODULES create mode 100644 src/CID_SC2_selected/README.rst create mode 100644 src/CID_SC2_selected/cid_sc2_selection.irp.f create mode 100644 src/CID_SC2_selected/do_mono_double.irp.f create mode 100644 src/CID_selected/ASSUMPTIONS.rst create mode 100644 src/CID_selected/H_apply.irp.f create mode 100644 src/CID_selected/Makefile create mode 100644 src/CID_selected/NEEDED_MODULES create mode 100644 src/CID_selected/README.rst create mode 100644 src/CID_selected/cid_selection.irp.f create mode 100644 src/CID_selected/do_mono_double.irp.f create mode 100644 src/CISD/do_mono_double.irp.f create mode 100644 src/CISD_SC2_selected/do_mono_double.irp.f create mode 100644 src/CISD_selected/do_mono_double.irp.f diff --git a/src/CID/ASSUMPTIONS.rst b/src/CID/ASSUMPTIONS.rst new file mode 100644 index 00000000..e69de29b diff --git a/src/CID/H_apply.irp.f b/src/CID/H_apply.irp.f new file mode 100644 index 00000000..0df1da38 --- /dev/null +++ b/src/CID/H_apply.irp.f @@ -0,0 +1,9 @@ +! Generates subroutine H_apply_cisd +! ---------------------------------- + +BEGIN_SHELL [ /usr/bin/env python ] +from generate_h_apply import H_apply +H = H_apply("cisd") +print H +END_SHELL + diff --git a/src/CID/Makefile b/src/CID/Makefile new file mode 100644 index 00000000..b2ea1de1 --- /dev/null +++ b/src/CID/Makefile @@ -0,0 +1,8 @@ +default: all + +# Define here all new external source files and objects.Don't forget to prefix the +# object files with IRPF90_temp/ +SRC= +OBJ= + +include $(QPACKAGE_ROOT)/src/Makefile.common diff --git a/src/CID/NEEDED_MODULES b/src/CID/NEEDED_MODULES new file mode 100644 index 00000000..4b91f009 --- /dev/null +++ b/src/CID/NEEDED_MODULES @@ -0,0 +1,2 @@ +AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MonoInts MOs Nuclei Output SingleRefMethod Utils Selectors_full + diff --git a/src/CID/README.rst b/src/CID/README.rst new file mode 100644 index 00000000..003b51fa --- /dev/null +++ b/src/CID/README.rst @@ -0,0 +1,43 @@ +CISD +==== + +This is a test directory which builds a CISD by setting the follwoing rules: + +* The only generator determinant is the Hartee-Fock (single-reference method) +* All generated determinants are included in the wave function (no perturbative + selection) + +These rules are set in the ``H_apply.irp.f`` file. + +Needed Modules +============== + +.. Do not edit this section. It was auto-generated from the +.. NEEDED_MODULES file. + +* `AOs `_ +* `BiInts `_ +* `Bitmask `_ +* `Dets `_ +* `Electrons `_ +* `Ezfio_files `_ +* `Hartree_Fock `_ +* `MonoInts `_ +* `MOs `_ +* `Nuclei `_ +* `Output `_ +* `SingleRefMethod `_ +* `Utils `_ +* `Selectors_full `_ + +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. NEEDED_MODULES file. + +`cisd `_ + Undocumented + + + diff --git a/src/CID/cid.irp.f b/src/CID/cid.irp.f new file mode 100644 index 00000000..0b6bc9fd --- /dev/null +++ b/src/CID/cid.irp.f @@ -0,0 +1,20 @@ +program cisd + implicit none + integer :: i + + print *, 'HF = ', HF_energy + print *, 'N_states = ', N_states + N_det = 1 + touch psi_det psi_coef N_det + call H_apply_cisd + print *, 'N_det = ', N_det + do i = 1,N_states + print *, 'energy = ',CI_energy(i) + print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy + enddo + +! call CISD_SC2(psi_det,psi_coef,eigvalues,size(psi_coef,1),N_det,N_states,N_int) +! do i = 1, N_states +! print*,'eigvalues(i) = ',eigvalues(i) +! enddo +end diff --git a/src/CID/cid_lapack.irp.f b/src/CID/cid_lapack.irp.f new file mode 100644 index 00000000..374dc9c2 --- /dev/null +++ b/src/CID/cid_lapack.irp.f @@ -0,0 +1,16 @@ +program cisd + implicit none + integer :: i + + diag_algorithm = "Lapack" + touch diag_algorithm + print *, 'HF = ', HF_energy + print *, 'N_states = ', N_states + call H_apply_cisd + print *, 'N_det = ', N_det + do i = 1,N_states + print *, 'energy = ',CI_energy(i) + print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy + enddo + +end diff --git a/src/CID/do_mono_double.irp.f b/src/CID/do_mono_double.irp.f new file mode 100644 index 00000000..f211879e --- /dev/null +++ b/src/CID/do_mono_double.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [logical, do_double_excitations] + implicit none + BEGIN_DOC + ! if True then the double excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_double_excitations = .True. + +END_PROVIDER + +BEGIN_PROVIDER [logical, do_mono_excitations] + implicit none + BEGIN_DOC + ! if True then the mono excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_mono_excitations = .False. + +END_PROVIDER diff --git a/src/CID_SC2_selected/ASSUMPTIONS.rst b/src/CID_SC2_selected/ASSUMPTIONS.rst new file mode 100644 index 00000000..e69de29b diff --git a/src/CID_SC2_selected/H_apply.irp.f b/src/CID_SC2_selected/H_apply.irp.f new file mode 100644 index 00000000..79668af7 --- /dev/null +++ b/src/CID_SC2_selected/H_apply.irp.f @@ -0,0 +1,10 @@ +use bitmasks +BEGIN_SHELL [ /usr/bin/env python ] +from generate_h_apply import * +from perturbation import perturbations + +s = H_apply("PT2",SingleRef=True) +s.set_perturbation("epstein_nesbet_sc2_projected") +print s +END_SHELL + diff --git a/src/CID_SC2_selected/Makefile b/src/CID_SC2_selected/Makefile new file mode 100644 index 00000000..b2ea1de1 --- /dev/null +++ b/src/CID_SC2_selected/Makefile @@ -0,0 +1,8 @@ +default: all + +# Define here all new external source files and objects.Don't forget to prefix the +# object files with IRPF90_temp/ +SRC= +OBJ= + +include $(QPACKAGE_ROOT)/src/Makefile.common diff --git a/src/CID_SC2_selected/NEEDED_MODULES b/src/CID_SC2_selected/NEEDED_MODULES new file mode 100644 index 00000000..bb98e702 --- /dev/null +++ b/src/CID_SC2_selected/NEEDED_MODULES @@ -0,0 +1 @@ +AOs BiInts Bitmask CISD SC2 CISD_selected Dets Electrons Ezfio_files Hartree_Fock MonoInts MOs Nuclei Output Perturbation Selectors_full SingleRefMethod Utils diff --git a/src/CID_SC2_selected/README.rst b/src/CID_SC2_selected/README.rst new file mode 100644 index 00000000..b6206850 --- /dev/null +++ b/src/CID_SC2_selected/README.rst @@ -0,0 +1,40 @@ +======================== +CISD_SC2_selected Module +======================== + +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. NEEDED_MODULES file. + +`cisd_sc2_selected `_ + Undocumented + + + +Needed Modules +============== + +.. Do not edit this section. It was auto-generated from the +.. NEEDED_MODULES file. + +* `AOs `_ +* `BiInts `_ +* `Bitmask `_ +* `CISD `_ +* `SC2 `_ +* `CISD_selected `_ +* `Dets `_ +* `Electrons `_ +* `Ezfio_files `_ +* `Hartree_Fock `_ +* `MonoInts `_ +* `MOs `_ +* `Nuclei `_ +* `Output `_ +* `Perturbation `_ +* `Selectors_full `_ +* `SingleRefMethod `_ +* `Utils `_ + diff --git a/src/CID_SC2_selected/cid_sc2_selection.irp.f b/src/CID_SC2_selected/cid_sc2_selection.irp.f new file mode 100644 index 00000000..3610a0fe --- /dev/null +++ b/src/CID_SC2_selected/cid_sc2_selection.irp.f @@ -0,0 +1,73 @@ +program cisd_sc2_selected + implicit none + integer :: i,k + use bitmasks + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:),E_old(:) + integer :: N_st, iter,degree + character*(64) :: perturbation + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st),E_old(N_st)) + + pt2 = 1.d0 + perturbation = "epstein_nesbet_sc2_projected" + E_old(1) = HF_energy + davidson_threshold = 1.d-6 + + do while (maxval(abs(pt2(1:N_st))) > 1.d-4) + print*,'----' + print*,'' + call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st) +! soft_touch det_connections + call diagonalize_CI_SC2 + print *, 'N_det = ', N_det + do i = 1, N_st + print*,'state ',i + print *, 'PT2(SC2) = ', pt2(i) + print *, 'E(SC2) = ', CI_SC2_energy(i) + print *, 'E_before(SC2)+PT2(SC2) = ', (E_old(i)+pt2(i)) + if(i==1)then + print *, 'E(SC2)+PT2(projctd)SC2 = ', (E_old(i)+H_pert_diag(i)) + endif + E_old(i) = CI_SC2_energy(i) + enddo +! print *, 'E corr = ', (E_old(1)) - HF_energy + if (abort_all) then + exit + endif + enddo + pt2 = 0.d0 + call H_apply_PT2(pt2, norm_pert, H_pert_diag, N_st) + davidson_threshold = 1.d-10 + touch davidson_threshold davidson_criterion + do i = 1, N_st + max = 0.d0 + + print*,'' + print*,'-------------' + print*,'for state ',i + print*,'' + do k = 1, N_det + if(dabs(psi_coef(k,i)).gt.max)then + max = dabs(psi_coef(k,i)) + imax = k + endif + enddo + double precision :: max + integer :: imax + print *, 'PT2(SC2) = ', pt2(i) + print *, 'E(SC2) = ', CI_SC2_energy(i) + print *, 'E_before(SC2)+PT2(SC2) = ', (CI_SC2_energy(i)+pt2(i)) + if(i==1)then + print *, 'E(SC2)+PT2(projctd)SC2 = ', (CI_SC2_energy(i)+H_pert_diag(i)) + endif + + print*,'greater coeficient of the state : ',dabs(psi_coef(imax,i)) + call get_excitation_degree(ref_bitmask,psi_det(1,1,imax),degree,N_int) + print*,'degree of excitation of such determinant : ',degree + + enddo + print*,'coucou' + deallocate(pt2,norm_pert,H_pert_diag) +end diff --git a/src/CID_SC2_selected/do_mono_double.irp.f b/src/CID_SC2_selected/do_mono_double.irp.f new file mode 100644 index 00000000..f211879e --- /dev/null +++ b/src/CID_SC2_selected/do_mono_double.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [logical, do_double_excitations] + implicit none + BEGIN_DOC + ! if True then the double excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_double_excitations = .True. + +END_PROVIDER + +BEGIN_PROVIDER [logical, do_mono_excitations] + implicit none + BEGIN_DOC + ! if True then the mono excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_mono_excitations = .False. + +END_PROVIDER diff --git a/src/CID_selected/ASSUMPTIONS.rst b/src/CID_selected/ASSUMPTIONS.rst new file mode 100644 index 00000000..e69de29b diff --git a/src/CID_selected/H_apply.irp.f b/src/CID_selected/H_apply.irp.f new file mode 100644 index 00000000..91dfb9fc --- /dev/null +++ b/src/CID_selected/H_apply.irp.f @@ -0,0 +1,31 @@ +use bitmasks +BEGIN_SHELL [ /usr/bin/env python ] +from generate_h_apply import * +from perturbation import perturbations + +for perturbation in perturbations: + s = H_apply("cisd_selection_"+perturbation) + s.set_selection_pt2(perturbation) + print s +END_SHELL + + +subroutine H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st) + implicit none + character*(64), intent(in) :: perturbation + integer, intent(in) :: N_st + double precision, intent(inout):: pt2(N_st), norm_pert(N_st), H_pert_diag(N_st) + +BEGIN_SHELL [ /usr/bin/env python ] +from perturbation import perturbations + +for perturbation in perturbations: + print """ + if (perturbation == '%s') then + call H_apply_cisd_selection_%s(pt2, norm_pert, H_pert_diag, N_st) + endif + """%(perturbation,perturbation) +END_SHELL + + +end diff --git a/src/CID_selected/Makefile b/src/CID_selected/Makefile new file mode 100644 index 00000000..b2ea1de1 --- /dev/null +++ b/src/CID_selected/Makefile @@ -0,0 +1,8 @@ +default: all + +# Define here all new external source files and objects.Don't forget to prefix the +# object files with IRPF90_temp/ +SRC= +OBJ= + +include $(QPACKAGE_ROOT)/src/Makefile.common diff --git a/src/CID_selected/NEEDED_MODULES b/src/CID_selected/NEEDED_MODULES new file mode 100644 index 00000000..ac42ef59 --- /dev/null +++ b/src/CID_selected/NEEDED_MODULES @@ -0,0 +1 @@ +AOs BiInts Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MonoInts MOs Nuclei Output Perturbation SingleRefMethod Utils Selectors_full diff --git a/src/CID_selected/README.rst b/src/CID_selected/README.rst new file mode 100644 index 00000000..4fed26e5 --- /dev/null +++ b/src/CID_selected/README.rst @@ -0,0 +1,41 @@ +==================== +CISD_selected Module +==================== + +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. NEEDED_MODULES file. + +`h_apply_cisd_selection `_ + Undocumented + +`cisd `_ + Undocumented + + + +Needed Modules +============== + +.. Do not edit this section. It was auto-generated from the +.. NEEDED_MODULES file. + +* `AOs `_ +* `BiInts `_ +* `Bitmask `_ +* `CISD `_ +* `Dets `_ +* `Electrons `_ +* `Ezfio_files `_ +* `Hartree_Fock `_ +* `MonoInts `_ +* `MOs `_ +* `Nuclei `_ +* `Output `_ +* `Perturbation `_ +* `SingleRefMethod `_ +* `Utils `_ +* `Selectors_full `_ + diff --git a/src/CID_selected/cid_selection.irp.f b/src/CID_selected/cid_selection.irp.f new file mode 100644 index 00000000..f63a2d84 --- /dev/null +++ b/src/CID_selected/cid_selection.irp.f @@ -0,0 +1,34 @@ +program cisd + implicit none + integer :: i,k + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:),E_old(:) + integer :: N_st, iter + character*(64) :: perturbation + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st),E_old(N_st)) + + pt2 = 1.d0 + perturbation = "epstein_nesbet" + E_old(1) = HF_energy + do while (maxval(abs(pt2(1:N_st))) > 1.d-6) + print*,'----' + print*,'' + call H_apply_cisd_selection(perturbation,pt2, norm_pert, H_pert_diag, N_st) + call diagonalize_CI + print*,'N_det = ',N_det + do i = 1, N_st + print*,'state ',i + print *, 'PT2 = ', pt2(i) + print *, 'E = ', CI_energy(i) + print *, 'E_before +PT2 = ', (E_old(i)+pt2(i)) +! print *, 'E+PT2_new= ', (E_old(1)+1.d0*pt2(1)+H_pert_diag(1))/(1.d0 +norm_pert(1)) + enddo + E_old = CI_energy + if (abort_all) then + exit + endif + enddo + deallocate(pt2,norm_pert,H_pert_diag) +end diff --git a/src/CID_selected/do_mono_double.irp.f b/src/CID_selected/do_mono_double.irp.f new file mode 100644 index 00000000..f211879e --- /dev/null +++ b/src/CID_selected/do_mono_double.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [logical, do_double_excitations] + implicit none + BEGIN_DOC + ! if True then the double excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_double_excitations = .True. + +END_PROVIDER + +BEGIN_PROVIDER [logical, do_mono_excitations] + implicit none + BEGIN_DOC + ! if True then the mono excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_mono_excitations = .False. + +END_PROVIDER diff --git a/src/CISD/do_mono_double.irp.f b/src/CISD/do_mono_double.irp.f new file mode 100644 index 00000000..8a07c292 --- /dev/null +++ b/src/CISD/do_mono_double.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [logical, do_double_excitations] + implicit none + BEGIN_DOC + ! if True then the double excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_double_excitations = .True. + +END_PROVIDER + +BEGIN_PROVIDER [logical, do_mono_excitations] + implicit none + BEGIN_DOC + ! if True then the mono excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_mono_excitations = .True. + +END_PROVIDER diff --git a/src/CISD_SC2_selected/do_mono_double.irp.f b/src/CISD_SC2_selected/do_mono_double.irp.f new file mode 100644 index 00000000..8a07c292 --- /dev/null +++ b/src/CISD_SC2_selected/do_mono_double.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [logical, do_double_excitations] + implicit none + BEGIN_DOC + ! if True then the double excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_double_excitations = .True. + +END_PROVIDER + +BEGIN_PROVIDER [logical, do_mono_excitations] + implicit none + BEGIN_DOC + ! if True then the mono excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_mono_excitations = .True. + +END_PROVIDER diff --git a/src/CISD_selected/do_mono_double.irp.f b/src/CISD_selected/do_mono_double.irp.f new file mode 100644 index 00000000..8a07c292 --- /dev/null +++ b/src/CISD_selected/do_mono_double.irp.f @@ -0,0 +1,19 @@ +BEGIN_PROVIDER [logical, do_double_excitations] + implicit none + BEGIN_DOC + ! if True then the double excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_double_excitations = .True. + +END_PROVIDER + +BEGIN_PROVIDER [logical, do_mono_excitations] + implicit none + BEGIN_DOC + ! if True then the mono excitations are performed in the calculation + ! always true in the CISD + END_DOC + do_mono_excitations = .True. + +END_PROVIDER diff --git a/src/Dets/H_apply_template.f b/src/Dets/H_apply_template.f index 58dccb87..773fbd92 100644 --- a/src/Dets/H_apply_template.f +++ b/src/Dets/H_apply_template.f @@ -420,13 +420,17 @@ subroutine $subroutine($params_main) enddo enddo + if(do_double_excitations)then call $subroutine_diexc(psi_generators(1,1,i_generator), & mask(1,1,d_hole1), mask(1,1,d_part1), & mask(1,1,d_hole2), mask(1,1,d_part2), & i_generator $params_post) + endif + if(do_mono_excitations)then call $subroutine_monoexc(psi_generators(1,1,i_generator), & mask(1,1,s_hole ), mask(1,1,s_part ), & i_generator $params_post) + endif !$ call omp_set_lock(lck) call wall_time(wall_2) $printout_always @@ -471,13 +475,17 @@ subroutine $subroutine($params_main) not(psi_generators(k,ispin,i_generator)) ) enddo enddo - call $subroutine_diexc(psi_generators(1,1,i_generator), & - mask(1,1,d_hole1), mask(1,1,d_part1), & - mask(1,1,d_hole2), mask(1,1,d_part2), & - i_generator $params_post) - call $subroutine_monoexc(psi_generators(1,1,i_generator), & - mask(1,1,s_hole ), mask(1,1,s_part ), & - i_generator $params_post) + if(do_double_excitations)then + call $subroutine_diexc(psi_generators(1,1,i_generator), & + mask(1,1,d_hole1), mask(1,1,d_part1), & + mask(1,1,d_hole2), mask(1,1,d_part2), & + i_generator $params_post) + endif + if(do_mono_excitations)then + call $subroutine_monoexc(psi_generators(1,1,i_generator), & + mask(1,1,s_hole ), mask(1,1,s_part ), & + i_generator $params_post) + endif call wall_time(wall_2) $printout_always if (wall_2 - wall_0 > 2.d0) then diff --git a/src/Dets/filter_connected.irp.f b/src/Dets/filter_connected.irp.f index 19a1c050..e3436457 100644 --- a/src/Dets/filter_connected.irp.f +++ b/src/Dets/filter_connected.irp.f @@ -415,14 +415,14 @@ subroutine filter_connected_i_H_psi0_SC2(key1,key2,Nint,sze,idx,idx_repeat) popcnt(xor( key1(2,2,i), key2(2,2))) + & popcnt(xor( key1(3,1,i), key2(3,1))) + & popcnt(xor( key1(3,2,i), key2(3,2))) - if (degree_x2 < 5) then + if(degree_x2>6)then + idx_repeat(l_repeat) = i + l_repeat = l_repeat + 1 + else if (degree_x2 < 5) then if(degree_x2 .ne. 0)then idx(l) = i l = l+1 endif - elseif(degree_x2>6)then - idx_repeat(l_repeat) = i - l_repeat = l_repeat + 1 endif enddo