mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-10-04 23:36:08 +02:00
Works
This commit is contained in:
parent
2d759e736e
commit
d4242e406e
@ -244,7 +244,7 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
in
|
in
|
||||||
(** Screening on the product of coefficients *)
|
(** Screening on the product of coefficients *)
|
||||||
try
|
try
|
||||||
if (abs_float coef_prod) < 1.e-4*.cutoff then
|
if (abs_float coef_prod) < 1.e-3*.cutoff then
|
||||||
raise NullQuartet;
|
raise NullQuartet;
|
||||||
|
|
||||||
let expo_pq_inv =
|
let expo_pq_inv =
|
||||||
@ -276,14 +276,10 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
Array.iter (fun shell_ab ->
|
Array.iter (fun shell_ab ->
|
||||||
let b = shell_ab.Shell_pair.j in
|
let b = shell_ab.Shell_pair.j in
|
||||||
let common =
|
let common =
|
||||||
Array.map (fun shell_cd ->
|
Array.mapi (fun idx shell_cd ->
|
||||||
let coef_prod =
|
let coef_prod =
|
||||||
shell_ab.Shell_pair.coef *. shell_cd.Shell_pair.coef
|
shell_ab.Shell_pair.coef *. shell_cd.Shell_pair.coef
|
||||||
in
|
in
|
||||||
let coef_prod =
|
|
||||||
if (abs_float coef_prod) < 1.e-4*.cutoff then
|
|
||||||
0. else coef_prod
|
|
||||||
in
|
|
||||||
let expo_pq_inv =
|
let expo_pq_inv =
|
||||||
shell_ab.Shell_pair.expo_inv +. shell_cd.Shell_pair.expo_inv
|
shell_ab.Shell_pair.expo_inv +. shell_cd.Shell_pair.expo_inv
|
||||||
in
|
in
|
||||||
@ -302,21 +298,27 @@ Array.iter (fun shell_ab ->
|
|||||||
|
|
||||||
(zero_m_array, shell_cd.Shell_pair.expo_inv,
|
(zero_m_array, shell_cd.Shell_pair.expo_inv,
|
||||||
Contracted_shell.expo shell_d d, shell_cd.Shell_pair.center_ab,
|
Contracted_shell.expo shell_d d, shell_cd.Shell_pair.center_ab,
|
||||||
center_pq,coef_prod)
|
center_pq,coef_prod,idx)
|
||||||
) shell_q
|
) shell_q
|
||||||
|
|> Array.to_list
|
||||||
|
|> List.filter (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
|
center_pq,coef_prod,idx) -> abs_float coef_prod >= 1.e-4 *. cutoff)
|
||||||
|
|> Array.of_list
|
||||||
in
|
in
|
||||||
let zero_m_array = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
let zero_m_array = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
center_pq,coef_prod) -> zero_m_array) common
|
center_pq,coef_prod,idx) -> zero_m_array) common
|
||||||
and expo_inv = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
and expo_inv = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
center_pq,coef_prod) -> expo_inv ) common
|
center_pq,coef_prod,idx) -> expo_inv ) common
|
||||||
and d = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
and d = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
center_pq,coef_prod) -> d) common
|
center_pq,coef_prod,idx) -> d) common
|
||||||
and center_cd = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
and center_cd = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
center_pq,coef_prod) -> center_cd) common
|
center_pq,coef_prod,idx) -> center_cd) common
|
||||||
and center_pq = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
and center_pq = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
center_pq,coef_prod) -> center_pq) common
|
center_pq,coef_prod,idx) -> center_pq) common
|
||||||
and coef_prod = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
and coef_prod = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
center_pq,coef_prod) -> coef_prod) common
|
center_pq,coef_prod,idx) -> coef_prod) common
|
||||||
|
and idx = Array.map (fun (zero_m_array, expo_inv, d, center_cd,
|
||||||
|
center_pq,coef_prod,idx) -> idx) common
|
||||||
in
|
in
|
||||||
let map = Array.init maxm (fun _ -> Zmap.create (Array.length class_indices)) in
|
let map = Array.init maxm (fun _ -> Zmap.create (Array.length class_indices)) in
|
||||||
(* Compute the integral class from the primitive shell quartet *)
|
(* Compute the integral class from the primitive shell quartet *)
|
||||||
@ -333,6 +335,7 @@ Array.iter (fun shell_ab ->
|
|||||||
shell_ab.Shell_pair.norm_fun angMomA angMomB *. shell_cd.Shell_pair.norm_fun angMomC angMomD
|
shell_ab.Shell_pair.norm_fun angMomA angMomB *. shell_cd.Shell_pair.norm_fun angMomC angMomD
|
||||||
) shell_q
|
) shell_q
|
||||||
in
|
in
|
||||||
|
try
|
||||||
let integral =
|
let integral =
|
||||||
hvrr_two_e 0 (angMomA, angMomB, angMomC, angMomD)
|
hvrr_two_e 0 (angMomA, angMomB, angMomC, angMomD)
|
||||||
(Contracted_shell.totAngMom shell_a, Contracted_shell.totAngMom shell_b,
|
(Contracted_shell.totAngMom shell_a, Contracted_shell.totAngMom shell_b,
|
||||||
@ -342,10 +345,11 @@ Array.iter (fun shell_ab ->
|
|||||||
(shell_ab.Shell_pair.expo_inv, expo_inv)
|
(shell_ab.Shell_pair.expo_inv, expo_inv)
|
||||||
(shell_ab.Shell_pair.center_ab, center_cd, center_pq)
|
(shell_ab.Shell_pair.center_ab, center_cd, center_pq)
|
||||||
coef_prod map
|
coef_prod map
|
||||||
|> Array.map2 (fun x y -> x *. y ) norm
|
|> Array.mapi (fun i x -> x *. norm.(idx.(i)) )
|
||||||
in
|
in
|
||||||
let x = Array.fold_left (+.) 0. integral in
|
let x = Array.fold_left (+.) 0. integral in
|
||||||
contracted_class.(i) <- contracted_class.(i) +. x
|
contracted_class.(i) <- contracted_class.(i) +. x
|
||||||
|
with NullQuartet -> ()
|
||||||
) class_indices
|
) class_indices
|
||||||
) shell_p
|
) shell_p
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user