10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-08-06 20:40:12 +02:00

Merge branch 'master' of lpqlx139:/home/scemama/NewQP

This commit is contained in:
Anthony Scemama 2018-02-01 17:44:19 +01:00
commit ffc2138419
2 changed files with 40 additions and 21 deletions

View File

@ -191,28 +191,46 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
v1.(0) +. f2 *. v2.(0) v1.(0) +. f2 *. v2.(0)
| _ -> | _ ->
let ap = [| angMom_a.(0) ; angMom_a.(1) ; angMom_a.(2) |] (*
and bm = [| angMom_b.(0) ; angMom_b.(1) ; angMom_b.(2) |] let key = Zkey.of_int_tuple (Zkey.Nine (
and xyz = (angMom_a.(0)+1, angMom_a.(1)+1, angMom_a.(2)+1),
match angMom_b with (angMom_b.(0)+1, angMom_b.(1)+1, angMom_b.(2)+1),
| [|_;0;0|] -> 0 (angMom_c.(0)+1, angMom_c.(1)+1, angMom_c.(2)+1)) )
| [|_;_;0|] -> 1 in
| _ -> 2
in try (Zmap.find map key).(0) with
ap.(xyz) <- ap.(xyz) + 1; | Not_found ->
bm.(xyz) <- bm.(xyz) - 1; let result = (
if (bm.(xyz) < 0) then 0. else *)
let h1 = let ap = [| angMom_a.(0) ; angMom_a.(1) ; angMom_a.(2) |]
hrr0 ap bm angMom_c (totAngMom_a+1) (totAngMom_b-1) totAngMom_c and bm = [| angMom_b.(0) ; angMom_b.(1) ; angMom_b.(2) |]
in and xyz =
let f2 = match angMom_b with
(Coordinate.coord center_ab xyz) | [|_;0;0|] -> 0
in | [|_;_;0|] -> 1
if (abs_float f2 < cutoff) then h1 else | _ -> 2
let h2 = in
hrr0 angMom_a bm angMom_c totAngMom_a (totAngMom_b-1) totAngMom_c ap.(xyz) <- ap.(xyz) + 1;
bm.(xyz) <- bm.(xyz) - 1;
if (bm.(xyz) < 0) then 0. else
let h1 =
hrr0 ap bm angMom_c (totAngMom_a+1) (totAngMom_b-1) totAngMom_c
in
let f2 =
(Coordinate.coord center_ab xyz)
in
if (abs_float f2 < cutoff) then h1 else
let h2 =
hrr0 angMom_a bm angMom_c totAngMom_a (totAngMom_b-1) totAngMom_c
in
h1 +. f2 *. h2
(*
)
in in
h1 +. f2 *. h2 let result = [|result|] in
Zmap.add map key result;
result.(0)
*)
and hrr angMom_a angMom_b angMom_c angMom_d and hrr angMom_a angMom_b angMom_c angMom_d
totAngMom_a totAngMom_b totAngMom_c totAngMom_d = totAngMom_a totAngMom_b totAngMom_c totAngMom_d =

View File

@ -36,6 +36,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
| 1 -> let i = if angMom_a.(0) = 1 then 0 else if angMom_a.(1) = 1 then 1 else 2 | 1 -> let i = if angMom_a.(0) = 1 then 0 else if angMom_a.(1) = 1 then 1 else 2
in in
let f = expo_b *. (Coordinate.coord center_ab i) in let f = expo_b *. (Coordinate.coord center_ab i) in
if (abs_float f < cutoff) then empty else
Array.mapi (fun k c -> c *. expo_inv_p *. Array.mapi (fun k c -> c *. expo_inv_p *.
( (Coordinate.coord center_pq.(k) i) *. zero_m_array.(k).(m+1) ( (Coordinate.coord center_pq.(k) i) *. zero_m_array.(k).(m+1)
-. f *. zero_m_array.(k).(m) ) ) coef_prod -. f *. zero_m_array.(k).(m) ) ) coef_prod