mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
Cleaning in ERI
This commit is contained in:
parent
5fd94119f6
commit
0207cc7497
@ -32,7 +32,6 @@ let rec hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
let maxm = angMom_a.tot + angMom_b.tot + angMom_c.tot + angMom_d.tot in
|
||||
let maxsze = maxm+1 in
|
||||
|
||||
let empty = Array.make (maxm+1) 0. in
|
||||
|
||||
let get_xyz angMom =
|
||||
match angMom with
|
||||
@ -57,12 +56,11 @@ let rec hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
let am = Powers.decr xyz angMom_a in
|
||||
let amxyz = Powers.get xyz am in
|
||||
|
||||
if amxyz >= 0 then
|
||||
let f1 = expo_inv_p *. (Coordinate.get xyz center_pq)
|
||||
and f2 = expo_b *. expo_inv_p *. (Coordinate.get xyz center_ab)
|
||||
in
|
||||
let result = Array.create_float maxsze in
|
||||
if amxyz < 1 then
|
||||
if amxyz = 0 then
|
||||
begin
|
||||
let v1 =
|
||||
vrr0 am
|
||||
@ -85,8 +83,6 @@ let rec hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
result.(maxm) <- f3 *. v3.(maxm)
|
||||
end;
|
||||
result
|
||||
else
|
||||
empty
|
||||
in Zmap.add map_1d key result;
|
||||
result
|
||||
|
||||
@ -102,12 +98,12 @@ let rec hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
try Zmap.find map_2d key with
|
||||
| Not_found ->
|
||||
let result =
|
||||
(* Invariant : angMom_c.tot > 0 so cm.tot >= 0 *)
|
||||
let xyz = get_xyz angMom_c in
|
||||
let cm = Powers.decr xyz angMom_c in
|
||||
let cmxyz = Powers.get xyz cm in
|
||||
let axyz = Powers.get xyz angMom_a in
|
||||
|
||||
if cmxyz >= 0 then
|
||||
let f1 =
|
||||
-. expo_d *. expo_inv_q *. (Coordinate.get xyz center_cd)
|
||||
and f2 =
|
||||
@ -143,7 +139,7 @@ let rec hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
result.(maxm) <- result.(maxm) +. f3 *. v3.(maxm)
|
||||
end
|
||||
end;
|
||||
if axyz > 0 && cmxyz >= 0 then
|
||||
if axyz > 0 then
|
||||
begin
|
||||
let am = Powers.decr xyz angMom_a in
|
||||
let f5 =
|
||||
@ -158,12 +154,28 @@ let rec hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
done
|
||||
end;
|
||||
result
|
||||
else
|
||||
empty
|
||||
in Zmap.add map_2d key result;
|
||||
result
|
||||
|
||||
|
||||
(*
|
||||
and trr angMom_a angMom_c =
|
||||
|
||||
match (angMom_a.tot, angMom_c.tot) with
|
||||
| (i,0) -> if (i>0) then vrr0 angMom_a
|
||||
else zero_m_array
|
||||
| (_,_) ->
|
||||
let key = Zkey.of_powers (Zkey.Six (angMom_a, angMom_c)) in
|
||||
|
||||
try Zmap.find map_2d key with
|
||||
| Not_found ->
|
||||
let result =
|
||||
let xyz = get_xyz angMom_c in
|
||||
let cm = Powers.decr xyz angMom_c in
|
||||
let cmxyz = Powers.get xyz cm in
|
||||
let axyz = Powers.get xyz angMom_a in
|
||||
*)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
(** Vertical recurrence relations *)
|
||||
let rec vrr0_v m angMom_a =
|
||||
match angMom_a.tot with
|
||||
| 0 -> Some zero_m_array.(m)
|
||||
| 0 -> zero_m_array.(m)
|
||||
| _ ->
|
||||
let key = Zkey.of_powers (Zkey.Three angMom_a)
|
||||
in
|
||||
@ -45,33 +45,13 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
let result =
|
||||
let xyz = get_xyz angMom_a in
|
||||
let am = Powers.decr xyz angMom_a in
|
||||
let amxyz = Powers.get xyz am in
|
||||
if amxyz >= 0 then
|
||||
begin
|
||||
let cab = Coordinate.get xyz center_ab in
|
||||
let v1_top, p1_top =
|
||||
if abs_float cab < cutoff then
|
||||
None,
|
||||
vrr0_v (m+1) am
|
||||
else
|
||||
vrr0_v m am, vrr0_v (m+1) am
|
||||
in
|
||||
let v1_top2, p1_top2 =
|
||||
if amxyz < 1 then None, None else
|
||||
let amm = Powers.decr xyz am in
|
||||
vrr0_v m amm, vrr0_v (m+1) amm
|
||||
in
|
||||
let p0 = vrr0_v (m+1) am in
|
||||
|
||||
let result = Array.make_matrix np nq 0. in
|
||||
let p0 =
|
||||
match p1_top with
|
||||
| Some p1_top -> p1_top
|
||||
| _ -> assert false
|
||||
in
|
||||
begin
|
||||
match v1_top with
|
||||
| None -> ()
|
||||
| Some v0 ->
|
||||
if abs_float cab >= cutoff then
|
||||
let v0 = vrr0_v m am in
|
||||
Array.iteri (fun l result_l ->
|
||||
let f0 = -. expo_b.(l) *. expo_inv_p.(l) *. cab
|
||||
and v0_l = v0.(l)
|
||||
@ -93,18 +73,12 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
) p0_l ) result
|
||||
else
|
||||
begin
|
||||
let v1 =
|
||||
match v1_top2 with
|
||||
| Some v1_top2 -> v1_top2
|
||||
| None -> assert false
|
||||
in
|
||||
let v2 =
|
||||
match p1_top2 with
|
||||
| Some p1_top2 -> p1_top2
|
||||
| None -> assert false
|
||||
in
|
||||
let amm = Powers.decr xyz am in
|
||||
let v1 = vrr0_v m amm in
|
||||
let v2 = vrr0_v (m+1) amm in
|
||||
let amxyz = float_of_int amxyz in
|
||||
Array.iteri (fun l result_l ->
|
||||
let f = float_of_int amxyz *. expo_inv_p.(l) *. 0.5
|
||||
let f = amxyz *. expo_inv_p.(l) *. 0.5
|
||||
and expo_inv_p_l = expo_inv_p.(l)
|
||||
and center_pq_xyz_l = (center_pq xyz).(l)
|
||||
and v1_l = v1.(l)
|
||||
@ -118,10 +92,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
) p0.(l)
|
||||
) result
|
||||
end;
|
||||
Some result
|
||||
end
|
||||
else
|
||||
None
|
||||
result
|
||||
in
|
||||
Zmap.add map_1d.(m) key result;
|
||||
result
|
||||
@ -129,7 +100,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
and vrr_v m angMom_a angMom_c =
|
||||
|
||||
match (angMom_a.tot, angMom_c.tot) with
|
||||
| (i,0) -> vrr0_v m angMom_a
|
||||
| (i,0) -> Some (vrr0_v m angMom_a)
|
||||
| (_,_) ->
|
||||
|
||||
let key = Zkey.of_powers (Zkey.Six (angMom_a, angMom_c))
|
||||
|
Loading…
Reference in New Issue
Block a user