Renamed ao_basis to ao

This commit is contained in:
Anthony Scemama 2020-10-09 09:38:52 +02:00
parent e4c04af617
commit b9fb5e7903
13 changed files with 30 additions and 149 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,6 @@
qcaml.common
qcaml.linear_algebra
qcaml.gaussian_integrals
qcaml.ao_basis
qcaml.ao
)
(synopsis "Tests for the AO basis"))

View File

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

View File

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

View File

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

View File

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

View File

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