10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 06:33:39 +01:00

Merge branch 'dev' of gitlab.com:scemama/QCaml into dev

This commit is contained in:
Anthony Scemama 2020-10-18 01:58:36 +02:00
commit a907572217
55 changed files with 61 additions and 36 deletions

View File

@ -16,7 +16,7 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
match kind with match kind with
| `Gaussian -> | `Gaussian ->
let basis = let basis =
Gaussian_basis.Basis.of_nuclei_and_basis_filename ~nuclei filename Gaussian.Basis.of_nuclei_and_basis_filename ~nuclei filename
in in
let ao_basis = let ao_basis =
Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei ) Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )

View File

@ -1,9 +1,9 @@
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
open Gaussian_integrals open Gaussian_integrals
open Operators open Operators
module Basis = Gaussian_basis.Basis module Basis = Gaussian.Basis
type t = type t =
{ {

View File

@ -12,7 +12,7 @@ type t
val size : t -> int val size : t -> int
(** Number of atomic orbitals *) (** Number of atomic orbitals *)
val basis : t -> Gaussian_basis.Basis.t val basis : t -> Gaussian.Basis.t
(** One-electron basis set *) (** One-electron basis set *)
val overlap : t -> Overlap.t val overlap : t -> Overlap.t
@ -45,14 +45,14 @@ val kin_ints : t -> Kinetic.t
val cartesian : t -> bool val cartesian : t -> bool
(** If true, use cartesian Gaussians (6d, 10f, ...) *) (** If true, use cartesian Gaussians (6d, 10f, ...) *)
val values : t -> Coordinate.t -> Gaussian_basis.Basis.t Vector.t val values : t -> Coordinate.t -> Gaussian.Basis.t Vector.t
(** Values of the AOs evaluated at a given point *) (** Values of the AOs evaluated at a given point *)
(** {1 Creators} *) (** {1 Creators} *)
val make : basis:Gaussian_basis.Basis.t -> ?operators:Operator.t list -> val make : basis:Gaussian.Basis.t -> ?operators:Operator.t list ->
?cartesian:bool -> Nuclei.t -> t ?cartesian:bool -> Nuclei.t -> t
(** Creates the data structure for atomic orbitals from a Gaussian basis and the (** Creates the data structure for atomic orbitals from a Gaussian basis and the
molecular geometry {Nuclei.t} *) molecular geometry {Nuclei.t} *)

View File

@ -6,7 +6,7 @@
(libraries (libraries
qcaml.common qcaml.common
qcaml.particles qcaml.particles
qcaml.gaussian_basis qcaml.gaussian
qcaml.gaussian_integrals qcaml.gaussian_integrals
qcaml.operators qcaml.operators
) )

View File

@ -1,6 +1,6 @@
open Alcotest open Alcotest
open Gaussian_integrals open Gaussian_integrals
open Gaussian_basis open Gaussian
open Particles open Particles
open Operators open Operators
open Linear_algebra open Linear_algebra

View File

@ -3,7 +3,7 @@ let name = "QCaml"
let root = let root =
let rec chop = function let rec chop = function
| [] -> raise Not_found | [] -> []
| x :: _ as l when x = name -> l | x :: _ as l when x = name -> l
| _ :: rest -> chop rest | _ :: rest -> chop rest
in in

View File

@ -27,7 +27,6 @@ in quantum chemistry.")
(depends (depends
(ocaml (>= 4.10)) (ocaml (>= 4.10))
(dune (>= 1.10)) (dune (>= 1.10))
str
lacaml lacaml
getopt getopt
zarith zarith

View File

@ -1,8 +1,8 @@
; name = name of the supermodule that will wrap all source files as submodules ; name = name of the supermodule that will wrap all source files as submodules
; public_name = name of the library for ocamlfind and opam ; public_name = name of the library for ocamlfind and opam
(library (library
(name gaussian_basis) (name gaussian)
(public_name qcaml.gaussian_basis) (public_name qcaml.gaussian)
(libraries (libraries
str str
qcaml.common qcaml.common

View File

@ -3,6 +3,6 @@
(libraries (libraries
alcotest alcotest
qcaml.particles qcaml.particles
qcaml.gaussian_basis qcaml.gaussian
) )
(synopsis "Tests for Gaussian basis sets")) (synopsis "Tests for Gaussian basis sets"))

View File

@ -1,6 +1,6 @@
open Common open Common
open Particles open Particles
open Gaussian_basis open Gaussian
open Alcotest open Alcotest
let wd = Common.Qcaml.root ^ Filename.dir_sep ^ "test" let wd = Common.Qcaml.root ^ Filename.dir_sep ^ "test"

View File

@ -7,7 +7,7 @@
str str
qcaml.common qcaml.common
qcaml.linear_algebra qcaml.linear_algebra
qcaml.gaussian_basis qcaml.gaussian
qcaml.operators qcaml.operators
) )
(modules_without_implementation matrix_on_basis) (modules_without_implementation matrix_on_basis)

View File

@ -3,7 +3,7 @@
include Common include Common
include Particles include Particles
include Linear_algebra include Linear_algebra
include Gaussian_basis include Gaussian
open Util open Util
open Constants open Constants

View File

@ -9,7 +9,7 @@ $$ %}
include module type of Matrix_on_basis include module type of Matrix_on_basis
open Particles open Particles
open Gaussian_basis open Gaussian
val of_basis_nuclei : basis:Basis.t -> Nuclei.t -> t val of_basis_nuclei : basis:Basis.t -> Nuclei.t -> t
(** Build from a {Basis.t} and the nuclei (coordinates and charges). *) (** Build from a {Basis.t} and the nuclei (coordinates and charges). *)

View File

@ -1,7 +1,7 @@
(** Electron-electron repulsion integrals *) (** Electron-electron repulsion integrals *)
open Common open Common
open Gaussian_basis open Gaussian
module Csp = Contracted_shell_pair module Csp = Contracted_shell_pair
module Cspc = Contracted_shell_pair_couple module Cspc = Contracted_shell_pair_couple

View File

@ -3,7 +3,7 @@
*) *)
open Common open Common
open Gaussian_basis open Gaussian
open Operators open Operators
module Csp = Contracted_shell_pair module Csp = Contracted_shell_pair

View File

@ -1,5 +1,5 @@
open Common open Common
open Gaussian_basis open Gaussian
module Am = Angular_momentum module Am = Angular_momentum
module Asp = Atomic_shell_pair module Asp = Atomic_shell_pair

View File

@ -1,6 +1,6 @@
open Common open Common
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
open Util open Util
open Constants open Constants

View File

@ -1,6 +1,6 @@
(** Signature for matrices built on the {!Basis.t} *) (** Signature for matrices built on the {!Basis.t} *)
open Gaussian_basis open Gaussian
open Linear_algebra open Linear_algebra
type t = (Basis.t, Basis.t) Matrix.t type t = (Basis.t, Basis.t) Matrix.t

View File

@ -1,6 +1,6 @@
open Common open Common
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
open Constants open Constants
type t = (Basis.t, Basis.t) Matrix.t array type t = (Basis.t, Basis.t) Matrix.t array
@ -222,3 +222,19 @@ let of_basis basis =
Array.iter Matrix.detri_inplace result; Array.iter Matrix.detri_inplace result;
result result
let to_file ~filename eni_array =
let n = Matrix.dim1 eni_array in
let eni_array = Matrix.to_bigarray_inplace eni_array in
let oc = open_out filename in
for j=1 to n do
for i=1 to j do
let value = eni_array.{i,j} in
if (value <> 0.) then
Printf.fprintf oc " %5d %5d %20.15f\n" i j value;
done;
done;
close_out oc

View File

@ -10,7 +10,7 @@
*) *)
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
type t = (Basis.t, Basis.t) Matrix.t array type t = (Basis.t, Basis.t) Matrix.t array
@ -60,3 +60,7 @@ val matrix_z4 : t -> (Basis.t, Basis.t) Matrix.t
(** {% $$ \langle \chi_i | z^4 | \chi_j \rangle $$ %} *) (** {% $$ \langle \chi_i | z^4 | \chi_j \rangle $$ %} *)
val of_basis : Basis.t -> t val of_basis : Basis.t -> t
val to_file : filename:string -> (Basis.t, Basis.t) Matrix.t -> unit
(** Write a matrix to a file *)

