mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
zerom_cache
This commit is contained in:
parent
9a8f440f7a
commit
94ab6f0174
@ -13,6 +13,7 @@ open Bigarray
|
|||||||
norm_pq_sq : square of the distance between the centers of $\phi_p$
|
norm_pq_sq : square of the distance between the centers of $\phi_p$
|
||||||
and $\phi_q$
|
and $\phi_q$
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let zero_m ~maxm ~expo_pq_inv ~norm_pq_sq =
|
let zero_m ~maxm ~expo_pq_inv ~norm_pq_sq =
|
||||||
let exp_pq = 1. /. expo_pq_inv in
|
let exp_pq = 1. /. expo_pq_inv in
|
||||||
let t = norm_pq_sq *. exp_pq in
|
let t = norm_pq_sq *. exp_pq in
|
||||||
|
@ -325,6 +325,9 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
|
|
||||||
(* Compute all integrals in the shell for each pair of significant shell pairs *)
|
(* Compute all integrals in the shell for each pair of significant shell pairs *)
|
||||||
|
|
||||||
|
let zero_m_cache =
|
||||||
|
Hashtbl.create 129
|
||||||
|
in
|
||||||
for ab=0 to (Array.length shell_p - 1) do
|
for ab=0 to (Array.length shell_p - 1) do
|
||||||
let cab = shell_p.(ab).Shell_pair.coef in
|
let cab = shell_p.(ab).Shell_pair.coef in
|
||||||
let b = shell_p.(ab).Shell_pair.j in
|
let b = shell_p.(ab).Shell_pair.j in
|
||||||
@ -349,7 +352,20 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
in
|
in
|
||||||
|
|
||||||
let zero_m_array =
|
let zero_m_array =
|
||||||
zero_m ~maxm ~expo_pq_inv ~norm_pq_sq
|
let key = String.concat " "
|
||||||
|
[ string_of_int maxm ; string_of_float expo_pq_inv ; string_of_float norm_pq_sq ]
|
||||||
|
in
|
||||||
|
try
|
||||||
|
let result =
|
||||||
|
Hashtbl.find zero_m_cache key
|
||||||
|
in
|
||||||
|
result
|
||||||
|
with
|
||||||
|
| Not_found ->
|
||||||
|
let result =
|
||||||
|
zero_m ~maxm ~expo_pq_inv ~norm_pq_sq
|
||||||
|
in
|
||||||
|
(Hashtbl.add zero_m_cache key result ; result)
|
||||||
in
|
in
|
||||||
begin
|
begin
|
||||||
match Contracted_shell.(totAngMom shell_a, totAngMom shell_b,
|
match Contracted_shell.(totAngMom shell_a, totAngMom shell_b,
|
||||||
|
@ -306,6 +306,9 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
Array.make (Array.length class_indices) 0.;
|
Array.make (Array.length class_indices) 0.;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
let zero_m_cache =
|
||||||
|
Hashtbl.create 129
|
||||||
|
in
|
||||||
(* Compute all integrals in the shell for each pair of significant shell pairs *)
|
(* Compute all integrals in the shell for each pair of significant shell pairs *)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -334,8 +337,21 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
Coordinate.dot center_pq center_pq
|
Coordinate.dot center_pq center_pq
|
||||||
in
|
in
|
||||||
|
|
||||||
let zero_m_array =
|
let zero_m_array =
|
||||||
zero_m ~maxm:0 ~expo_pq_inv ~norm_pq_sq
|
let key = String.concat " "
|
||||||
|
[ string_of_int 0 ; string_of_float expo_pq_inv ; string_of_float norm_pq_sq ]
|
||||||
|
in
|
||||||
|
try
|
||||||
|
let result =
|
||||||
|
Hashtbl.find zero_m_cache key
|
||||||
|
in
|
||||||
|
result
|
||||||
|
with
|
||||||
|
| Not_found ->
|
||||||
|
let result =
|
||||||
|
zero_m ~maxm:0 ~expo_pq_inv ~norm_pq_sq
|
||||||
|
in
|
||||||
|
(Hashtbl.add zero_m_cache key result ; result)
|
||||||
in
|
in
|
||||||
|
|
||||||
accu +. coef_prod *. zero_m_array.(0)
|
accu +. coef_prod *. zero_m_array.(0)
|
||||||
@ -362,8 +378,21 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
Coordinate.dot center_pq center_pq
|
Coordinate.dot center_pq center_pq
|
||||||
in
|
in
|
||||||
|
|
||||||
let zero_m_array =
|
let zero_m_array =
|
||||||
zero_m ~maxm ~expo_pq_inv ~norm_pq_sq
|
let key = String.concat " "
|
||||||
|
[ string_of_int maxm ; string_of_float expo_pq_inv ; string_of_float norm_pq_sq ]
|
||||||
|
in
|
||||||
|
try
|
||||||
|
let result =
|
||||||
|
Hashtbl.find zero_m_cache key
|
||||||
|
in
|
||||||
|
result
|
||||||
|
with
|
||||||
|
| Not_found ->
|
||||||
|
let result =
|
||||||
|
zero_m ~maxm ~expo_pq_inv ~norm_pq_sq
|
||||||
|
in
|
||||||
|
(Hashtbl.add zero_m_cache key result ; result)
|
||||||
in
|
in
|
||||||
|
|
||||||
let d = shell_cd.Shell_pair.j in
|
let d = shell_cd.Shell_pair.j in
|
||||||
|
Loading…
Reference in New Issue
Block a user