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

118 lines
2.5 KiB
OCaml
Raw Normal View History

2020-10-09 09:47:57 +02:00
open Linear_algebra
2020-10-07 17:54:15 +02:00
2020-10-02 23:35:56 +02:00
type basis =
| Unknown
2020-10-09 09:38:52 +02:00
| Gaussian of Basis_gaussian.t
2020-10-02 23:35:56 +02:00
type t =
2020-10-07 17:54:15 +02:00
{ ao_basis : basis ;
2020-10-02 23:35:56 +02:00
cartesian : bool
}
2020-10-07 17:54:15 +02:00
let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
~nuclei filename =
match kind with
| `Gaussian ->
let basis =
2020-10-09 09:47:57 +02:00
Gaussian_basis.Basis.of_nuclei_and_basis_filename ~nuclei filename
2020-10-07 17:54:15 +02:00
in
let ao_basis =
2020-10-09 09:38:52 +02:00
Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
2020-10-07 17:54:15 +02:00
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
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.size b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
let overlap t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.overlap b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Matrix.relabel
let multipole t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.multipole b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Array.map Matrix.relabel
let ortho t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.ortho b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Matrix.relabel
let eN_ints t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.eN_ints b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Matrix.relabel
let kin_ints t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.kin_ints b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Matrix.relabel
let ee_ints t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.ee_ints b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let ee_lr_ints t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.ee_lr_ints b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_ints t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.f12_ints b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_over_r12_ints t =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.f12_over_r12_ints b
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let cartesian t = t.cartesian
let values t point =
begin
match t.ao_basis with
2020-10-09 09:38:52 +02:00
| Gaussian b -> Basis_gaussian.values b point
2020-10-07 17:54:15 +02:00
| _ -> not_implemented ()
end
|> Vector.relabel