View File

@ -2,7 +2,7 @@ open Common
open Particles open Particles
open Util open Util
open Constants open Constants
open Gaussian_basis open Gaussian
exception NullPair exception NullPair

View File

@ -1,6 +1,6 @@
open Common open Common
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
module Am = Angular_momentum module Am = Angular_momentum
module Bs = Basis module Bs = Basis

View File

@ -1,6 +1,6 @@
(** Orthonormalization of the basis. *) (** Orthonormalization of the basis. *)
open Gaussian_basis open Gaussian
open Linear_algebra open Linear_algebra
type t = (Basis.t, Basis.t) Matrix.t type t = (Basis.t, Basis.t) Matrix.t

View File

@ -1,6 +1,6 @@
open Common open Common
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
open Util open Util
open Constants open Constants

View File

@ -1,7 +1,7 @@
(** Screened Electron-electron repulsion integrals (Yukawa potential). Required for F12/r12. *) (** Screened Electron-electron repulsion integrals (Yukawa potential). Required for F12/r12. *)
open Common open Common
open Gaussian_basis open Gaussian
open Operators open Operators
module Csp = Contracted_shell_pair module Csp = Contracted_shell_pair

View File

@ -3,7 +3,7 @@
open Common open Common
open Linear_algebra open Linear_algebra
open Gaussian_basis open Gaussian
open Operators open Operators
open Constants open Constants

