From b9fb5e79033dcaef6f2ac975ebad7a938e6d10d9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 9 Oct 2020 09:38:52 +0200 Subject: [PATCH] Renamed ao_basis to ao --- ao_basis/lib/ao_basis.ml => ao/lib/basis.ml | 26 +++++------ ao_basis/lib/ao_basis.mli => ao/lib/basis.mli | 6 +-- .../lib/basis_gaussian.ml | 2 + .../lib/basis_gaussian.mli | 11 ++--- {ao_basis => ao}/lib/dune | 4 +- {ao_basis => ao}/test/ao_basis.ml | 5 +- {ao_basis => ao}/test/ao_basis_gaussian.ml | 5 +- {ao_basis => ao}/test/dune | 2 +- qcaml/dune | 15 ------ qcaml/qcaml.ml | 10 ---- simulation/lib/dune | 14 ------ simulation/lib/simulation.ml | 46 ------------------- simulation/lib/simulation.mli | 33 ------------- 13 files changed, 30 insertions(+), 149 deletions(-) rename ao_basis/lib/ao_basis.ml => ao/lib/basis.ml (74%) rename ao_basis/lib/ao_basis.mli => ao/lib/basis.mli (89%) rename ao_basis/lib/ao_basis_gaussian.ml => ao/lib/basis_gaussian.ml (98%) rename ao_basis/lib/ao_basis_gaussian.mli => ao/lib/basis_gaussian.mli (78%) rename {ao_basis => ao}/lib/dune (85%) rename {ao_basis => ao}/test/ao_basis.ml (96%) rename {ao_basis => ao}/test/ao_basis_gaussian.ml (96%) rename {ao_basis => ao}/test/dune (90%) delete mode 100644 qcaml/dune delete mode 100644 qcaml/qcaml.ml delete mode 100644 simulation/lib/dune delete mode 100644 simulation/lib/simulation.ml delete mode 100644 simulation/lib/simulation.mli diff --git a/ao_basis/lib/ao_basis.ml b/ao/lib/basis.ml similarity index 74% rename from ao_basis/lib/ao_basis.ml rename to ao/lib/basis.ml index bf44e54..8434c00 100644 --- a/ao_basis/lib/ao_basis.ml +++ b/ao/lib/basis.ml @@ -2,7 +2,7 @@ open Qcaml_linear_algebra type basis = | Unknown - | Gaussian of Ao_basis_gaussian.t + | Gaussian of Basis_gaussian.t type t = { ao_basis : basis ; @@ -17,7 +17,7 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false) Qcaml_gaussian_basis.Basis.of_nuclei_and_basis_filename ~nuclei filename in let ao_basis = - Gaussian (Ao_basis_gaussian.make ~basis ?operators ~cartesian nuclei ) + Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei ) in { ao_basis ; cartesian } | _ -> failwith "of_nuclei_and_basis_filename needs to be called with `Gaussian" @@ -29,13 +29,13 @@ let ao_basis t = t.ao_basis let size t = match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.size b + | Gaussian b -> Basis_gaussian.size b | _ -> not_implemented () let overlap t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.overlap b + | Gaussian b -> Basis_gaussian.overlap b | _ -> not_implemented () end |> Matrix.relabel @@ -43,7 +43,7 @@ let overlap t = let multipole t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.multipole b + | Gaussian b -> Basis_gaussian.multipole b | _ -> not_implemented () end |> Array.map Matrix.relabel @@ -51,7 +51,7 @@ let multipole t = let ortho t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.ortho b + | Gaussian b -> Basis_gaussian.ortho b | _ -> not_implemented () end |> Matrix.relabel @@ -59,7 +59,7 @@ let ortho t = let eN_ints t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.eN_ints b + | Gaussian b -> Basis_gaussian.eN_ints b | _ -> not_implemented () end |> Matrix.relabel @@ -67,7 +67,7 @@ let eN_ints t = let kin_ints t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.kin_ints b + | Gaussian b -> Basis_gaussian.kin_ints b | _ -> not_implemented () end |> Matrix.relabel @@ -75,7 +75,7 @@ let kin_ints t = let ee_ints t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.ee_ints b + | Gaussian b -> Basis_gaussian.ee_ints b | _ -> not_implemented () end |> Four_idx_storage.relabel @@ -83,7 +83,7 @@ let ee_ints t = let ee_lr_ints t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.ee_lr_ints b + | Gaussian b -> Basis_gaussian.ee_lr_ints b | _ -> not_implemented () end |> Four_idx_storage.relabel @@ -91,7 +91,7 @@ let ee_lr_ints t = let f12_ints t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.f12_ints b + | Gaussian b -> Basis_gaussian.f12_ints b | _ -> not_implemented () end |> Four_idx_storage.relabel @@ -99,7 +99,7 @@ let f12_ints t = let f12_over_r12_ints t = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.f12_over_r12_ints b + | Gaussian b -> Basis_gaussian.f12_over_r12_ints b | _ -> not_implemented () end |> Four_idx_storage.relabel @@ -110,7 +110,7 @@ let cartesian t = t.cartesian let values t point = begin match t.ao_basis with - | Gaussian b -> Ao_basis_gaussian.values b point + | Gaussian b -> Basis_gaussian.values b point | _ -> not_implemented () end |> Vector.relabel diff --git a/ao_basis/lib/ao_basis.mli b/ao/lib/basis.mli similarity index 89% rename from ao_basis/lib/ao_basis.mli rename to ao/lib/basis.mli index c6a50b6..ac3086a 100644 --- a/ao_basis/lib/ao_basis.mli +++ b/ao/lib/basis.mli @@ -7,7 +7,7 @@ open Qcaml_linear_algebra type basis = | Unknown - | Gaussian of Ao_basis_gaussian.t + | Gaussian of Basis_gaussian.t type t @@ -59,5 +59,5 @@ val values : t -> Coordinate.t -> 'a Vector.t val of_nuclei_and_basis_filename : ?kind:[> `Gaussian ] -> ?operators:Operator.t list -> ?cartesian:bool -> nuclei:Nuclei.t -> string -> t -(** Creates the data structure for atomic orbitals from a {Basis.t} and the - molecular geometry {Nuclei.t} *) +(** Creates the data structure for the atomic orbitals basis from a molecule + {Nuclei.t} and the name of the basis-set file *) diff --git a/ao_basis/lib/ao_basis_gaussian.ml b/ao/lib/basis_gaussian.ml similarity index 98% rename from ao_basis/lib/ao_basis_gaussian.ml rename to ao/lib/basis_gaussian.ml index ed9399d..3b1ecd1 100644 --- a/ao_basis/lib/ao_basis_gaussian.ml +++ b/ao/lib/basis_gaussian.ml @@ -3,6 +3,8 @@ open Qcaml_gaussian_basis open Qcaml_gaussian_integrals open Qcaml_operators +module Basis = Qcaml_gaussian_basis.Basis + type t = { basis : Basis.t ; diff --git a/ao_basis/lib/ao_basis_gaussian.mli b/ao/lib/basis_gaussian.mli similarity index 78% rename from ao_basis/lib/ao_basis_gaussian.mli rename to ao/lib/basis_gaussian.mli index 223e9a9..98d162b 100644 --- a/ao_basis/lib/ao_basis_gaussian.mli +++ b/ao/lib/basis_gaussian.mli @@ -2,7 +2,6 @@ open Qcaml_common open Qcaml_particles open Qcaml_linear_algebra -open Qcaml_gaussian_basis open Qcaml_gaussian_integrals open Qcaml_operators @@ -13,7 +12,7 @@ type t val size : t -> int (** Number of atomic orbitals *) -val basis : t -> Basis.t +val basis : t -> Qcaml_gaussian_basis.Basis.t (** One-electron basis set *) val overlap : t -> Overlap.t @@ -46,14 +45,14 @@ val kin_ints : t -> Kinetic.t val cartesian : t -> bool (** If true, use cartesian Gaussians (6d, 10f, ...) *) -val values : t -> Coordinate.t -> Basis.t Vector.t +val values : t -> Coordinate.t -> Qcaml_gaussian_basis.Basis.t Vector.t (** Values of the AOs evaluated at a given point *) (** {1 Creators} *) -val make : basis:Basis.t -> ?operators:Operator.t list -> ?cartesian:bool - -> Nuclei.t -> t -(** Creates the data structure for atomic orbitals from a {Basis.t} and the +val make : basis:Qcaml_gaussian_basis.Basis.t -> ?operators:Operator.t list -> + ?cartesian:bool -> Nuclei.t -> t +(** Creates the data structure for atomic orbitals from a Gaussian basis and the molecular geometry {Nuclei.t} *) diff --git a/ao_basis/lib/dune b/ao/lib/dune similarity index 85% rename from ao_basis/lib/dune rename to ao/lib/dune index c69fd63..766f400 100644 --- a/ao_basis/lib/dune +++ b/ao/lib/dune @@ -1,8 +1,8 @@ ; 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_ao_basis) - (public_name qcaml.ao_basis) + (name qcaml_ao) + (public_name qcaml.ao) (libraries qcaml.common qcaml.particles diff --git a/ao_basis/test/ao_basis.ml b/ao/test/ao_basis.ml similarity index 96% rename from ao_basis/test/ao_basis.ml rename to ao/test/ao_basis.ml index d3332d3..a655f4e 100644 --- a/ao_basis/test/ao_basis.ml +++ b/ao/test/ao_basis.ml @@ -1,10 +1,9 @@ open Alcotest open Qcaml_common -open Qcaml_ao_basis open Qcaml_particles open Qcaml_operators open Qcaml_linear_algebra -open Ao_basis +open Qcaml_ao.Basis let wd = Qcaml.root ^ Filename.dir_sep ^ "test" @@ -91,7 +90,7 @@ let tests = let rs = 0.5 in let operators = [ Operator.of_range_separation rs ] in let ao_basis = - Ao_basis.of_nuclei_and_basis_filename ~kind:`Gaussian + Qcaml_ao.Basis.of_nuclei_and_basis_filename ~kind:`Gaussian ~operators ~cartesian:false ~nuclei basis_filename in make_tests "water" ao_basis ; diff --git a/ao_basis/test/ao_basis_gaussian.ml b/ao/test/ao_basis_gaussian.ml similarity index 96% rename from ao_basis/test/ao_basis_gaussian.ml rename to ao/test/ao_basis_gaussian.ml index 5664bb4..750c4dd 100644 --- a/ao_basis/test/ao_basis_gaussian.ml +++ b/ao/test/ao_basis_gaussian.ml @@ -2,11 +2,10 @@ open Alcotest open Qcaml_common open Qcaml_gaussian_integrals open Qcaml_gaussian_basis -open Qcaml_ao_basis open Qcaml_particles open Qcaml_operators open Qcaml_linear_algebra -open Ao_basis_gaussian +open Qcaml_ao.Basis_gaussian let wd = Qcaml.root ^ Filename.dir_sep ^ "test" @@ -93,7 +92,7 @@ let tests = let rs = 0.5 in let operators = [ Operator.of_range_separation rs ] in let ao_basis = - Ao_basis_gaussian.make ~basis ~operators nuclei + Qcaml_ao.Basis_gaussian.make ~basis ~operators nuclei in make_tests "water" ao_basis ; diff --git a/ao_basis/test/dune b/ao/test/dune similarity index 90% rename from ao_basis/test/dune rename to ao/test/dune index 1af4abe..791c26d 100644 --- a/ao_basis/test/dune +++ b/ao/test/dune @@ -5,6 +5,6 @@ qcaml.common qcaml.linear_algebra qcaml.gaussian_integrals - qcaml.ao_basis + qcaml.ao ) (synopsis "Tests for the AO basis")) diff --git a/qcaml/dune b/qcaml/dune deleted file mode 100644 index fec9806..0000000 --- a/qcaml/dune +++ /dev/null @@ -1,15 +0,0 @@ -; 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_basis - qcaml.simulation - ) - (synopsis "Main QCaml entry point")) diff --git a/qcaml/qcaml.ml b/qcaml/qcaml.ml deleted file mode 100644 index 24178d0..0000000 --- a/qcaml/qcaml.ml +++ /dev/null @@ -1,10 +0,0 @@ -module Ao_basis = Qcaml_ao_basis -module Common = Qcaml_common -module Gaussian_basis = Qcaml_gaussian_basis -module Gaussian_integrals = Qcaml_gaussian_integrals -module Linear_algebra = Qcaml_linear_algebra -module Operators = Qcaml_operators -module Particles = Qcaml_particles -module Simulation = Qcaml_simulation - - diff --git a/simulation/lib/dune b/simulation/lib/dune deleted file mode 100644 index 37d5372..0000000 --- a/simulation/lib/dune +++ /dev/null @@ -1,14 +0,0 @@ -; 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_simulation) - (public_name qcaml.simulation) - (libraries - qcaml.common - qcaml.particles - qcaml.gaussian_basis - qcaml.gaussian_integrals - qcaml.operators - qcaml.ao_basis - ) - (synopsis "Characterizes a simulation.")) diff --git a/simulation/lib/simulation.ml b/simulation/lib/simulation.ml deleted file mode 100644 index 8b38458..0000000 --- a/simulation/lib/simulation.ml +++ /dev/null @@ -1,46 +0,0 @@ -open Qcaml_common -open Qcaml_particles -open Qcaml_ao_basis -open Qcaml_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/simulation/lib/simulation.mli b/simulation/lib/simulation.mli deleted file mode 100644 index 47c69b2..0000000 --- a/simulation/lib/simulation.mli +++ /dev/null @@ -1,33 +0,0 @@ -(* Contains the state of a simulation *) - -open Qcaml_common -open Qcaml_particles -open Qcaml_ao_basis -open Qcaml_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 -