10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-18 20:12:26 +01:00
QCaml/ao/lib/basis.ml

118 lines
2.5 KiB
OCaml

open Linear_algebra
type basis =
| Unknown
| Gaussian of Basis_gaussian.t
type t =
{ ao_basis : basis ;
cartesian : bool
}
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 =
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 () =
failwith "Not implemented"
let ao_basis t = t.ao_basis
let size t =
match t.ao_basis with
| Gaussian b -> Basis_gaussian.size b
| _ -> not_implemented ()
let overlap t =
begin
match t.ao_basis with
| Gaussian b -> Basis_gaussian.overlap b
| _ -> not_implemented ()
end
|> Matrix.relabel
let multipole t =
begin
match t.ao_basis with
| Gaussian b -> Basis_gaussian.multipole b
| _ -> not_implemented ()
end
|> Array.map Matrix.relabel
let ortho t =
begin
match t.ao_basis with
| Gaussian b -> Basis_gaussian.ortho b
| _ -> not_implemented ()
end
|> Matrix.relabel
let eN_ints t =
begin
match t.ao_basis with
| Gaussian b -> Basis_gaussian.eN_ints b
| _ -> not_implemented ()
end
|> Matrix.relabel
let kin_ints t =
begin
match t.ao_basis with
| Gaussian b -> Basis_gaussian.kin_ints b
| _ -> not_implemented ()
end
|> Matrix.relabel
let ee_ints t =
begin
match t.ao_basis with
| 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
| 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
| 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
| 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
| Gaussian b -> Basis_gaussian.values b point
| _ -> not_implemented ()
end
|> Vector.relabel