mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-06-02 03:15:19 +02:00
37 lines
871 B
OCaml
37 lines
871 B
OCaml
(** Electron-electron repulsion integrals *)
|
|
|
|
open Constants
|
|
open Util
|
|
|
|
module Zm = struct
|
|
|
|
let name = "Electron repulsion integrals"
|
|
|
|
let zero_m ~maxm ~expo_p_inv ~expo_q_inv ~norm_pq_sq =
|
|
let expo_pq_inv = expo_p_inv +. expo_q_inv in
|
|
assert (expo_pq_inv <> 0.);
|
|
let norm_pq_sq =
|
|
if norm_pq_sq > integrals_cutoff then norm_pq_sq else 0.
|
|
in
|
|
let exp_pq = 1. /. expo_pq_inv in
|
|
let t = norm_pq_sq *. exp_pq in
|
|
let f = two_over_sq_pi *. (sqrt exp_pq) in
|
|
let result = boys_function ~maxm t in
|
|
let rec aux accu k = function
|
|
| 0 -> result.(k) <- result.(k) *. accu
|
|
| l ->
|
|
begin
|
|
result.(k) <- result.(k) *. accu;
|
|
let new_accu = -. accu *. exp_pq in
|
|
aux new_accu (k+1) (l-1)
|
|
end
|
|
in
|
|
aux f 0 maxm;
|
|
result
|
|
|
|
end
|
|
|
|
module M = TwoElectronIntegrals.Make(Zm)
|
|
include M
|
|
|