10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 20:33:36 +01:00

Added qcaml module

This commit is contained in:
Anthony Scemama 2020-10-09 10:02:18 +02:00
parent 6217dc5a0a
commit 7e26b5833a
3 changed files with 91 additions and 0 deletions

14
qcaml/lib/dune Normal file
View File

@ -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"))

45
qcaml/lib/simulation.ml Normal file
View File

@ -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
}

32
qcaml/lib/simulation.mli Normal file
View File

@ -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