10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 14:43:41 +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 Constants
open Util open Util
module Zm = struct module Zm = struct
let name = "Electron repulsion integrals" let name = "Electron repulsion integrals"
let zero_m ~maxm ~expo_p_inv ~expo_q_inv ~norm_pq_sq = open Zero_m_parameters
let expo_pq_inv = expo_p_inv +. expo_q_inv in
let zero_m z =
let expo_pq_inv = z.expo_p_inv +. z.expo_q_inv in
assert (expo_pq_inv <> 0.); 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 exp_pq = 1. /. expo_pq_inv in
let t = norm_pq_sq *. exp_pq in let t =
let f = two_over_sq_pi *. (sqrt exp_pq) in 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 result = boys_function ~maxm t in
let rec aux accu k = function let rec aux accu k = function
| 0 -> result.(k) <- result.(k) *. accu | 0 -> result.(k) <- result.(k) *. accu
@ -26,6 +31,7 @@ module Zm = struct
aux new_accu (k+1) (l-1) aux new_accu (k+1) (l-1)
end end
in in
let f = two_over_sq_pi *. (sqrt exp_pq) in
aux f 0 maxm; aux f 0 maxm;
result result

View File

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

View File

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

View File

@ -11,6 +11,7 @@ module Po = Powers
module Psp = PrimitiveShellPair module Psp = PrimitiveShellPair
module Pspc = PrimitiveShellPairCouple module Pspc = PrimitiveShellPairCouple
module Ps = PrimitiveShell module Ps = PrimitiveShell
module Zp = Zero_m_parameters
let cutoff = Constants.integrals_cutoff let cutoff = Constants.integrals_cutoff
let cutoff2 = cutoff *. 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 expo_q_inv = Psp.exponent_inv sp_cd in
let zero_m_array = 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 in
begin 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 expo_q_inv = Psp.exponent_inv sp_cd in
let zero_m_array = 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 in
begin begin

View File

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