10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-06 22:23:42 +01:00
QCaml/Simulation.ml
2018-05-31 16:46:45 +02:00

56 lines
1.4 KiB
OCaml

type t = {
charge : Charge.t;
electrons : Electrons.t ;
basis : Basis.t;
nuclei : Nuclei.t;
overlap : Overlap.t lazy_t;
overlap_ortho : Orthonormalization.t lazy_t;
eN_ints : NucInt.t lazy_t;
kin_ints : KinInt.t lazy_t;
ee_ints : ERI.t lazy_t;
nuclear_repulsion : float;
cartesian : bool;
}
let make ?cartesian:(cartesian=false)
?multiplicity:(multiplicity=1)
?charge:(charge=0)
~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 charge =
Charge.(Nuclei.charge nuclei + Electrons.charge electrons)
in
let overlap =
lazy (Overlap.of_basis basis)
in
{
charge ;
basis ; nuclei ; electrons ; overlap ;
overlap_ortho = lazy (Orthonormalization.make ~cartesian ~basis (Lazy.force overlap));
eN_ints = lazy (NucInt.of_basis_nuclei basis nuclei);
kin_ints = lazy (KinInt.of_basis basis);
ee_ints = lazy (ERI.of_basis basis);
nuclear_repulsion = Nuclei.repulsion nuclei;
cartesian ;
}
let of_filenames ?cartesian:(cartesian=false) ?multiplicity:(multiplicity=1) ?charge:(charge=0) ~nuclei basis_filename =
let nuclei =
Nuclei.of_filename nuclei
in
let basis =
Basis.of_nuclei_and_basis_filename ~nuclei basis_filename
in
make ~cartesian ~charge ~multiplicity ~nuclei basis