10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 06:33:39 +01:00
QCaml/Simulation.ml
2020-03-30 18:06:21 +02:00

67 lines
1.6 KiB
OCaml

type t = {
charge : Charge.t;
electrons : Electrons.t;
nuclei : Nuclei.t;
basis : Basis.t;
ao_basis : AOBasis.t;
f12 : F12factor.t option;
mu_erf : float option;
nuclear_repulsion : float;
}
let nuclei t = t.nuclei
let charge t = t.charge
let electrons t = t.electrons
let basis t = t.basis
let ao_basis t = t.ao_basis
let nuclear_repulsion t = t.nuclear_repulsion
let mu_erf t = t.mu_erf
let f12 t = t.f12
let make ?cartesian:(cartesian=false)
?multiplicity:(multiplicity=1)
?charge:(charge=0)
?f12
?mu_erf
~nuclei
basis
=
(* Tune Garbage Collector *)
let gc = Gc.get () in
Gc.set { gc with space_overhead = 1000 };
let electrons =
Electrons.make ~multiplicity ~charge nuclei
in
let chargre =
Charge.(Nuclei.charge nuclei + Electrons.charge electrons)
in
let ao_basis =
AOBasis.make ?f12 ~basis ~cartesian nuclei
in
let nuclear_repulsion =
Nuclei.repulsion nuclei
in
{
charge ; basis ; nuclei ; electrons ; ao_basis ; f12 ; mu_erf ;
nuclear_repulsion ;
}
let of_filenames ?(cartesian=false) ?(multiplicity=1) ?(charge=0) ?f12 ?mu_erf ~nuclei ?(aux_basis_filenames=[]) basis_filename =
let nuclei =
Nuclei.of_filename nuclei
in
let basis =
Basis.of_nuclei_and_basis_filenames ~nuclei (basis_filename :: aux_basis_filenames)
in
lazy (make ?mu_erf ?f12 ~cartesian ~charge ~multiplicity ~nuclei basis)
|> Parallel.broadcast