mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
Working on ERI
This commit is contained in:
parent
fdf6b02043
commit
e9c0a8d0db
16
Basis/ERI.ml
16
Basis/ERI.ml
@ -30,7 +30,10 @@ let contracted_class_shell_pairs ?schwartz_p ?schwartz_q shell_p shell_q : float
|
|||||||
TwoElectronRR.contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
TwoElectronRR.contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
||||||
|
|
||||||
|
|
||||||
|
let cutoff2 = cutoff *. cutoff
|
||||||
|
(*
|
||||||
type n_cls = { n : int ; cls : Z.t array }
|
type n_cls = { n : int ; cls : Z.t array }
|
||||||
|
*)
|
||||||
exception NullIntegral
|
exception NullIntegral
|
||||||
|
|
||||||
(** Write all integrals to a file with the <ij|kl> convention *)
|
(** Write all integrals to a file with the <ij|kl> convention *)
|
||||||
@ -60,6 +63,8 @@ let to_file ~filename basis =
|
|||||||
) pair_array ) shell_pairs
|
) pair_array ) shell_pairs
|
||||||
in
|
in
|
||||||
|
|
||||||
|
let inn = ref 0 and out = ref 0 in
|
||||||
|
|
||||||
for i=0 to (Array.length basis) - 1 do
|
for i=0 to (Array.length basis) - 1 do
|
||||||
print_int basis.(i).Contracted_shell.indice ; print_newline ();
|
print_int basis.(i).Contracted_shell.indice ; print_newline ();
|
||||||
for j=0 to i do
|
for j=0 to i do
|
||||||
@ -73,7 +78,7 @@ let to_file ~filename basis =
|
|||||||
for l=0 to k do
|
for l=0 to k do
|
||||||
let schwartz_q, schwartz_q_max = schwartz.(k).(l) in
|
let schwartz_q, schwartz_q_max = schwartz.(k).(l) in
|
||||||
try
|
try
|
||||||
if schwartz_p_max *. schwartz_q_max < cutoff *. cutoff then
|
if schwartz_p_max *. schwartz_q_max < cutoff2 then
|
||||||
raise NullIntegral;
|
raise NullIntegral;
|
||||||
let
|
let
|
||||||
shell_q = shell_pairs.(k).(l)
|
shell_q = shell_pairs.(k).(l)
|
||||||
@ -103,18 +108,23 @@ let to_file ~filename basis =
|
|||||||
Zmap.find cls key
|
Zmap.find cls key
|
||||||
in
|
in
|
||||||
if (abs_float value > cutoff) then
|
if (abs_float value > cutoff) then
|
||||||
|
(inn := !inn + 1;
|
||||||
Printf.fprintf oc "%4d %4d %4d %4d %20.12e\n"
|
Printf.fprintf oc "%4d %4d %4d %4d %20.12e\n"
|
||||||
i_c k_c j_c l_c value
|
i_c k_c j_c l_c value
|
||||||
|
)
|
||||||
|
else
|
||||||
|
out := !out + 1;
|
||||||
) basis.(l).Contracted_shell.powers
|
) basis.(l).Contracted_shell.powers
|
||||||
) basis.(k).Contracted_shell.powers
|
) basis.(k).Contracted_shell.powers
|
||||||
) basis.(j).Contracted_shell.powers
|
) basis.(j).Contracted_shell.powers
|
||||||
) basis.(i).Contracted_shell.powers;
|
) basis.(i).Contracted_shell.powers;
|
||||||
with NullIntegral -> print_endline "Schwartz"; ()
|
with NullIntegral -> ()
|
||||||
done;
|
done;
|
||||||
done;
|
done;
|
||||||
with NullIntegral -> print_endline "Big Schwartz"; ()
|
with NullIntegral -> ()
|
||||||
done;
|
done;
|
||||||
done;
|
done;
|
||||||
|
Printf.printf "In: %d Out:%d\n" !inn !out ;
|
||||||
close_out oc
|
close_out oc
|
||||||
|
|
||||||
(*
|
(*
|
||||||
|
@ -27,8 +27,8 @@ let hvrr_two_e m (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
| (0,0) -> zero_m_array.(m)
|
| (0,0) -> zero_m_array.(m)
|
||||||
| (_,0) ->
|
| (_,0) ->
|
||||||
|
|
||||||
let key = [| angMom_a.(0)+1; angMom_a.(1)+1; angMom_a.(2)+1; |]
|
let key = Zkey.of_int_tuple (Zkey.Three
|
||||||
|> Zkey.(of_int_array ~kind:Kind_3)
|
(angMom_a.(0)+1, angMom_a.(1)+1, angMom_a.(2)+1) )
|
||||||
in
|
in
|
||||||
|
|
||||||
let (found, result) =
|
let (found, result) =
|
||||||
@ -61,9 +61,10 @@ let hvrr_two_e m (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
|
|
||||||
| (_,_) ->
|
| (_,_) ->
|
||||||
|
|
||||||
let key = [| angMom_a.(0)+1; angMom_a.(1)+1; angMom_a.(2)+1;
|
let key = Zkey.of_int_tuple (Zkey.Six
|
||||||
angMom_c.(0)+1; angMom_c.(1)+1; angMom_c.(2)+1; |]
|
((angMom_a.(0)+1, angMom_a.(1)+1, angMom_a.(2)+1),
|
||||||
|> Zkey.(of_int_array ~kind:Kind_6)
|
(angMom_c.(0)+1, angMom_c.(1)+1, angMom_c.(2)+1)) )
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
let (found, result) =
|
let (found, result) =
|
||||||
@ -110,11 +111,12 @@ let hvrr_two_e m (angMom_a, angMom_b, angMom_c, angMom_d)
|
|||||||
| (0,0) -> vrr m angMom_a angMom_c totAngMom_a totAngMom_c
|
| (0,0) -> vrr m angMom_a angMom_c totAngMom_a totAngMom_c
|
||||||
| (_,_) ->
|
| (_,_) ->
|
||||||
|
|
||||||
let key = [| angMom_a.(0)+1; angMom_a.(1)+1; angMom_a.(2)+1;
|
let key = Zkey.of_int_tuple (Zkey.Twelve
|
||||||
angMom_b.(0)+1; angMom_b.(1)+1; angMom_b.(2)+1;
|
(( angMom_a.(0)+1, angMom_a.(1)+1, angMom_a.(2)+1),
|
||||||
angMom_c.(0)+1; angMom_c.(1)+1; angMom_c.(2)+1;
|
( angMom_b.(0)+1, angMom_b.(1)+1, angMom_b.(2)+1),
|
||||||
angMom_d.(0)+1; angMom_d.(1)+1; angMom_d.(2)+1; |]
|
( angMom_c.(0)+1, angMom_c.(1)+1, angMom_c.(2)+1),
|
||||||
|> Zkey.(of_int_array ~kind:Kind_12)
|
( angMom_d.(0)+1, angMom_d.(1)+1, angMom_d.(2)+1)) )
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
let (found, result) =
|
let (found, result) =
|
||||||
@ -189,15 +191,6 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
|
|||||||
totAngMom shell_c, totAngMom shell_d))
|
totAngMom shell_c, totAngMom shell_d))
|
||||||
in
|
in
|
||||||
|
|
||||||
(*
|
|
||||||
(* Precomputation of overlaps *)
|
|
||||||
let overlaps_p =
|
|
||||||
Overlap.contracted_class shell_a shell_b
|
|
||||||
and overlaps_q =
|
|
||||||
Overlap.contracted_class shell_c shell_d
|
|
||||||
in
|
|
||||||
*)
|
|
||||||
|
|
||||||
let contracted_class =
|
let contracted_class =
|
||||||
Array.make (Array.length class_indices) 0.;
|
Array.make (Array.length class_indices) 0.;
|
||||||
in
|
in
|
||||||
|
Loading…
Reference in New Issue
Block a user