View File

@ -6,7 +6,7 @@
*) *)
open Common open Common
open Gaussian_basis open Gaussian
open Linear_algebra open Linear_algebra
open Operators open Operators

View File

@ -1,5 +1,5 @@
open Common open Common
open Gaussian_basis open Gaussian
module Am = Angular_momentum module Am = Angular_momentum
module Asp = Atomic_shell_pair module Asp = Atomic_shell_pair

View File

@ -1,5 +1,5 @@
open Common open Common
open Gaussian_basis open Gaussian
open Linear_algebra open Linear_algebra
module Am = Angular_momentum module Am = Angular_momentum

View File

@ -1,6 +1,6 @@
open Common open Common
open Particles open Particles
open Gaussian_basis open Gaussian
open Alcotest open Alcotest
let wd = Common.Qcaml.root ^ Filename.dir_sep ^ "test" let wd = Common.Qcaml.root ^ Filename.dir_sep ^ "test"

View File

@ -6,7 +6,7 @@
(libraries (libraries
qcaml.common qcaml.common
qcaml.particles qcaml.particles
qcaml.gaussian_basis qcaml.gaussian
qcaml.gaussian_integrals qcaml.gaussian_integrals
qcaml.operators qcaml.operators
qcaml.ao qcaml.ao

View File

@ -1,2 +1,8 @@
module Common = Common module Common = Common
module Ao = Ao module Ao = Ao
module Gaussian = Gaussian
module Gaussian_integrals = Gaussian_integrals
module Linear_algebra = Linear_algebra
module Operators = Operators
module Particles = Particles

View File

@ -6,7 +6,7 @@
(libraries (libraries
qcaml.common qcaml.common
qcaml.particles qcaml.particles
qcaml.gaussian_basis qcaml.gaussian
qcaml.gaussian_integrals qcaml.gaussian_integrals
qcaml.operators qcaml.operators
qcaml.ao qcaml.ao