10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-03 20:54:00 +01:00

Merge branch 'master' into master

This commit is contained in:
garniron 2017-12-06 16:16:44 +01:00 committed by GitHub
commit a14e69bdb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 102 additions and 1 deletions

View File

@ -13,6 +13,8 @@ BEGIN_PROVIDER [ double precision, mrcc_E0_denominator, (N_states) ]
END_DOC END_DOC
if (initialize_mrcc_E0_denominator) then if (initialize_mrcc_E0_denominator) then
mrcc_E0_denominator(1:N_states) = psi_energy(1:N_states) mrcc_E0_denominator(1:N_states) = psi_energy(1:N_states)
! mrcc_E0_denominator(1:N_states) = HF_energy - nuclear_repulsion
! mrcc_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
call write_double(6,mrcc_E0_denominator(1)+nuclear_repulsion, 'mrcc Energy denominator') call write_double(6,mrcc_E0_denominator(1)+nuclear_repulsion, 'mrcc Energy denominator')
else else
mrcc_E0_denominator = -huge(1.d0) mrcc_E0_denominator = -huge(1.d0)

View File

@ -0,0 +1,80 @@
! DO NOT MODIFY BY HAND
! Created by $QP_ROOT/scripts/ezfio_interface/ei_handler.py
! from file /home/garniron/quantum_package/src/mrcepa0/EZFIO.cfg
BEGIN_PROVIDER [ logical, perturbative_triples ]
implicit none
BEGIN_DOC
! Compute perturbative contribution of the Triples
END_DOC
logical :: has
PROVIDE ezfio_filename
call ezfio_has_mrcepa0_perturbative_triples(has)
if (has) then
call ezfio_get_mrcepa0_perturbative_triples(perturbative_triples)
else
print *, 'mrcepa0/perturbative_triples not found in EZFIO file'
stop 1
endif
END_PROVIDER
BEGIN_PROVIDER [ double precision, thresh_dressed_ci ]
implicit none
BEGIN_DOC
! Threshold on the convergence of the dressed CI energy
END_DOC
logical :: has
PROVIDE ezfio_filename
call ezfio_has_mrcepa0_thresh_dressed_ci(has)
if (has) then
call ezfio_get_mrcepa0_thresh_dressed_ci(thresh_dressed_ci)
else
print *, 'mrcepa0/thresh_dressed_ci not found in EZFIO file'
stop 1
endif
END_PROVIDER
BEGIN_PROVIDER [ integer, n_it_max_dressed_ci ]
implicit none
BEGIN_DOC
! Maximum number of dressed CI iterations
END_DOC
logical :: has
PROVIDE ezfio_filename
call ezfio_has_mrcepa0_n_it_max_dressed_ci(has)
if (has) then
call ezfio_get_mrcepa0_n_it_max_dressed_ci(n_it_max_dressed_ci)
else
print *, 'mrcepa0/n_it_max_dressed_ci not found in EZFIO file'
stop 1
endif
END_PROVIDER
BEGIN_PROVIDER [ integer, lambda_type ]
implicit none
BEGIN_DOC
! lambda type
END_DOC
logical :: has
PROVIDE ezfio_filename
call ezfio_has_mrcepa0_lambda_type(has)
if (has) then
call ezfio_get_mrcepa0_lambda_type(lambda_type)
else
print *, 'mrcepa0/lambda_type not found in EZFIO file'
stop 1
endif
END_PROVIDER

View File

