1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-12-23 04:43:38 +01:00
qp_plugins_scemama/devel/qmcchem/qmc_e_curve2.irp.f

76 lines
2.1 KiB
FortranFixed
Raw Normal View History

2021-06-25 00:03:06 +02:00
program e_curve
use bitmasks
implicit none
integer :: i,j,k, kk, nab, m, l
double precision :: norm, E, hij, num, ci, cj
double precision :: e_0(N_states)
2021-06-27 15:22:17 +02:00
double precision, allocatable :: psi_save(:)
2021-06-25 00:03:06 +02:00
PROVIDE mo_two_e_integrals_in_map mo_one_e_integrals
if (.not.read_wf) then
stop 'Please set read_wf to true'
endif
PROVIDE psi_bilinear_matrix nuclear_repulsion
PROVIDE psi_coef_sorted psi_det psi_coef
print *, ''
print *, '=============================='
print *, 'Energies at different cut-offs'
print *, '=============================='
print *, ''
print *, '=========================================================='
print '(A8,2X,A8,2X,A12,2X,A10,2X,A12)', 'Thresh.', 'Ndet', 'Cost', 'Norm', 'E'
print *, '=========================================================='
double precision :: thresh
integer(bit_kind), allocatable :: det_i(:,:), det_j(:,:)
thresh = 1.d-10
2021-06-27 15:22:17 +02:00
integer :: n_det_prime
2021-06-25 00:03:06 +02:00
nab = n_det_alpha_unique+n_det_beta_unique
2021-06-27 15:22:17 +02:00
allocate(psi_save(1:N_det))
psi_save(1:N_det) = psi_coef(1:N_det,1)
2021-06-25 00:03:06 +02:00
do while (thresh < 1.d0)
norm = 0.d0
2021-06-27 15:22:17 +02:00
n_det_prime = n_det
2021-06-25 00:03:06 +02:00
do k=1,n_det
2021-06-27 15:22:17 +02:00
psi_coef(k,1) = psi_save(k)
2021-06-25 00:03:06 +02:00
if (dabs(psi_coef(k,1)) < thresh) then
psi_coef(k,1) = 0.d0
2021-06-27 15:22:17 +02:00
n_det_prime -= 1
2021-06-25 00:03:06 +02:00
endif
norm = norm + psi_coef(k,1)**2
enddo
2021-06-27 15:22:17 +02:00
TOUCH psi_coef psi_det
2021-06-25 00:03:06 +02:00
norm = norm/dsqrt(norm)
2021-06-27 15:22:17 +02:00
psi_coef(:,1) = psi_coef(:,1)/norm
2021-06-25 00:03:06 +02:00
2021-06-27 23:45:30 +02:00
integer :: na, nb
na = 0
do k=1,n_det_alpha_unique
if (det_alpha_norm(k) > 0.d0) then
na += 1
endif
enddo
nb = 0
do k=1,n_det_beta_unique
if (det_beta_norm(k) > 0.d0) then
nb += 1
endif
enddo
2021-06-27 15:22:17 +02:00
E = psi_energy(1)
2021-06-27 23:45:30 +02:00
double precision :: cost0, cost
cost0 = elec_alpha_num**3 + elec_beta_num**3
cost = (na-1) * elec_alpha_num**2 + &
(nb-1) * elec_beta_num**2 + &
elec_alpha_num**3 + elec_beta_num**3
cost = cost/cost0
print '(E9.1,2X,I8,2X,F10.2,2X,F10.8,2X,F15.10)', thresh, n_det_prime, &
cost, norm, E
2021-06-25 00:03:06 +02:00
thresh = thresh * dsqrt(10.d0)
enddo
print *, '=========================================================='
end