From 114d4a695c7d4811a3aadac596a904dc8b510051 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 3 Dec 2021 17:39:10 +0100 Subject: [PATCH] Fixed bug --- stable/champ/save_for_champ.irp.f | 2 +- stable/champ/write_champ_csf.irp.f | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/stable/champ/save_for_champ.irp.f b/stable/champ/save_for_champ.irp.f index 58a22ca..3268b4e 100644 --- a/stable/champ/save_for_champ.irp.f +++ b/stable/champ/save_for_champ.irp.f @@ -1,4 +1,4 @@ -program qmcpack +program save_for_camp implicit none BEGIN_DOC ! Generates a file for CHAMP diff --git a/stable/champ/write_champ_csf.irp.f b/stable/champ/write_champ_csf.irp.f index 166e765..eddd20a 100644 --- a/stable/champ/write_champ_csf.irp.f +++ b/stable/champ/write_champ_csf.irp.f @@ -48,8 +48,13 @@ subroutine write_champ_csf do i=1,N_configuration startdet = psi_configuration_to_psi_det(1,i) enddet = psi_configuration_to_psi_det(2,i) + s = 0 + do k=1,N_int + if (psi_configuration(k,1,i) == 0_bit_kind) cycle + s = s + popcnt(psi_configuration(k,1,i)) + enddo + bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1)))) do k=1,bfIcfg - write(iunit, '(I4)') ndetI do j = startdet, enddet if (DetToCSFTransformationMatrix(s,k,j-startdet+1) == 0.d0) cycle ndetI += 1 @@ -63,7 +68,6 @@ subroutine write_champ_csf do i=1,N_configuration startdet = psi_configuration_to_psi_det(1,i) enddet = psi_configuration_to_psi_det(2,i) - ndetI = enddet-startdet+1 s = 0 do k=1,N_int @@ -73,6 +77,12 @@ subroutine write_champ_csf bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1)))) do k=1,bfIcfg + ndetI = 0 + do j = startdet, enddet + if (DetToCSFTransformationMatrix(s,k,j-startdet+1) == 0.d0) cycle + ndetI += 1 + end do + write(iunit, '(I4)') ndetI do j = startdet, enddet if (DetToCSFTransformationMatrix(s,k,j-startdet+1) == 0.d0) cycle