10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-06 22:23:42 +01:00
QCaml/ao/lib/basis.ml
2021-01-01 16:39:33 +01:00

120 lines
2.7 KiB
OCaml

open Linear_algebra
open Common
type t =
{ ao_basis : Basis_poly.t ;
cartesian : bool
}
type ao = Ao_dim.t
let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
~nuclei filename =
match kind with
| `Gaussian ->
let basis =
Gaussian.Basis.of_nuclei_and_basis_filename ~nuclei filename
in
let ao_basis =
Basis_poly.Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
in
{ ao_basis ; cartesian }
| _ -> failwith "of_nuclei_and_basis_filename needs to be called with `Gaussian"
let not_implemented () =
Util.not_implemented "Only Gaussian is implemented"
let ao_basis t = t.ao_basis
let size t =
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.size b
| _ -> not_implemented ()
let overlap t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.overlap b
| _ -> not_implemented ()
end
|> Matrix.relabel
let multipole t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b ->
let m = Basis_gaussian.multipole b in
fun s ->
Gaussian_integrals.Multipole.matrix m s
|> Matrix.relabel
| _ -> not_implemented ()
end
let ortho t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.ortho b
| _ -> not_implemented ()
end
|> Matrix.relabel
let eN_ints t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.eN_ints b
| _ -> not_implemented ()
end
|> Matrix.relabel
let kin_ints t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.kin_ints b
| _ -> not_implemented ()
end
|> Matrix.relabel
let ee_ints t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.ee_ints b
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let ee_lr_ints t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.ee_lr_ints b
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_ints t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.f12_ints b
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_over_r12_ints t =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.f12_over_r12_ints b
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let cartesian t = t.cartesian
let values t point =
begin
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.values b point
| _ -> not_implemented ()
end
|> Vector.relabel