mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
Optimization
This commit is contained in:
parent
9365e69488
commit
fb8fff6ee1
@ -92,8 +92,7 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
Printf.printf "vrr : %d %d : %d %d %d %d %d %d\n" totAngMom_a totAngMom_c angMom_a.(0) angMom_a.(1) angMom_a.(2) angMom_c.(0) angMom_c.(1) angMom_c.(2);
|
||||
|
||||
match (totAngMom_a, totAngMom_c) with
|
||||
| (0,0) -> zero_m_array
|
||||
| (_,0) -> vrr0 angMom_a totAngMom_a
|
||||
| (i,0) -> if (i>0) then vrr0 angMom_a totAngMom_a else zero_m_array
|
||||
| (_,_) ->
|
||||
|
||||
let maxsze = maxm+1 in
|
||||
@ -190,7 +189,6 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
in
|
||||
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) |]
|
||||
and xyz =
|
||||
|
@ -92,8 +92,10 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
|
||||
and vrr_v m angMom_a angMom_c totAngMom_a totAngMom_c =
|
||||
|
||||
match (totAngMom_a, totAngMom_c) with
|
||||
| (0,0) -> Array.mapi (fun k c -> c *. zero_m_array.(k).(m)) coef_prod
|
||||
| (_,0) -> vrr0_v m angMom_a totAngMom_a
|
||||
| (i,0) -> if (i=0) then
|
||||
Array.mapi (fun k c -> c *. zero_m_array.(k).(m)) coef_prod
|
||||
else
|
||||
vrr0_v m angMom_a totAngMom_a
|
||||
| (_,_) ->
|
||||
|
||||
let key = Zkey.of_int_tuple (Zkey.Six
|
||||
|
5
Makefile
5
Makefile
@ -38,6 +38,11 @@ doc: qpackage.odocl
|
||||
$(OCAMLBUILD) $*.native -use-ocamlfind $(PKGS)
|
||||
ln -s $*.native $*
|
||||
|
||||
%.p.native: $(MLFILES) $(MLIFILES) $(MLLFILES) $(MLYFILES)
|
||||
rm -f -- $*
|
||||
$(OCAMLBUILD) $*.p.native -use-ocamlfind $(PKGS)
|
||||
ln -s $*.p.native $*
|
||||
|
||||
clean:
|
||||
rm -rf _build $(ALL_EXE) $(ALL_TESTS) *.native *.byte
|
||||
|
||||
|
@ -23,7 +23,7 @@ let rec p_gamma a x loggamma_a =
|
||||
else if x = 0. then 0.
|
||||
else
|
||||
let rec pg_loop prev res term k =
|
||||
if k > 1000. then failwith "p_gamma could not converge."
|
||||
if k > 1000. then failwith "p_gamma did not converge."
|
||||
else if prev = res then res
|
||||
else
|
||||
let term = term *. x /. (a +. k) in
|
||||
@ -36,7 +36,7 @@ let rec p_gamma a x loggamma_a =
|
||||
if x < 1. +. a then 1. -. p_gamma a x loggamma_a
|
||||
else
|
||||
let rec qg_loop prev res la lb w k =
|
||||
if k > 1000. then failwith "q_gamma could not converge."
|
||||
if k > 1000. then failwith "q_gamma did not converge."
|
||||
else if prev = res then res
|
||||
else
|
||||
let k_inv = 1. /. k in
|
||||
@ -69,8 +69,6 @@ let rec boys_function ~maxm t =
|
||||
Array.init (maxm+1) (fun m -> 1. /. float_of_int (m+m+1))
|
||||
else
|
||||
let incomplete_gamma ~alpha x =
|
||||
(* (gamma_float alpha) *. ( Gsl.Sf.gamma_inc_P alpha x )
|
||||
*)
|
||||
let gf = gamma_float alpha in
|
||||
gf *. p_gamma alpha x (log gf)
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user