@ -11,6 +11,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error)
implicit none implicit none
character(len=64000) :: task character(len=64000) :: task
integer(ZMQ_PTR) :: zmq_to_qp_run_socket, zmq_socket_pull integer(ZMQ_PTR) :: zmq_to_qp_run_socket, zmq_socket_pull
integer, external :: omp_get_thread_num integer, external :: omp_get_thread_num
double precision, intent(in) :: relative_error, E double precision, intent(in) :: relative_error, E
@ -40,6 +41,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error)
print *, ' Samples Energy Stat. Error Seconds ' print *, ' Samples Energy Stat. Error Seconds '
print *, '========== ================= ================= =================' print *, '========== ================= ================= ================='
call new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull, 'mrcc') call new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull, 'mrcc')
integer, external :: zmq_put_psi integer, external :: zmq_put_psi
@ -75,6 +77,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error)
if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then
stop 'Unable to add task to task server' stop 'Unable to add task to task server'
endif endif
ipos=1 ipos=1
endif endif
else else
@ -105,6 +108,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error)
i = omp_get_thread_num() i = omp_get_thread_num()
if (i==0) then if (i==0) then
call mrcc_collector(zmq_socket_pull,E(mrcc_stoch_istate), relative_error, delta, delta_s2, mrcc) call mrcc_collector(zmq_socket_pull,E(mrcc_stoch_istate), relative_error, delta, delta_s2, mrcc)
else else
call mrcc_slave_inproc(i) call mrcc_slave_inproc(i)
endif endif
@ -123,14 +127,18 @@ subroutine mrcc_slave_inproc(i)
end end
subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, mrcc) subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, mrcc)
use dress_types use dress_types
use f77_zmq use f77_zmq
use bitmasks use bitmasks
implicit none implicit none
integer(ZMQ_PTR), intent(in) :: zmq_socket_pull integer(ZMQ_PTR), intent(in) :: zmq_socket_pull
double precision, intent(in) :: relative_error, E double precision, intent(in) :: relative_error, E
double precision, intent(out) :: mrcc(N_states) double precision, intent(out) :: mrcc(N_states)
double precision, allocatable :: cp(:,:,:,:) double precision, allocatable :: cp(:,:,:,:)
@ -236,11 +244,13 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m
end if end if
end do end do
integer, external :: zmq_delete_tasks integer, external :: zmq_delete_tasks
if (zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,ntask,more) == -1) then if (zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,ntask,more) == -1) then
stop 'Unable to delete tasks' stop 'Unable to delete tasks'
endif endif
time = omp_get_wtime() time = omp_get_wtime()
@ -262,6 +272,7 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m
!!!!!!!!!!!! !!!!!!!!!!!!
double precision :: su, su2, eqt, avg, E0, val double precision :: su, su2, eqt, avg, E0, val
integer, external :: zmq_abort integer, external :: zmq_abort
su = 0d0 su = 0d0
su2 = 0d0 su2 = 0d0
@ -284,6 +295,7 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m
if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then
! Termination ! Termination
!print '(G10.3, 2X, F16.7, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, '' !print '(G10.3, 2X, F16.7, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, ''
! print *, "GREPME", cur_cp, E+E0+avg, eqt, time-time0, total_computed ! print *, "GREPME", cur_cp, E+E0+avg, eqt, time-time0, total_computed
if (zmq_abort(zmq_to_qp_run_socket) == -1) then if (zmq_abort(zmq_to_qp_run_socket) == -1) then
call sleep(1) call sleep(1)
@ -296,6 +308,7 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m
if (cur_cp > old_cur_cp) then if (cur_cp > old_cur_cp) then
old_cur_cp = cur_cp old_cur_cp = cur_cp
! print *, "GREPME", cur_cp, E+E0+avg, eqt, time-time0, total_computed ! print *, "GREPME", cur_cp, E+E0+avg, eqt, time-time0, total_computed
!print '(G10.3, 2X, F16.7, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, '' !print '(G10.3, 2X, F16.7, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, ''
endif endif
endif endif
@ -326,6 +339,8 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m
mrcc(1) = E mrcc(1) = E
call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)
call end_zmq_pull_socket(zmq_socket_pull)
end subroutine end subroutine

View File

@ -47,6 +47,10 @@ subroutine run(N_st,energy)
enddo enddo
call diagonalize_ci_dressed(lambda) call diagonalize_ci_dressed(lambda)
E_new = mrcc_e0_denominator(1) !sum(ci_energy_dressed(1:N_states)) E_new = mrcc_e0_denominator(1) !sum(ci_energy_dressed(1:N_states))
! if (.true.) then
! provide delta_ij_mrcc_pouet
! endif
delta_E = (E_new - E_old)/dble(N_states) delta_E = (E_new - E_old)/dble(N_states)
print *, '' print *, ''
call write_double(6,thresh_mrcc,"thresh_mrcc") call write_double(6,thresh_mrcc,"thresh_mrcc")