10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 18:05:59 +02:00

Added barycentric PT

This commit is contained in:
Anthony Scemama 2018-04-12 15:45:28 +02:00
parent f3a79c2316
commit 85bb6ac5f4
5 changed files with 63 additions and 7 deletions

View File

@ -214,6 +214,26 @@ end = struct
| _ -> raise (Invalid_argument (\"Wrong IO type : \"^s))
end
module Perturbation : sig
type t [@@deriving sexp]
val to_string : t -> string
val of_string : string -> t
end = struct
type t =
| EN
| Barycentric
[@@deriving sexp]
let to_string = function
| EN -> \"EN\"
| Barycentric -> \"Barycentric\"
let of_string s =
match (String.lowercase_ascii s) with
| \"en\" -> EN
| \"barycentric\" -> Barycentric
| _ -> raise (Invalid_argument (\"Wrong Perturbation type : \"^s))
end
"

View File

@ -12,11 +12,17 @@ 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)
if (h0_type == "EN") then
pt2_E0_denominator(1:N_states) = psi_energy(1:N_states)
else if (h0_type == "Barycentric") then
pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
else
print *, h0_type, ' not implemented'
stop
endif
! 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)
call write_double(6,pt2_E0_denominator(1)+nuclear_repulsion, 'PT2 Energy denominator')
else
pt2_E0_denominator = -huge(1.d0)

View File

@ -62,4 +62,9 @@ doc: Thresholds on selectors (fraction of the norm) for final PT2 calculation
interface: ezfio,provider,ocaml
default: 1.
[h0_type]
type: Perturbation
doc: Type of zeroth-order Hamiltonian [ EN | Barycentric ]
interface: ezfio,provider,ocaml
default: EN

View File

@ -0,0 +1,22 @@
[energy]
type: double precision
doc: Calculated energy
interface: ezfio
[thresh_dressed_ci]
type: Threshold
doc: Threshold on the convergence of the dressed CI energy
interface: ezfio,provider,ocaml
default: 1.e-5
[n_it_max_dressed_ci]
type: Strictly_positive_int
doc: Maximum number of dressed CI iterations
interface: ezfio,provider,ocaml
default: 10
[h0_type]
type: Perturbation
doc: Type of zeroth-order Hamiltonian [ EN | Barycentric ]
interface: ezfio,provider,ocaml
default: EN

View File

@ -82,11 +82,14 @@ BEGIN_PROVIDER [ double precision, E0_denominator, (N_states) ]
! E0 in the denominator of the PT2
END_DOC
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))
! 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)
if (h0_type == "EN") then
E0_denominator(1:N_states) = psi_energy(1:N_states)
else if (h0_type == "Barycentric") then
E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states)
else
print *, h0_type, ' not implemented'
stop
endif
else
E0_denominator = -huge(1.d0)
endif