diff --git a/Basis/AOBasis.ml b/Basis/AOBasis.ml index 4499393..4cfd51f 100644 --- a/Basis/AOBasis.ml +++ b/Basis/AOBasis.ml @@ -28,6 +28,19 @@ let f12_ints t = Lazy.force t.f12_ints let f12_over_r12_ints t = Lazy.force t.f12_over_r12_ints let cartesian t = t.cartesian +module Am = AngularMomentum +module Cs = ContractedShell + +let values t point = + let result = Vec.create (Basis.size t.basis) in + Array.iter (fun shell -> + Cs.values shell point + |> Array.iteri + (fun i_c value -> + let i = Cs.index shell + i_c + 1 in + result.{i} <- value) + ) (Basis.contracted_shells t.basis); + result let make ~cartesian ~basis ?f12 nuclei = @@ -78,13 +91,13 @@ let test_case name t = let check_matrix title a r = let a = Mat.to_array a in - Mat.to_array r + Mat.to_array r |> Array.iteri (fun i x -> let message = Printf.sprintf "%s line %d" title i in Alcotest.(check (array (float 1.e-10))) message a.(i) x - ) + ) in let check_eri title a r = diff --git a/Basis/AOBasis.mli b/Basis/AOBasis.mli index d00131b..853aa6b 100644 --- a/Basis/AOBasis.mli +++ b/Basis/AOBasis.mli @@ -1,5 +1,7 @@ (** Data structure for Atomic Orbitals. *) +open Lacaml.D + type t (** {1 Accessors} *) @@ -34,6 +36,10 @@ val kin_ints : t -> KinInt.t val cartesian : t -> bool (** If true, use cartesian Gaussians (6d, 10f, ...) *) +val values : t -> Coordinate.t -> Vec.t +(** Values of the AOs evaluated at a given point *) + + (** {1 Creators} *)