10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-24 13:23:41 +01:00

Barycentric energy

This commit is contained in:
Anthony Scemama 2018-04-12 15:29:44 +02:00
parent 4cbe7d33a2
commit f3a79c2316
4 changed files with 50 additions and 5 deletions

13
ocaml/myocamlbuild.ml Normal file
View File

@ -0,0 +1,13 @@
open Ocamlbuild_plugin;;
open Command;;
dispatch begin function
| Before_rules ->
begin
end
| After_rules ->
begin
flag ["ocaml";"compile";"native";"gprof"] (S [ A "-p"]);
end
| _ -> ()
end

View File

@ -12,14 +12,15 @@ BEGIN_PROVIDER [ double precision, pt2_E0_denominator, (N_states) ]
! E0 in the denominator of the PT2
END_DOC
if (initialize_pt2_E0_denominator) then
pt2_E0_denominator(1:N_states) = psi_energy(1:N_states)
pt2_E0_denominator(1:N_states) = psi_energy(1:N_states)
! call ezfio_get_full_ci_zmq_energy(pt2_E0_denominator(1))
! pt2_E0_denominator(1) -= nuclear_repulsion
! pt2_E0_denominator(1:N_states) = HF_energy - nuclear_repulsion
! pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
! pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
call write_double(6,pt2_E0_denominator(1)+nuclear_repulsion, 'PT2 Energy denominator')
else
pt2_E0_denominator = -huge(1.d0)
endif
END_PROVIDER

View File

@ -84,9 +84,9 @@ BEGIN_PROVIDER [ double precision, E0_denominator, (N_states) ]
if (initialize_E0_denominator) then
E0_denominator(1:N_states) = psi_energy(1:N_states)
! call ezfio_get_full_ci_zmq_energy(pt2_E0_denominator(1))
! pt2_E0_denominator(1) -= nuclear_repulsion
! pt2_E0_denominator(1:N_states) = HF_energy - nuclear_repulsion
! pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
! E0_denominator(1) -= nuclear_repulsion
! E0_denominator(1:N_states) = HF_energy - nuclear_repulsion
! E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
else
E0_denominator = -huge(1.d0)
endif

View File

@ -0,0 +1,31 @@
BEGIN_PROVIDER [ double precision, diagonal_H_matrix_on_psi_det, (N_det) ]
implicit none
BEGIN_DOC
! Diagonal of the Hamiltonian ordered as psi_det
END_DOC
double precision, external :: diag_h_mat_elem
integer :: i
do i=1,N_det
diagonal_H_matrix_on_psi_det(i) = diag_h_mat_elem(psi_det(1,1,i),N_int)
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, barycentric_electronic_energy, (N_states) ]
implicit none
BEGIN_DOC
! TODO : ASCII Elephant
END_DOC
integer :: istate,i
barycentric_electronic_energy(:) = 0.d0
do istate=1,N_states
do i=1,N_det
barycentric_electronic_energy(istate) += psi_coef(i,istate)*psi_coef(i,istate)*diagonal_H_matrix_on_psi_det(i)
enddo
enddo
END_PROVIDER