10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-06-20 04:02:07 +02:00
QCaml/Basis/Basis.ml

40 lines
1.1 KiB
OCaml
Raw Normal View History

2018-01-18 00:21:05 +01:00
type t
2018-01-18 17:39:10 +01:00
(** Returns an array of the basis set per atom *)
2018-01-18 00:21:05 +01:00
let of_nuclei_and_general_basis n b =
Array.map (fun (e, center) ->
List.assoc e b
|> Array.map (fun (totAngMom, shell) ->
let expo = Array.map (fun General_basis.{exponent ; coefficient} ->
exponent) shell
and coef = Array.map (fun General_basis.{exponent ; coefficient} ->
coefficient) shell
in
Contracted_shell.create ~expo ~coef ~totAngMom ~center)
) n
let to_string b =
2018-01-18 17:39:10 +01:00
let line ="
-----------------------------------------------------------------------
" in
"
Atomic Basis set
----------------
-----------------------------------------------------------------------
Angular Coordinates (Bohr) Exponents Coefficients
Momentum X Y Z
-----------------------------------------------------------------------
"
^( Array.mapi (fun atom_id basis ->
Array.map (fun i ->
Contracted_shell.to_string i) basis
|> Array.to_list
|> String.concat line
) b
|> Array.to_list
|> String.concat line)
^ line
2017-12-30 19:06:07 +01:00