diff --git a/Basis/TwoElectronRR.ml b/Basis/TwoElectronRR.ml index 180b4fb..a5bc679 100644 --- a/Basis/TwoElectronRR.ml +++ b/Basis/TwoElectronRR.ml @@ -63,20 +63,23 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d) | (x,y,z) -> (x,y,z-1),(x,y,z-2), z-1, 2 in if amxyz < 0 then empty else - let v1 = - vrr0 am (totAngMom_a-1) - in let f1 = expo_inv_p *. (Coordinate.coord center_pq xyz) and f2 = expo_b *. expo_inv_p *. (Coordinate.coord center_ab xyz) in if amxyz < 1 then + let v1 = + vrr0 am (totAngMom_a-1) + in Array.init maxsze (fun m -> if m = maxm then 0. else (f1 *. v1.(m+1) ) -. f2 *. v1.(m) ) else - let f3 = (float_of_int amxyz) *. expo_inv_p *. 0.5 in let v3 = vrr0 amm (totAngMom_a-2) in + let v1 = + vrr0 am (totAngMom_a-1) + in + let f3 = (float_of_int amxyz) *. expo_inv_p *. 0.5 in Array.init maxsze (fun m -> (if m = maxm then 0. else (f1 *. v1.(m+1) ) -. f2 *. v1.(m) ) @@ -132,12 +135,13 @@ let hvrr_two_e (angMom_a, angMom_b, angMom_c, angMom_d) let f2 = expo_inv_q *. (Coordinate.coord center_pq xyz) in + let result = empty in let result = - if ( (abs_float f1 < cutoff) && (abs_float f2 < cutoff) ) then empty else + if ( (abs_float f1 < cutoff) && (abs_float f2 < cutoff) ) then result else let v1 = vrr angMom_a cm totAngMom_a (totAngMom_c-1) in - Array.init maxsze (fun m -> + Array.init maxsze (fun m -> result.(m) +. f1 *. v1.(m) -. (if m = maxm then 0. else f2 *. v1.(m+1)) ) in let result =