10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-19 04:22:21 +01:00
QCaml/Simulation.ml

63 lines
1.5 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;
2020-03-30 18:06:21 +02:00
electrons : Electrons.t;
2018-06-13 17:49:58 +02:00
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
}
2019-02-20 18:15:15 +01:00
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
2020-05-08 01:12:31 +02:00
let range_separation t = Basis.range_separation t.basis
let f12 t = Basis.f12 t.basis
2019-02-20 18:15:15 +01:00
2018-05-31 16:46:45 +02:00
let make ?cartesian:(cartesian=false)
2020-03-30 18:06:21 +02:00
?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
2020-04-14 15:53:07 +02: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
2020-04-14 15:53:07 +02:00
let ao_basis =
2020-05-08 01:12:31 +02:00
AOBasis.make ~basis ~cartesian nuclei
2018-02-21 17:06:24 +01:00
in
2018-06-13 17:49:58 +02:00
2020-04-14 15:53:07 +02:00
let nuclear_repulsion =
2018-06-13 17:49:58 +02:00
Nuclei.repulsion nuclei
in
2018-02-09 00:42:26 +01:00
{
2020-05-08 01:12:31 +02:00
charge ; basis ; nuclei ; electrons ; ao_basis ;
2018-06-13 17:49:58 +02:00
nuclear_repulsion ;
2018-02-09 00:42:26 +01:00
}
2020-05-08 00:33:43 +02:00
let of_filenames ?(cartesian=false) ?(multiplicity=1) ?(charge=0) ?f12 ?range_separation ~nuclei ?(aux_basis_filenames=[]) 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 =
2020-05-08 01:12:31 +02:00
Basis.of_nuclei_and_basis_filenames ?f12 ?range_separation ~nuclei (basis_filename :: aux_basis_filenames)
2018-02-09 00:42:26 +01:00
in
2020-05-08 01:12:31 +02:00
lazy (make ~cartesian ~charge ~multiplicity ~nuclei basis)
2018-10-23 13:39:06 +02:00
|> Parallel.broadcast
2018-02-09 00:42:26 +01:00