10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-25 04:07:24 +02:00

Schwartz in VectorRR

This commit is contained in:
Anthony Scemama 2018-02-12 00:56:32 +01:00
parent cf075946e8
commit fe3fcd7a12
3 changed files with 73 additions and 61 deletions

View File

@ -350,7 +350,9 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
let monocentric = let monocentric =
shell_p.ContractedShellPair.monocentric && shell_p.ContractedShellPair.monocentric &&
shell_q.ContractedShellPair.monocentric shell_q.ContractedShellPair.monocentric &&
Contracted_shell.center shell_p.ContractedShellPair.shell_a =
Contracted_shell.center shell_q.ContractedShellPair.shell_a
in 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 *)
@ -369,10 +371,6 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
if (abs_float coef_prod) < 1.e-3*.cutoff then if (abs_float coef_prod) < 1.e-3*.cutoff then
raise NullQuartet; raise NullQuartet;
let expo_pq_inv =
shell_p.ContractedShellPair.expo_inv.(ab) +.
shell_q.ContractedShellPair.expo_inv.(cd)
in
let center_pq = let center_pq =
Coordinate.(sp.(ab).ShellPair.center |- sq.(cd).ShellPair.center) Coordinate.(sp.(ab).ShellPair.center |- sq.(cd).ShellPair.center)
in in
@ -380,6 +378,11 @@ 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 expo_pq_inv =
shell_p.ContractedShellPair.expo_inv.(ab) +.
shell_q.ContractedShellPair.expo_inv.(cd)
in
let zero_m_array = let zero_m_array =
zero_m ~maxm ~expo_pq_inv ~norm_pq_sq zero_m ~maxm ~expo_pq_inv ~norm_pq_sq
in in
@ -403,14 +406,7 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
Array.map (fun v2 -> v1 *. v2) norm_coef_scale_q) Array.map (fun v2 -> v1 *. v2) norm_coef_scale_q)
|> Array.concat |> Array.concat
in in
let () =
if debug then (
if monocentric then
Printf.printf "Mono-centric\n"
else
Printf.printf "Multi-centric\n"
)
in
(* Compute the integral class from the primitive shell quartet *) (* Compute the integral class from the primitive shell quartet *)
class_indices class_indices
|> Array.iteri (fun i key -> |> Array.iteri (fun i key ->
@ -420,49 +416,45 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
| _ -> assert false | _ -> assert false
in in
try try
if monocentric then if monocentric then
begin begin
let ax,ay,az = angMomA let ax,ay,az = angMomA
and bx,by,bz = angMomB and bx,by,bz = angMomB
and cx,cy,cz = angMomC and cx,cy,cz = angMomC
and dx,dy,dz = angMomD and dx,dy,dz = angMomD
in in
if ( ((1 land ax+bx+cx+dx)=1) || if ( ((1 land ax+bx+cx+dx)=1) ||
((1 land ay+by+cy+dy)=1) || ((1 land ay+by+cy+dy)=1) ||
((1 land az+bz+cz+dz)=1) ((1 land az+bz+cz+dz)=1)
) then ) then
raise NullQuartet raise NullQuartet
end; end;
(* Schwartz screening *)
(* (*
let schwartz_p = (* Schwartz screening *)
let key = if (maxm > 2) then
Zkey.of_int_array Zkey.Kind_12 (
[| a.(0) ; a.(1) ; a.(2) ; let schwartz_p =
a.(3) ; a.(4) ; a.(5) ; let key = Zkey.of_int_tuple (Zkey.Twelve
a.(0) ; a.(1) ; a.(2) ; (angMomA, angMomB, angMomA, angMomB) )
a.(3) ; a.(4) ; a.(5) |] in
match schwartz_p with
| None -> 1.
| Some schwartz_p -> Zmap.find schwartz_p key
in in
match schwartz_p with if schwartz_p < cutoff then raise NullQuartet;
| None -> 1. let schwartz_q =
| Some schwartz_p -> Zmap.find schwartz_p key let key = Zkey.of_int_tuple (Zkey.Twelve
in (angMomC, angMomD, angMomC, angMomD) )
if schwartz_p < cutoff then raise NullQuartet; in
let schwartz_q = match schwartz_q with
let key = | None -> 1.
Zkey.of_int_array Zkey.Kind_12 | Some schwartz_q -> Zmap.find schwartz_q key
[| a.(6) ; a.(7) ; a.(8) ;
a.(9) ; a.(10) ; a.(11) ;
a.(6) ; a.(7) ; a.(8) ;
a.(9) ; a.(10) ; a.(11) |]
in in
match schwartz_q with if schwartz_p *. schwartz_q < cutoff2 then raise NullQuartet;
| None -> 1. );
| Some schwartz_q -> Zmap.find schwartz_q key
in
if schwartz_p *. schwartz_q < cutoff2 then raise NullQuartet;
*) *)
let norm = norm_coef_scale.(i) in let norm = norm_coef_scale.(i) in
let coef_prod = coef_prod *. norm in let coef_prod = coef_prod *. norm in
let integral = let integral =

View File

@ -495,7 +495,9 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
let monocentric = let monocentric =
shell_p.ContractedShellPair.monocentric && shell_p.ContractedShellPair.monocentric &&
shell_q.ContractedShellPair.monocentric shell_q.ContractedShellPair.monocentric &&
Contracted_shell.center shell_p.ContractedShellPair.shell_a =
Contracted_shell.center shell_q.ContractedShellPair.shell_a
in in
(** Screening on the product of coefficients *) (** Screening on the product of coefficients *)
@ -566,6 +568,7 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
let expo_pq_inv = let expo_pq_inv =
expo_inv_p.{i} +. expo_inv_q.{j} expo_inv_p.{i} +. expo_inv_q.{j}
in in
let center_pq = let center_pq =
Coordinate.(sp.(i-1).ShellPair.center |- sq.(j-1).ShellPair.center) Coordinate.(sp.(i-1).ShellPair.center |- sq.(j-1).ShellPair.center)
in in
@ -691,15 +694,30 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
) then ) then
raise NullQuartet raise NullQuartet
end; end;
(*
let a = Zkey.to_int_array Zkey.Kind_12 key in (* Schwartz screening *)
let (angMomA,angMomB,angMomC,angMomD) = if (np+nq> 24) then
( [| a.(0) ; a.(1) ; a.(2) |], (
[| a.(3) ; a.(4) ; a.(5) |], let schwartz_p =
[| a.(6) ; a.(7) ; a.(8) |], let key = Zkey.of_int_tuple (Zkey.Twelve
[| a.(9) ; a.(10) ; a.(11) |] ) (angMomA, angMomB, angMomA, angMomB) )
in in
*) match schwartz_p with
| None -> 1.
| Some schwartz_p -> Zmap.find schwartz_p key
in
if schwartz_p < cutoff then raise NullQuartet;
let schwartz_q =
let key = Zkey.of_int_tuple (Zkey.Twelve
(angMomC, angMomD, angMomC, angMomD) )
in
match schwartz_q with
| None -> 1.
| Some schwartz_q -> Zmap.find schwartz_q key
in
if schwartz_p *. schwartz_q < cutoff2 then raise NullQuartet;
);
let integral = let integral =
hvrr_two_e_vector (angMomA, angMomB, angMomC, angMomD) hvrr_two_e_vector (angMomA, angMomB, angMomC, angMomD)
(Contracted_shell.totAngMom shell_a, Contracted_shell.totAngMom shell_b, (Contracted_shell.totAngMom shell_a, Contracted_shell.totAngMom shell_b,

View File

@ -187,6 +187,8 @@ let to_int_tuple ~kind a =
| Kind_1 -> One ( Z.to_int a ) | Kind_1 -> One ( Z.to_int a )
let zero = Z.of_int 0
include Z include Z
let to_string ~kind a = let to_string ~kind a =