mirror of
https://gitlab.com/scemama/QCaml.git
synced 2025-01-03 01:55:40 +01:00
private type
This commit is contained in:
parent
fe3fcd7a12
commit
a892f2f125
@ -18,7 +18,7 @@ let of_nuclei_and_general_basis n b =
|
|||||||
and coef = Array.map (fun General_basis.{exponent ; coefficient} ->
|
and coef = Array.map (fun General_basis.{exponent ; coefficient} ->
|
||||||
coefficient) shell
|
coefficient) shell
|
||||||
in
|
in
|
||||||
Contracted_shell.create ~expo ~coef ~totAngMom ~center ~index:0)
|
Contracted_shell.make ~expo ~coef ~totAngMom ~center ~index:0)
|
||||||
) n
|
) n
|
||||||
|> Array.to_list
|
|> Array.to_list
|
||||||
|> Array.concat
|
|> Array.concat
|
||||||
|
@ -1,17 +1,8 @@
|
|||||||
open Util
|
open Util
|
||||||
open Constants
|
open Constants
|
||||||
|
open Contracted_shell_type
|
||||||
|
|
||||||
type t = {
|
type t = Contracted_shell_type.t
|
||||||
expo : float array;
|
|
||||||
coef : float array;
|
|
||||||
center : Coordinate.t;
|
|
||||||
totAngMom : Angular_momentum.t;
|
|
||||||
size : int;
|
|
||||||
norm_coef : float array;
|
|
||||||
norm_coef_scale : float array;
|
|
||||||
index : int;
|
|
||||||
powers : Zkey.t array;
|
|
||||||
}
|
|
||||||
|
|
||||||
let size a = a.size
|
let size a = a.size
|
||||||
let expo a i = a.expo.(i)
|
let expo a i = a.expo.(i)
|
||||||
@ -21,10 +12,9 @@ let totAngMom a = a.totAngMom
|
|||||||
let norm_coef a i = a.norm_coef.(i)
|
let norm_coef a i = a.norm_coef.(i)
|
||||||
let norm_coef_scale a = a.norm_coef_scale
|
let norm_coef_scale a = a.norm_coef_scale
|
||||||
let index a = a.index
|
let index a = a.index
|
||||||
let with_index a i = { a with index = i }
|
let with_index = Contracted_shell_type.with_index
|
||||||
let powers a = a.powers
|
let powers a = a.powers
|
||||||
|
|
||||||
|
|
||||||
let to_string s =
|
let to_string s =
|
||||||
let coord =
|
let coord =
|
||||||
Coordinate.to_Bohr s.center
|
Coordinate.to_Bohr s.center
|
||||||
@ -72,24 +62,5 @@ let compute_norm_coef expo totAngMom =
|
|||||||
Array.map (fun x -> let f a = x *. (factor a) in f) expo
|
Array.map (fun x -> let f a = x *. (factor a) in f) expo
|
||||||
|
|
||||||
|
|
||||||
let create ~index ~expo ~coef ~center ~totAngMom =
|
let make = Contracted_shell_type.make
|
||||||
assert (Array.length expo = Array.length coef);
|
|
||||||
assert (Array.length expo > 0);
|
|
||||||
let norm_coef_func =
|
|
||||||
compute_norm_coef expo totAngMom
|
|
||||||
in
|
|
||||||
let powers =
|
|
||||||
Angular_momentum.zkey_array (Angular_momentum.Singlet totAngMom)
|
|
||||||
in
|
|
||||||
let norm_coef =
|
|
||||||
Array.map (fun f -> f [| Angular_momentum.to_int totAngMom ; 0 ; 0 |]) norm_coef_func
|
|
||||||
in
|
|
||||||
let norm_coef_scale =
|
|
||||||
Array.map (fun a ->
|
|
||||||
(norm_coef_func.(0) (Zkey.to_int_array ~kind:Zkey.Kind_3 a)) /. norm_coef.(0)
|
|
||||||
) powers
|
|
||||||
in
|
|
||||||
{ index ; expo ; coef ; center ; totAngMom ; size=Array.length expo ; norm_coef ;
|
|
||||||
norm_coef_scale ; powers }
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
type t
|
type t = Contracted_shell_type.t
|
||||||
|
|
||||||
|
|
||||||
(** Returns the number of contracted Gaussians *)
|
(** Returns the number of contracted Gaussians *)
|
||||||
@ -46,7 +46,7 @@ val powers : t -> Zkey.t array
|
|||||||
val to_string : t -> string
|
val to_string : t -> string
|
||||||
|
|
||||||
(** Creates a contracted shell *)
|
(** Creates a contracted shell *)
|
||||||
val create :
|
val make :
|
||||||
index:int ->
|
index:int ->
|
||||||
expo:float array ->
|
expo:float array ->
|
||||||
coef:float array ->
|
coef:float array ->
|
||||||
|
@ -4,9 +4,11 @@ let of_float x =
|
|||||||
assert ( x >= 0. );
|
assert ( x >= 0. );
|
||||||
x
|
x
|
||||||
|
|
||||||
let to_float x = x
|
external to_float : t -> float = "%identity"
|
||||||
|
|
||||||
let to_string x = string_of_float @@ to_float x
|
let to_string x =
|
||||||
|
let f = to_float x in string_of_float f
|
||||||
|
|
||||||
let of_string x = of_float @@ float_of_string x
|
let of_string x =
|
||||||
|
let f = float_of_string x in of_float f
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
type t
|
type t = private float
|
||||||
val of_float : float -> t
|
val of_float : float -> t
|
||||||
val to_float : t -> float
|
val to_float : t -> float
|
||||||
val to_string : t -> string
|
val to_string : t -> string
|
||||||
|
Loading…
Reference in New Issue
Block a user