2018-03-08 23:29:08 +01:00
|
|
|
(** General basis set read from a file.
|
|
|
|
|
|
|
|
Basis set files are stored in GAMESS format, for example:
|
|
|
|
{[
|
|
|
|
HYDROGEN
|
|
|
|
S 3
|
|
|
|
1 13.0100000 0.0196850
|
|
|
|
2 1.9620000 0.1379770
|
|
|
|
3 0.4446000 0.4781480
|
|
|
|
S 1
|
|
|
|
1 0.1220000 1.0000000
|
|
|
|
P 1
|
|
|
|
1 0.7270000 1.0000000
|
|
|
|
|
|
|
|
HELIUM
|
|
|
|
S 3
|
|
|
|
1 38.3600000 0.0238090
|
|
|
|
2 5.7700000 0.1548910
|
|
|
|
3 1.2400000 0.4699870
|
|
|
|
S 1
|
|
|
|
1 0.2976000 1.0000000
|
|
|
|
P 1
|
|
|
|
1 1.2750000 1.0000000
|
|
|
|
]}
|
|
|
|
|
|
|
|
When building the atomic basis set of a molecular system, the basis functions
|
|
|
|
are created by picking the data from the general basis set. This data structure
|
|
|
|
simplifies the creation of the atomic basis set.
|
|
|
|
*)
|
|
|
|
|
2020-10-09 09:47:57 +02:00
|
|
|
open Common
|
|
|
|
open Particles
|
2020-09-26 12:02:53 +02:00
|
|
|
|
2018-03-08 23:29:08 +01:00
|
|
|
type primitive = private
|
|
|
|
{
|
|
|
|
exponent : float ;
|
|
|
|
coefficient: float ;
|
|
|
|
}
|
|
|
|
|
2020-09-26 12:02:53 +02:00
|
|
|
type general_contracted_shell = Angular_momentum.t * (primitive array)
|
2018-03-08 23:29:08 +01:00
|
|
|
|
|
|
|
type element_basis = Element.t * (general_contracted_shell array)
|
|
|
|
|
|
|
|
type t = element_basis list
|
|
|
|
|
|
|
|
|
|
|
|
exception No_shell
|
|
|
|
exception Malformed_shell of string
|
|
|
|
|
|
|
|
|
|
|
|
val read : string -> t
|
2020-04-16 19:49:23 +02:00
|
|
|
(** Reads a basis-set file and return an association list where
|
2018-03-08 23:29:08 +01:00
|
|
|
the key is an {!Element.t} and the value is the parsed basis set.
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
2019-03-21 00:44:10 +01:00
|
|
|
val combine : t list -> t
|
|
|
|
(** Combines the basis functions of each element among different basis sets.
|
|
|
|
Used to complement a basis with an auxiliary basis set.
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
2019-03-20 19:18:36 +01:00
|
|
|
val read_many : string list -> t
|
|
|
|
(** Reads multiple basis set files and return an association list where
|
|
|
|
the key is an {!Element.t} and the value is the parsed basis set.
|
|
|
|
This function is usually used to add an auxiliary basis set.
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
2019-03-21 00:44:10 +01:00
|
|
|
|
2020-04-16 19:49:23 +02:00
|
|
|
val read_element : string Stream.t -> element_basis option
|
|
|
|
(** Reads an element from the input [string Stream]. The [string Stream] is a
|
|
|
|
stream of lines, like a text file split on the end-of-line character.
|
|
|
|
For example,
|
2018-03-08 23:29:08 +01:00
|
|
|
{[
|
|
|
|
HYDROGEN
|
|
|
|
S 3
|
|
|
|
1 13.0100000 0.0196850
|
|
|
|
2 1.9620000 0.1379770
|
|
|
|
3 0.4446000 0.4781480
|
|
|
|
S 1
|
|
|
|
1 0.1220000 1.0000000
|
|
|
|
P 1
|
|
|
|
1 0.7270000 1.0000000
|
|
|
|
|
|
|
|
}]
|
|
|
|
returns
|
|
|
|
{[
|
|
|
|
Some
|
|
|
|
(Element.H,
|
2020-09-26 12:02:53 +02:00
|
|
|
[(Angular_momentum.S,
|
2018-03-08 23:29:08 +01:00
|
|
|
[{exponent = 13.01; coefficient = 0.019685};
|
|
|
|
{exponent = 1.962; coefficient = 0.137977};
|
|
|
|
{exponent = 0.4446; coefficient = 0.478148}]);
|
2020-09-26 12:02:53 +02:00
|
|
|
(Angular_momentum.S, [{exponent = 0.122; coefficient = 1.}]);
|
|
|
|
(Angular_momentum.P, [{exponent = 0.727; coefficient = 1.}])])
|
2018-03-08 23:29:08 +01:00
|
|
|
]}
|
|
|
|
|
|
|
|
@raise Malformed_shell if the input is not well formed.
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
2020-04-16 19:49:23 +02:00
|
|
|
val read_shell : string Stream.t -> general_contracted_shell option
|
|
|
|
(** Reads a shell from the input [string Stream]. The [string Stream] is a
|
|
|
|
stream of lines, like a text file split on the end-of-line character.
|
|
|
|
For example,
|
2018-03-08 23:29:08 +01:00
|
|
|
{[
|
|
|
|
S 3
|
|
|
|
1 13.0100000 0.0196850
|
|
|
|
2 1.9620000 0.1379770
|
|
|
|
3 0.4446000 0.4781480
|
|
|
|
]}
|
|
|
|
returns
|
|
|
|
{[
|
|
|
|
Some
|
2020-09-26 12:02:53 +02:00
|
|
|
(Angular_momentum.S,
|
2018-03-08 23:29:08 +01:00
|
|
|
[{exponent = 13.01 ; coefficient = 0.019685};
|
|
|
|
{exponent = 1.962 ; coefficient = 0.137977};
|
|
|
|
{exponent = 0.4446; coefficient = 0.478148}])
|
|
|
|
]}
|
|
|
|
|
|
|
|
@raise Malformed_shell if the input is not well formed.
|
|
|
|
*)
|
|
|
|
|
|
|
|
|
|
|
|
val to_string : string * (general_contracted_shell array) -> string
|
|
|
|
(** Pretty-prints the basis set of an {Element.t}. *)
|
|
|
|
|
2020-04-16 19:49:23 +02:00
|
|
|
val of_string : string -> t
|
|
|
|
(** Reads a GAMESS-formatted string. *)
|
2018-03-08 23:29:08 +01:00
|
|
|
|
2020-10-08 11:42:33 +02:00
|
|
|
|
|
|
|
(** Pretty printers *)
|
|
|
|
|
|
|
|
val pp_primitive : Format.formatter -> primitive -> unit
|
|
|
|
val pp_gcs : Format.formatter -> general_contracted_shell -> unit
|
|
|
|
val pp_element_basis : Format.formatter -> element_basis -> unit
|
|
|
|
|
|
|
|
val pp : Format.formatter -> t -> unit
|