diff --git a/ao/lib/basis.ml b/ao/lib/basis.ml index d1faf93..c464c2d 100644 --- a/ao/lib/basis.ml +++ b/ao/lib/basis.ml @@ -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 diff --git a/ao/lib/basis.mli b/ao/lib/basis.mli index c632d5e..7b714e1 100644 --- a/ao/lib/basis.mli +++ b/ao/lib/basis.mli @@ -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