10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-20 04:52:23 +01:00
This commit is contained in:
Anthony Scemama 2020-01-21 17:43:59 +01:00
parent a72fb7e29e
commit 41cfd3e6d4

View File

@ -43,6 +43,7 @@ let array_3_init d1 d2 d3 fx =
done
done)
;
if Parallel.master then Printf.printf "Broadcast d3\n" ;
Parallel.broadcast (lazy result)
let array_4_init d1 d2 d3 d4 fx =
@ -74,6 +75,7 @@ let array_4_init d1 d2 d3 d4 fx =
done
done)
;
if Parallel.master then Printf.printf "Broadcast d4\n" ;
Parallel.broadcast (lazy result)
let array_5_init d1 d2 d3 d4 d5 fx =
@ -109,6 +111,7 @@ let array_5_init d1 d2 d3 d4 d5 fx =
done
done)
;
if Parallel.master then Printf.printf "Broadcast d5\n" ;
Parallel.broadcast (lazy result)
@ -201,12 +204,14 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
(* Pre-compute dressed integrals *)
if Parallel.master then Printf.printf "Computing m_0111_1H_1F\n" ;
let m_0111_1H_1F =
Vec.init mo_num (fun i ->
sum mos_cabs (fun a ->
h_one i a Spin.Alfa *. f_one a i Spin.Alfa ))
in
if Parallel.master then Printf.printf "Computing m_0111_1H_2Fa\n" ;
let m_0111_1H_2Fa, m_0111_2Ha_2Fa =
let m_0122_Haa =
@ -244,6 +249,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
in m_0111_1H_2Fa, m_0111_2Ha_2Fa
in
if Parallel.master then Printf.printf "Computing m_0111_1H_2Fb\n" ;
let m_0111_1H_2Fb, m_0111_2Hb_2Fb =
let m_0122_Hab =
array_3_init mo_num mo_num mo_num (fun i j k ->
@ -282,6 +288,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
m_0111_1H_2Fb, m_0111_2Hb_2Fb
in
if Parallel.master then Printf.printf "Computing m_0111_2Ha_2Fb\n" ;
let m_0111_2Ha_2Fb =
array_3_init mo_num mo_num mo_num (fun i j k ->
sum mos_cabs (fun a ->
@ -354,11 +361,13 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
a +. b +. aa +. bb +. ab +. aaa +. baa +. bba +. bbb
in
if Parallel.master then Printf.printf "Computing m_1111_1H_1F\n" ;
let m_1111_1H_1F =
Mat.init_cols mo_num mo_num (fun i k ->
sum mos_cabs (fun a -> h_one i a Spin.Alfa *. f_one a k Spin.Alfa ))
in
if Parallel.master then Printf.printf "Computing m_1111_2Ha_2Fa\n" ;
let m_1111_2Ha_2Fa =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
if l=i then
@ -375,6 +384,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1111_2Hb_2Fa\n" ;
let m_1111_2Hb_2Fa =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
if l=i then
@ -392,6 +402,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1111_2Ha_2Fb\n" ;
let m_1111_2Ha_2Fb =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -403,6 +414,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1111_2Hb_2Fb\n" ;
let m_1111_2Hb_2Fb =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -414,6 +426,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1121_2Ha_2Fa\n" ;
let m_1121_2Ha_2Fa =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -423,6 +436,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1121_2Hb_2Fa\n" ;
let m_1121_2Hb_2Fa =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -432,6 +446,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1121_2Ha_2Fb\n" ;
let m_1121_2Ha_2Fb =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -441,6 +456,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1121_2Hb_2Fb\n" ;
let m_1121_2Hb_2Fb =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -450,6 +466,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1122_va\n" ;
let m_1122_va =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -459,6 +476,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1111_1H_2Fa\n" ;
let m_1111_1H_2Fa =
array_3_init mo_num mo_num mo_num (fun j i k ->
sum mos_in (fun l -> m_1122_va.{l,j,i,k}) +.
@ -474,6 +492,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1122_v2\n" ;
let m_1122_v2 =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -483,6 +502,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1122_v3\n" ;
let m_1122_v3 =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -492,6 +512,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1111_1H_2Fb\n" ;
let m_1111_1H_2Fb =
array_3_init mo_num mo_num mo_num (fun j i k ->
sum mos_in (fun l -> m_1122_v2.{l,j,i,k} +. m_1122_v3.{l,j,i,k}) +.
@ -508,6 +529,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1122_oa\n" ;
let m_1122_oa =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
if l > j then
@ -519,6 +541,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_1122_o\n" ;
let m_1122_o =
array_4_init mo_num mo_num mo_num mo_num (fun l j i k ->
sum mos_cabs (fun a ->
@ -607,6 +630,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
| Phase.Neg -> -. result
in
if Parallel.master then Printf.printf "Computing m_2112_1H_2Fa\n" ;
let m_2112_1H_2Fa =
array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
sum mos_cabs (fun a ->
@ -623,6 +647,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2112_1H_2Fb\n" ;
let m_2112_1H_2Fb =
array_4_init mo_num mo_num mo_num mo_num (fun i j k l ->
sum mos_cabs (fun a ->
@ -640,6 +665,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2112_2Ha_2Fa\n" ;
let m_2112_2Ha_2Fa =
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a ->
@ -649,6 +675,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2112_2Hb_2Fa\n" ;
let m_2112_2Hb_2Fa =
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a ->
@ -658,6 +685,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2112_2Ha_2Fb\n" ;
let m_2112_2Ha_2Fb =
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a ->
@ -666,6 +694,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2121_2Ha_2Fa\n" ;
let m_2121_2Ha_2Fa =
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a ->
@ -675,6 +704,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2121_2Hb_2Fa\n" ;
let m_2121_2Hb_2Fa =
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a ->
@ -684,6 +714,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2121_2Ha_2Fb\n" ;
let m_2121_2Ha_2Fb =
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a ->
@ -693,6 +724,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2122_2Ha_2Fa_ij\n" ;
let m_2122_2Ha_2Fa_ij =
let s = Spin.Alfa in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
@ -705,6 +737,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2122_2Hb_2Fb_ij\n" ;
let m_2122_2Hb_2Fb_ij =
let s, s' = Spin.(Alfa, Beta) in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
@ -716,6 +749,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2122_2Hb_2Fb_ij2\n" ;
let m_2122_2Hb_2Fb_ij2 =
let s, s' = Spin.(Alfa, Beta) in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
@ -732,6 +766,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2122_2Ha_2Fa_ij2\n" ;
let m_2122_2Ha_2Fa_ij2 =
let s, s' = Spin.(Alfa, Beta) in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
@ -744,18 +779,21 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
)
in
if Parallel.master then Printf.printf "Computing m_2122_2Ha_2Fa_nv\n" ;
let m_2122_2Ha_2Fa_nv =
let s = Spin.Alfa in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a -> h_two i j a n s s *. f_two n a k l s s ) )
in
if Parallel.master then Printf.printf "Computing m_2122_2Hb_2Fb_nv\n" ;
let m_2122_2Hb_2Fb_nv =
let s, s' = Spin.(Alfa, Beta) in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
sum mos_cabs (fun a -> -. h_two i j a n s s' *. f_two a n k l s s' ) )
in
if Parallel.master then Printf.printf "Computing m_2122_2Hb_2Fb_nv2\n" ;
let m_2122_2Hb_2Fb_nv2 =
let s, s' = Spin.(Alfa, Beta) in
array_5_init mo_num mo_num mo_num mo_num mo_num (fun n i j k l ->
@ -904,6 +942,7 @@ let make ~simulation ~mo_basis ~aux_basis_filename () =
f_0 ; f_1 ; f_2 ; f_3
}
in
if Parallel.master then Printf.printf "Broadcast f3\n" ;
Parallel.broadcast (lazy result)