From 9d0e7c7034e0d0089fdd29ab68c61cb160cb733e Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Fri, 17 Dec 2021 18:15:47 +0100 Subject: [PATCH] moved a subroutine from determinant to bitmask --- src/bitmask/bitmasks_routines.irp.f | 15 ++++++++++++++ src/determinants/slater_rules.irp.f | 31 ++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/bitmask/bitmasks_routines.irp.f b/src/bitmask/bitmasks_routines.irp.f index c34d54dc..9c6f4f0c 100644 --- a/src/bitmask/bitmasks_routines.irp.f +++ b/src/bitmask/bitmasks_routines.irp.f @@ -268,6 +268,21 @@ subroutine print_spindet(string,Nint) end +subroutine print_det_one_dimension(string,Nint) + use bitmasks + implicit none + BEGIN_DOC + ! Subroutine to print the content of a determinant using the '+-' notation + END_DOC + integer, intent(in) :: Nint + integer(bit_kind), intent(in) :: string(Nint) + character*(2048) :: output(1) + + call bitstring_to_str( output(1), string, Nint ) + print *, trim(output(1)) + +end + logical function is_integer_in_string(bite,string,Nint) use bitmasks implicit none diff --git a/src/determinants/slater_rules.irp.f b/src/determinants/slater_rules.irp.f index 04cf861f..3a33a37d 100644 --- a/src/determinants/slater_rules.irp.f +++ b/src/determinants/slater_rules.irp.f @@ -438,7 +438,7 @@ subroutine bitstring_to_list_ab( string, list, n_elements, Nint) use bitmasks implicit none BEGIN_DOC - ! Gives the inidices(+1) of the bits set to 1 in the bit string + ! Gives the indices(+1) of the bits set to 1 in the bit string ! For alpha/beta determinants. END_DOC integer, intent(in) :: Nint @@ -472,6 +472,35 @@ subroutine bitstring_to_list_ab( string, list, n_elements, Nint) end +!subroutine bitstring_to_list( string, list, n_elements, Nint) +! use bitmasks +! implicit none +! BEGIN_DOC +! ! Gives the indices(+1) of the bits set to 1 in the bit string +! END_DOC +! integer, intent(in) :: Nint +! integer(bit_kind), intent(in) :: string(Nint) +! integer, intent(out) :: list(Nint*bit_kind_size) +! integer, intent(out) :: n_elements +! +! integer :: i, j, ishift +! integer(bit_kind) :: l +! +! n_elements = 0 +! ishift = 1 +! do i=1,Nint +! l = string(i) +! do while (l /= 0_bit_kind) +! j = trailz(l) +! n_elements = n_elements + 1 +! l = ibclr(l,j) +! list(n_elements) = ishift+j +! enddo +! ishift = ishift + bit_kind_size +! enddo +! +!end + subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) use bitmasks