10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 06:33:39 +01:00

Added Zero_m_parameters

This commit is contained in:
Anthony Scemama 2019-03-12 14:07:59 +01:00
parent 8bfee5f8cf
commit 56839c3332
6 changed files with 44 additions and 15 deletions

View File

@ -3,19 +3,24 @@
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
open Zero_m_parameters
let zero_m z =
let expo_pq_inv = z.expo_p_inv +. z.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 t =
if z.norm_pq_sq > integrals_cutoff then
z.norm_pq_sq *. exp_pq
else 0.
in
let maxm = z.maxm in
let result = boys_function ~maxm t in
let rec aux accu k = function
| 0 -> result.(k) <- result.(k) *. accu
@ -26,6 +31,7 @@ module Zm = struct
aux new_accu (k+1) (l-1)
end
in
let f = two_over_sq_pi *. (sqrt exp_pq) in
aux f 0 maxm;
result

View File

@ -17,8 +17,7 @@ module Fis = FourIdxStorage
module type Zero_mType =
sig
val name : string
val zero_m : maxm:int -> expo_p_inv:float -> expo_q_inv:float ->
norm_pq_sq:float -> float array
val zero_m : Zero_m_parameters.t -> float array
end

View File

@ -11,8 +11,7 @@ module type Zero_mType =
val name : string
(** Name of the kind of integrals, for printing purposes. *)
val zero_m : maxm:int -> expo_p_inv:float -> expo_q_inv:float ->
norm_pq_sq:float -> float array
val zero_m : Zero_m_parameters.t -> float array
(** The returned float array contains all the {% $(00|00)^m$ %} values, where
[m] is the index of the array.

View File

@ -11,6 +11,7 @@ module Po = Powers
module Psp = PrimitiveShellPair
module Pspc = PrimitiveShellPairCouple
module Ps = PrimitiveShell
module Zp = Zero_m_parameters
let cutoff = Constants.integrals_cutoff
let cutoff2 = cutoff *. cutoff
@ -340,7 +341,9 @@ let contracted_class_shell_pair_couple ~zero_m shell_pair_couple : float Zmap.t
let expo_q_inv = Psp.exponent_inv sp_cd in
let zero_m_array =
zero_m ~maxm ~expo_p_inv ~expo_q_inv ~norm_pq_sq
Zp.{
maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq
} |> zero_m
in
begin
@ -451,7 +454,9 @@ let contracted_class_atomic_shell_pair_couple ~zero_m atomic_shell_pair_couple :
let expo_q_inv = Psp.exponent_inv sp_cd in
let zero_m_array =
zero_m ~maxm ~expo_p_inv ~expo_q_inv ~norm_pq_sq
Zp.{
maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq
} |> zero_m
in
begin

View File

@ -10,6 +10,7 @@ module Cspc = ContractedShellPairCouple
module Po = Powers
module Psp = PrimitiveShellPair
module Ps = PrimitiveShell
module Zp = Zero_m_parameters
exception NullQuartet
exception Found
@ -648,7 +649,9 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
in
let zero_m_array =
zero_m ~maxm:0 ~expo_p_inv ~expo_q_inv ~norm_pq_sq
Zp.{
maxm=0 ; expo_p_inv ; expo_q_inv ; norm_pq_sq
} |> zero_m
in
zero_m_array.(0)
with NullQuartet -> 0.
@ -761,7 +764,9 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
x *. x +. y *. y +. z *. z
in
zero_m ~maxm ~expo_p_inv ~expo_q_inv ~norm_pq_sq
Zp.{
maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq
} |> zero_m
) sq
in
(* Transpose result *)

View File

@ -0,0 +1,15 @@
type t =
{
expo_p_inv : float ;
expo_q_inv : float ;
norm_pq_sq : float ;
maxm : int;
}
let zero =
{
maxm=0 ;
expo_p_inv = 0.;
expo_q_inv = 0.;
norm_pq_sq = 0.;
}