10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-19 04:22:21 +01:00

Accelerated vectorized RR

This commit is contained in:
Anthony Scemama 2018-02-12 00:05:33 +01:00
parent 264181ebd1
commit cf075946e8

View File

@ -458,12 +458,8 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
hrr_v angMom_a angMom_b angMom_c dm totAngMom_a totAngMom_b totAngMom_c (totAngMom_d-1) hrr_v angMom_a angMom_b angMom_c dm totAngMom_a totAngMom_b totAngMom_c (totAngMom_d-1)
in h1 +. f *. h2 in h1 +. f *. h2
in in
hrr_v hrr_v angMom_a angMom_b angMom_c angMom_d
(angMom_a.(0),angMom_a.(1),angMom_a.(2)) totAngMom_a totAngMom_b totAngMom_c totAngMom_d
(angMom_b.(0),angMom_b.(1),angMom_b.(2))
(angMom_c.(0),angMom_c.(1),angMom_c.(2))
(angMom_d.(0),angMom_d.(1),angMom_d.(2))
totAngMom_a totAngMom_b totAngMom_c totAngMom_d
@ -497,6 +493,11 @@ 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 monocentric =
shell_p.ContractedShellPair.monocentric &&
shell_q.ContractedShellPair.monocentric
in
(** Screening on the product of coefficients *) (** Screening on the product of coefficients *)
let coef_max_p = let coef_max_p =
Array.fold_left (fun accu x -> Array.fold_left (fun accu x ->
@ -671,25 +672,47 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
in in
(* Compute the integral class from the primitive shell quartet *) (* Compute the integral class from the primitive shell quartet *)
Array.iteri (fun i key -> Array.iteri (fun i key ->
let a = Zkey.to_int_array Zkey.Kind_12 key in
let (angMomA,angMomB,angMomC,angMomD) = let (angMomA,angMomB,angMomC,angMomD) =
( [| a.(0) ; a.(1) ; a.(2) |], match Zkey.to_int_tuple ~kind:Zkey.Kind_12 key with
[| a.(3) ; a.(4) ; a.(5) |], | Zkey.Twelve x -> x
[| a.(6) ; a.(7) ; a.(8) |], | _ -> assert false
[| a.(9) ; a.(10) ; a.(11) |] )
in in
let integral = try
hvrr_two_e_vector (angMomA, angMomB, angMomC, angMomD) if monocentric then
(Contracted_shell.totAngMom shell_a, Contracted_shell.totAngMom shell_b, begin
Contracted_shell.totAngMom shell_c, Contracted_shell.totAngMom shell_d) let ax,ay,az = angMomA
(maxm, zero_m_array) and bx,by,bz = angMomB
(expo_b, expo_d) and cx,cy,cz = angMomC
(expo_inv_p, expo_inv_q) and dx,dy,dz = angMomD
(shell_p.ContractedShellPair.center_ab, in
shell_q.ContractedShellPair.center_ab, center_pq) if ( ((1 land ax+bx+cx+dx)=1) ||
map_1d map_2d np nq ((1 land ay+by+cy+dy)=1) ||
in ((1 land az+bz+cz+dz)=1)
contracted_class.(i) <- contracted_class.(i) +. integral *. norm.(i) ) then
raise NullQuartet
end;
(*
let a = Zkey.to_int_array Zkey.Kind_12 key in
let (angMomA,angMomB,angMomC,angMomD) =
( [| a.(0) ; a.(1) ; a.(2) |],
[| a.(3) ; a.(4) ; a.(5) |],
[| a.(6) ; a.(7) ; a.(8) |],
[| a.(9) ; a.(10) ; a.(11) |] )
in
*)
let integral =
hvrr_two_e_vector (angMomA, angMomB, angMomC, angMomD)
(Contracted_shell.totAngMom shell_a, Contracted_shell.totAngMom shell_b,
Contracted_shell.totAngMom shell_c, Contracted_shell.totAngMom shell_d)
(maxm, zero_m_array)
(expo_b, expo_d)
(expo_inv_p, expo_inv_q)
(shell_p.ContractedShellPair.center_ab,
shell_q.ContractedShellPair.center_ab, center_pq)
map_1d map_2d np nq
in
contracted_class.(i) <- contracted_class.(i) +. integral *. norm.(i)
with NullQuartet -> ()
) class_indices ) class_indices
end; end;