10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-13 09:33:41 +01:00
QCaml/Basis/Overlap_primitives.ml

35 lines
740 B
OCaml
Raw Normal View History

2018-01-22 23:19:24 +01:00
open Util
(** Horizontal and Vertical Recurrence Relations (HVRR) *)
let hvrr (angMom_a, angMom_b) (expo_inv_p) (center_ab, center_pa)
=
(** Vertical recurrence relations *)
let rec vrr angMom_a =
if angMom_a < 0 then 0.
else if angMom_a = 0 then 1.
else
2018-02-06 16:33:28 +01:00
(chop center_pa (fun () -> vrr (angMom_a-1)))
+. chop (0.5 *. (float_of_int (angMom_a-1)) *. expo_inv_p)
2018-01-22 23:19:24 +01:00
(fun () -> vrr (angMom_a-2))
(** Horizontal recurrence relations *)
and hrr angMom_a angMom_b =
if angMom_b < 0 then 0.
else if angMom_b = 0 then vrr angMom_a
else
hrr (angMom_a+1) (angMom_b-1) +. chop center_ab
(fun () -> hrr angMom_a (angMom_b-1) )
in
hrr angMom_a angMom_b
let overlap = hvrr