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

52 lines
1.1 KiB
OCaml
Raw Normal View History

2018-02-09 00:42:26 +01:00
type t = {
2018-06-13 17:49:58 +02:00
charge : Charge.t;
electrons : Electrons.t ;
nuclei : Nuclei.t;
basis : Basis.t;
ao_basis : AOBasis.t;
2018-02-20 23:54:48 +01:00
nuclear_repulsion : float;
2018-02-09 00:42:26 +01:00
}
2018-05-31 16:46:45 +02:00
let make ?cartesian:(cartesian=false)
?multiplicity:(multiplicity=1)
?charge:(charge=0)
~nuclei
basis
=
2018-02-23 00:58:54 +01:00
(* Tune Garbage Collector *)
let gc = Gc.get () in
Gc.set { gc with space_overhead = 1000 };
2018-02-22 18:20:45 +01:00
let electrons =
Electrons.make ~multiplicity ~charge nuclei
in
2018-06-13 17:49:58 +02:00
2018-02-22 18:20:45 +01:00
let charge =
2018-03-03 22:13:14 +01:00
Charge.(Nuclei.charge nuclei + Electrons.charge electrons)
2018-02-22 18:20:45 +01:00
in
2018-06-13 17:49:58 +02:00
let ao_basis =
AOBasis.make ~basis ~cartesian nuclei
2018-02-21 17:06:24 +01:00
in
2018-06-13 17:49:58 +02:00
let nuclear_repulsion =
Nuclei.repulsion nuclei
in
2018-02-09 00:42:26 +01:00
{
2018-06-13 17:49:58 +02:00
charge ; basis ; nuclei ; electrons ; ao_basis ;
nuclear_repulsion ;
2018-02-09 00:42:26 +01:00
}
let of_filenames ?cartesian:(cartesian=false) ?multiplicity:(multiplicity=1) ?charge:(charge=0) ~nuclei basis_filename =
2018-02-09 00:42:26 +01:00
let nuclei =
2018-03-03 22:13:14 +01:00
Nuclei.of_filename nuclei
2018-02-09 00:42:26 +01:00
in
let basis =
2018-03-08 23:29:08 +01:00
Basis.of_nuclei_and_basis_filename ~nuclei basis_filename
2018-02-09 00:42:26 +01:00
in
make ~cartesian ~charge ~multiplicity ~nuclei basis
2018-02-09 00:42:26 +01:00