2016-07-16 16:09:50 +02:00
|
|
|
program s2_eig_restart
|
|
|
|
implicit none
|
|
|
|
read_wf = .True.
|
2017-04-20 08:36:11 +02:00
|
|
|
call routine_2
|
2016-07-16 16:09:50 +02:00
|
|
|
end
|
2017-04-20 08:36:11 +02:00
|
|
|
|
|
|
|
subroutine routine_2
|
|
|
|
implicit none
|
|
|
|
integer :: i,j,k,l
|
|
|
|
use bitmasks
|
|
|
|
integer :: n_det_restart,degree
|
|
|
|
integer(bit_kind),allocatable :: psi_det_tmp(:,:,:)
|
|
|
|
double precision ,allocatable :: psi_coef_tmp(:,:),accu(:)
|
|
|
|
integer, allocatable :: index_restart(:)
|
|
|
|
allocate(index_restart(N_det))
|
|
|
|
print*, 'How many Slater determinants would ou like ?'
|
|
|
|
read(5,*)N_det_restart
|
|
|
|
do i = 1, N_det_restart
|
|
|
|
index_restart(i) = i
|
|
|
|
enddo
|
|
|
|
allocate (psi_det_tmp(N_int,2,N_det_restart),psi_coef_tmp(N_det_restart,N_states),accu(N_states))
|
|
|
|
accu = 0.d0
|
|
|
|
do i = 1, N_det_restart
|
|
|
|
do j = 1, N_int
|
|
|
|
psi_det_tmp(j,1,i) = psi_det(j,1,index_restart(i))
|
|
|
|
psi_det_tmp(j,2,i) = psi_det(j,2,index_restart(i))
|
|
|
|
enddo
|
|
|
|
do j = 1,N_states
|
|
|
|
psi_coef_tmp(i,j) = psi_coef(index_restart(i),j)
|
|
|
|
accu(j) += psi_coef_tmp(i,j) * psi_coef_tmp(i,j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
do j = 1, N_states
|
|
|
|
accu(j) = 1.d0/dsqrt(accu(j))
|
|
|
|
enddo
|
|
|
|
do j = 1,N_states
|
|
|
|
do i = 1, N_det_restart
|
|
|
|
psi_coef_tmp(i,j) = psi_coef_tmp(i,j) * accu(j)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
call save_wavefunction_general(N_det_restart,N_states,psi_det_tmp,N_det_restart,psi_coef_tmp)
|
|
|
|
|
|
|
|
deallocate (psi_det_tmp,psi_coef_tmp,accu,index_restart)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2016-07-16 16:09:50 +02:00
|
|
|
subroutine routine
|
|
|
|
implicit none
|
|
|
|
call make_s2_eigenfunction
|
2015-04-20 16:45:06 +02:00
|
|
|
TOUCH psi_det psi_coef psi_det_sorted psi_coef_sorted psi_average_norm_contrib_sorted N_det
|
|
|
|
call save_wavefunction
|
|
|
|
end
|