diff --git a/ocaml/.gitignore b/ocaml/.gitignore index 50a9344d..fdb5adf4 100644 --- a/ocaml/.gitignore +++ b/ocaml/.gitignore @@ -21,6 +21,7 @@ Input_nuclei.ml Input_perturbation.ml Input_pseudo.ml Input_scf_utils.ml +Input_two_body_dm.ml qp_create_ezfio qp_create_ezfio.native qp_edit diff --git a/src/determinants/create_excitations.irp.f b/src/determinants/create_excitations.irp.f index 816006be..ddb9ae0f 100644 --- a/src/determinants/create_excitations.irp.f +++ b/src/determinants/create_excitations.irp.f @@ -19,12 +19,18 @@ subroutine do_single_excitation(key_in,i_hole,i_particle,ispin,i_ok) ! hole k = shiftr(i_hole-1,bit_kind_shift)+1 j = i_hole-shiftl(k-1,bit_kind_shift)-1 - key_in(k,ispin) = ibclr(key_in(k,ispin),j) +! check whether position j is occupied + if (ibits(key_in(k,ispin),j,1).eq.1) then + key_in(k,ispin) = ibclr(key_in(k,ispin),j) + else + i_ok= -1 + end if ! particle k = shiftr(i_particle-1,bit_kind_shift)+1 j = i_particle-shiftl(k-1,bit_kind_shift)-1 key_in(k,ispin) = ibset(key_in(k,ispin),j) + integer :: n_elec_tmp n_elec_tmp = 0 do i = 1, N_int