10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-08 15:13:52 +01:00
quantum_package/plugins/MRCC/mrcc.irp.f

71 lines
1.5 KiB
Fortran
Raw Normal View History

2015-04-01 13:23:02 +02:00
program mrcc
implicit none
read_wf = .True.
TOUCH read_wf
2015-04-02 10:13:33 +02:00
call run
2015-04-09 21:46:37 +02:00
call run_mrcc
! call run_mrcc_test
2015-04-02 10:13:33 +02:00
end
2015-04-01 13:23:02 +02:00
2015-04-02 10:13:33 +02:00
subroutine run
implicit none
2015-04-01 13:23:02 +02:00
2015-04-09 21:46:37 +02:00
integer :: i,j
2015-04-01 13:23:02 +02:00
print *, 'CAS'
print *, '==='
do i=1,N_det_cas
2015-04-09 23:59:06 +02:00
print *, psi_cas_coef(i,:)
2015-04-01 13:23:02 +02:00
call debug_det(psi_cas(1,1,i),N_int)
enddo
2015-04-09 22:32:25 +02:00
! print *, 'SD'
! print *, '=='
! do i=1,N_det_non_cas
2015-04-09 23:59:06 +02:00
! print *, psi_non_cas_coef(i,:)
2015-04-09 22:32:25 +02:00
! call debug_det(psi_non_cas(1,1,i),N_int)
! enddo
call write_double(6,ci_energy(1),"Initial CI energy")
2015-04-09 21:46:37 +02:00
end
subroutine run_mrcc_test
implicit none
integer :: i,j
double precision :: pt2
pt2 = 0.d0
do j=1,N_det
do i=1,N_det
pt2 += psi_coef(i,1)*psi_coef(j,1) * delta_ij(i,j,1)
enddo
enddo
print *, ci_energy(1)
print *, ci_energy(1)+pt2
end
subroutine run_mrcc
implicit none
integer :: i,j
double precision :: E_new, E_old, delta_e
integer :: iteration
E_new = 0.d0
delta_E = 1.d0
iteration = 0
2015-07-02 00:45:36 +02:00
do while (delta_E > 1.d-10)
2015-04-09 21:46:37 +02:00
iteration += 1
print *, '==========================='
print *, 'MRCC Iteration', iteration
print *, '==========================='
print *, ''
E_old = sum(ci_energy_dressed)
2015-04-09 23:59:06 +02:00
call write_double(6,ci_energy_dressed(1),"MRCC energy")
call diagonalize_ci_dressed
2015-04-09 21:46:37 +02:00
E_new = sum(ci_energy_dressed)
delta_E = dabs(E_new - E_old)
2015-06-30 10:46:50 +02:00
if (iteration > 20) then
exit
endif
2015-04-09 21:46:37 +02:00
enddo
call write_double(6,ci_energy_dressed(1),"Final MRCC energy")
2015-04-09 22:32:25 +02:00
call ezfio_set_mrcc_energy(ci_energy_dressed(1))
! call save_wavefunction
2015-04-09 21:46:37 +02:00
2015-04-01 13:23:02 +02:00
end