10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2025-01-03 01:55:40 +01:00

Added string read of basis

This commit is contained in:
Anthony Scemama 2024-09-06 11:05:54 +02:00
parent cf10825862
commit 51f216da90
2 changed files with 43 additions and 0 deletions

View File

@ -14,6 +14,20 @@ let not_implemented () =
Util.not_implemented "Only Gaussian is implemented"
let of_nuclei_and_basis_string ?(kind=`Gaussian) ?operators ?(cartesian=false)
~nuclei filename =
match kind with
| `Gaussian ->
let basis =
Gaussian.Basis.of_nuclei_and_basis_string ~nuclei filename
in
let ao_basis =
Basis_poly.Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
in
{ ao_basis ; cartesian }
| _ -> not_implemented ()
let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
~nuclei filename =
match kind with

View File

@ -33,6 +33,35 @@ val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
*)
val of_nuclei_and_basis_string :
?kind:[> `Gaussian ] ->
?operators:Operator.t list ->
?cartesian:bool ->
nuclei:Nuclei.t ->
string -> t
(** Creates the data structure for the atomic orbitals basis from a
molecule ~Nuclei.t~ and a basis-set string.
Defaults:
- ~kind~ : ~`Gaussian~
- ~operators~ : ~[]~
- ~cartesian~ : ~false~
Example:
#+begin_example
let b = Ao.Basis.of_nuclei_and_basis_string ~nuclei "
HYDROGEN
S 1
1 0.0395061728 1.00000000
"
;;
val b : Ao.Basis.t = Gaussian Basis, spherical, 1 AOs
#+end_example
*)
(** Access *)
val size : t -> int