diff --git a/qcaml/lib/dune b/qcaml/lib/dune new file mode 100644 index 0000000..6f107cf --- /dev/null +++ b/qcaml/lib/dune @@ -0,0 +1,14 @@ +; name = name of the supermodule that will wrap all source files as submodules +; public_name = name of the library for ocamlfind and opam +(library + (name qcaml) + (public_name qcaml) + (libraries + qcaml.common + qcaml.particles + qcaml.gaussian_basis + qcaml.gaussian_integrals + qcaml.operators + qcaml.ao + ) + (synopsis "Main QCaml entry point")) diff --git a/qcaml/lib/simulation.ml b/qcaml/lib/simulation.ml new file mode 100644 index 0000000..dc8e314 --- /dev/null +++ b/qcaml/lib/simulation.ml @@ -0,0 +1,45 @@ +open Common +open Particles +open Operators + +type t = { + charge : Charge.t; + electrons : Electrons.t; + nuclei : Nuclei.t; + ao_basis : Ao.Basis.t; + operators : Operator.t list; +} + +let nuclei t = t.nuclei +let charge t = t.charge +let electrons t = t.electrons +let ao_basis t = t.ao_basis +let nuclear_repulsion t = Nuclei.repulsion @@ nuclei t +let operators t = t.operators + +let make ?(multiplicity=1) + ?(charge=0) + ?(operators=[]) + ~nuclei + ao_basis + = + + (* Tune Garbage Collector *) + let gc = Gc.get () in + Gc.set { gc with space_overhead = 1000 }; + + let electrons = + Electrons.of_atoms ~multiplicity ~charge nuclei + in + + let charge = + Charge.(Nuclei.charge nuclei + Electrons.charge electrons) + in + + { + charge ; nuclei ; electrons ; ao_basis ; + operators + } + + + diff --git a/qcaml/lib/simulation.mli b/qcaml/lib/simulation.mli new file mode 100644 index 0000000..285489e --- /dev/null +++ b/qcaml/lib/simulation.mli @@ -0,0 +1,32 @@ +(* Contains the state of a simulation *) + +open Common +open Particles +open Operators + +type t + +val nuclei : t -> Nuclei.t +(** Nuclear coordinates used in the smiulation *) + +val charge : t -> Charge.t +(** Total charge (electrons + nuclei) *) + +val electrons : t -> Electrons.t +(** Electrons used in the simulation *) + +val ao_basis : t -> Ao.Basis.t +(** Atomic basis set *) + +val nuclear_repulsion : t -> float +(** Nuclear repulsion energy *) + +val operators : t -> Operator.t list +(** List of extra operators (range-separation, f12, etc) *) + +(** {1 Creation} *) + +val make : ?multiplicity:int -> ?charge:int -> + ?operators:Operator.t list-> nuclei:Nuclei.t -> + Ao.Basis.t -> t +