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

Working on TREXIO basis

This commit is contained in:
Anthony Scemama 2023-04-24 19:01:42 +02:00
parent 2e835550b7
commit b4211b8d85
21 changed files with 680 additions and 410 deletions

20
DevInstructions.org Normal file
View File

@ -0,0 +1,20 @@
#+TITLE: Developper's instructions
* General
The developper writes org-mode files, and the OCaml files are produced
by running the ~make~ command. Then, the OCaml files are compiled
using ~dune~.
In each directory, the =README.org= file is the entry point. It
contains the script to generate the dune files, which should be
created by executing ~Ctrl-C Ctrl-C~ in the appropriate code block.
If necessary, some pure OCaml files can be added in the =lib=
directory.
* Basis
- =Basis_poly= is a polymorphic basis
- =Basis_gaussian= contains the basis and integrals
- =Gaussian.Basis= is the actual Gaussian basis

View File

@ -25,15 +25,6 @@ To use the Intel MKL library:
```bash
export LACAML_LIBS="-L${MKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_rt -lpthread -lm -ldl"
opam install --assume-depexts lacaml
odoc-ltxhtml allows to embed equations in the documentation generated by Ocamldoc.
Download the source code [here](https://github.com/scemama/odoc-ltxhtml).
```bash
git clone https://github.com/scemama/odoc-ltxhtml
cd odoc-ltxhtml
make install
```
How to build the project
@ -42,7 +33,7 @@ How to build the project
Run `make` to compile the libraries and executables that are
meant to be installed.
```
$ make
$ make -j
```
How to run tests

View File

@ -50,6 +50,7 @@ with open(dunetest,'w') as f:
(synopsis "Test for {name} library")
(libraries
alcotest
trexio
qcaml.{name}
)
)

View File

@ -7,7 +7,7 @@
(setq ml (concat lib name ".ml"))
(setq test-ml (concat testdir name ".ml"))
(org-babel-tangle)
#+end_src
#+end_src
* Basis
:PROPERTIES:
@ -15,7 +15,7 @@
:END:
Data structure for Atomic Orbitals.
** Dimensions :noexport:
#+begin_src ocaml :tangle lib/ao_dim.mli :exports none
@ -41,7 +41,7 @@ type t =
<<<~Basis.t~>>>
#+begin_src ocaml :tangle (eval mli)
type t
type ao = Ao_dim.t
type ao = Ao_dim.t
open Common
open Particles
@ -58,7 +58,7 @@ type t =
type ao = Ao_dim.t
open Linear_algebra
open Common
open Common
#+end_src
** Conversions
@ -87,8 +87,11 @@ val of_nuclei_and_basis_filename :
let b = Ao.Basis.of_nuclei_and_basis_filename ~nuclei filename;;
val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
#+end_example
#+begin_src ocaml :tangle (eval ml) :exports none
let not_implemented () =
Util.not_implemented "Only Gaussian is implemented"
let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
~nuclei filename =
match kind with
@ -96,14 +99,13 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
let basis =
Gaussian.Basis.of_nuclei_and_basis_filename ~nuclei filename
in
let ao_basis =
let ao_basis =
Basis_poly.Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
in
{ ao_basis ; cartesian }
| _ -> failwith "of_nuclei_and_basis_filename needs to be called with `Gaussian"
| _ -> not_implemented ()
#+end_src
** Access
#+begin_src ocaml :tangle (eval mli)
@ -140,12 +142,9 @@ val values : t -> Coordinate.t -> ao Vector.t
#+begin_src ocaml :tangle (eval ml) :exports none
let not_implemented () =
Util.not_implemented "Only Gaussian is implemented"
let ao_basis t = t.ao_basis
let size t =
let size t =
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.size b
| _ -> not_implemented ()
@ -157,7 +156,7 @@ let overlap t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let multipole t =
begin
match t.ao_basis with
@ -168,7 +167,7 @@ let multipole t =
|> Matrix.relabel
| _ -> not_implemented ()
end
let ortho t =
begin
match t.ao_basis with
@ -176,7 +175,7 @@ let ortho t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let eN_ints t =
begin
match t.ao_basis with
@ -184,7 +183,7 @@ let eN_ints t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let kin_ints t =
begin
match t.ao_basis with
@ -192,7 +191,7 @@ let kin_ints t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let ee_ints t =
begin
match t.ao_basis with
@ -200,7 +199,7 @@ let ee_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let ee_lr_ints t =
begin
match t.ao_basis with
@ -208,7 +207,7 @@ let ee_lr_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_ints t =
begin
match t.ao_basis with
@ -216,7 +215,7 @@ let f12_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_over_r12_ints t =
begin
match t.ao_basis with
@ -224,9 +223,9 @@ let f12_over_r12_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let cartesian t = t.cartesian
let values t point =
begin
@ -235,9 +234,59 @@ let values t point =
| _ -> not_implemented ()
end
|> Vector.relabel
#+end_src
** TREXIO
*** Read
#+begin_src ocaml :tangle (eval mli)
(*
val of_trexio : Trexio.trexio_file -> t
*)
#+end_src
#+begin_src ocaml :tangle (eval ml) :exports none
(*
let of_trexio f =
match Trexio.read_basis_type f with
| "G"
| "Gaussian"
| "gaussian" ->
let basis =
Gaussian.Basis.of_trexio f
in
let ao_basis =
Basis_poly.Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
in
{ ao_basis ; cartesian }
| _ -> not_implemented ()
*)
#+end_src
*** Write
#+begin_src ocaml :tangle (eval mli)
(*
val to_trexio : Trexio.trexio_file -> t -> unit
*)
#+end_src
#+begin_src ocaml :tangle (eval ml) :exports none
(*
let to_trexio f t =
match t.ao_basis with
| Basis_poly.Gaussian b -> Gaussian.Basis.to_trexio f (Basis_gaussian.basis b))
| _ -> not_implemented ()
*)
#+end_src
** Printers
#+begin_src ocaml :tangle (eval mli)

View File

@ -7,14 +7,14 @@
(setq ml (concat lib name ".ml"))
(setq test-ml (concat testdir name ".ml"))
(org-babel-tangle)
#+end_src
#+end_src
* Gaussian basis
:PROPERTIES:
:header-args: :noweb yes :comments both
:END:
Data structure for Gaussian Atomic Orbitals:
Data structure for Gaussian Atomic Orbitals:
\[
\chi_i(\mathbf{r}) = P_i(\mathbf{r}) \sum_k c_k \exp\left( -\alpha_k (\mathbf{r-R_A})^2 \right)
@ -34,7 +34,7 @@ open Linear_algebra
open Gaussian_integrals
open Operators
type t
type t
#+end_src
#+begin_src ocaml :tangle (eval ml) :exports none
@ -42,7 +42,7 @@ open Linear_algebra
open Gaussian
open Gaussian_integrals
open Operators
module Basis = Gaussian.Basis
type t =
@ -108,7 +108,7 @@ let overlap t = Lazy.force t.overlap
let size t = Matrix.dim1 (Lazy.force t.overlap)
#+end_src
** Computation
** Computation
#+begin_src ocaml :tangle (eval mli)
val values : t ->
@ -145,7 +145,7 @@ val make : basis:Gaussian.Basis.t ->
Nuclei.t ->
t
#+end_src
Creates the data structure for atomic orbitals from a Gaussian basis and the
molecular geometry ~Nuclei.t~.
@ -161,28 +161,28 @@ val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs
#+begin_src ocaml :tangle (eval ml) :exports none
let make ~basis ?(operators=[]) ?(cartesian=false) nuclei =
let overlap = lazy (
Overlap.of_basis basis
) in
let ortho = lazy (
Lazy.force overlap
|> Orthonormalization.make ~cartesian ~basis
|> Orthonormalization.make ~cartesian ~basis
) in
let eN_ints = lazy (
Electron_nucleus.of_basis_nuclei ~basis nuclei
) in
let kin_ints = lazy (
Kinetic.of_basis basis
) in
let ee_ints = lazy (
Eri.of_basis basis
) in
let rec get_f12 = function
| (Operator.F12 _ as f) :: _ -> f
| [] -> failwith "Missing F12 operator"
@ -198,11 +198,11 @@ let make ~basis ?(operators=[]) ?(cartesian=false) nuclei =
let ee_lr_ints = lazy (
Eri_long_range.of_basis basis~operator:(get_rs operators)
) in
let f12_ints = lazy (
F12.of_basis basis ~operator:(get_f12 operators)
) in
let f12_over_r12_ints = lazy (
Screened_eri.of_basis basis ~operator:(get_f12 operators)
) in
@ -227,6 +227,6 @@ let pp ppf t =
let cart = if t.cartesian then "cartesian" else "spherical" in
let nao = size t in
Format.fprintf ppf "@[@[Gaussian Basis@], @[%s@], @[%d AOs@]@]"
cart nao
cart nao
#+end_src

View File

@ -26,9 +26,12 @@ open Common
* let b = Ao.Basis.of_nuclei_and_basis_filename ~nuclei filename;;
* val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
* #+end_example *)
(* [[file:~/QCaml/ao/basis.org::*Conversions][Conversions:2]] *)
let not_implemented () =
Util.not_implemented "Only Gaussian is implemented"
let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
~nuclei filename =
match kind with
@ -36,11 +39,11 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
let basis =
Gaussian.Basis.of_nuclei_and_basis_filename ~nuclei filename
in
let ao_basis =
let ao_basis =
Basis_poly.Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
in
{ ao_basis ; cartesian }
| _ -> failwith "of_nuclei_and_basis_filename needs to be called with `Gaussian"
| _ -> not_implemented ()
(* Conversions:2 ends here *)
@ -64,12 +67,9 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false)
(* [[file:~/QCaml/ao/basis.org::*Access][Access:2]] *)
let not_implemented () =
Util.not_implemented "Only Gaussian is implemented"
let ao_basis t = t.ao_basis
let size t =
let size t =
match t.ao_basis with
| Basis_poly.Gaussian b -> Basis_gaussian.size b
| _ -> not_implemented ()
@ -81,7 +81,7 @@ let overlap t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let multipole t =
begin
match t.ao_basis with
@ -92,7 +92,7 @@ let multipole t =
|> Matrix.relabel
| _ -> not_implemented ()
end
let ortho t =
begin
match t.ao_basis with
@ -100,7 +100,7 @@ let ortho t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let eN_ints t =
begin
match t.ao_basis with
@ -108,7 +108,7 @@ let eN_ints t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let kin_ints t =
begin
match t.ao_basis with
@ -116,7 +116,7 @@ let kin_ints t =
| _ -> not_implemented ()
end
|> Matrix.relabel
let ee_ints t =
begin
match t.ao_basis with
@ -124,7 +124,7 @@ let ee_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let ee_lr_ints t =
begin
match t.ao_basis with
@ -132,7 +132,7 @@ let ee_lr_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_ints t =
begin
match t.ao_basis with
@ -140,7 +140,7 @@ let f12_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let f12_over_r12_ints t =
begin
match t.ao_basis with
@ -148,9 +148,9 @@ let f12_over_r12_ints t =
| _ -> not_implemented ()
end
|> Four_idx_storage.relabel
let cartesian t = t.cartesian
let values t point =
begin
@ -161,6 +161,37 @@ let values t point =
|> Vector.relabel
(* Access:2 ends here *)
(* [[file:~/QCaml/ao/basis.org::*Read][Read:2]] *)
(*
let of_trexio f =
match Trexio.read_basis_type f with
| "G"
| "Gaussian"
| "gaussian" ->
let basis =
Gaussian.Basis.of_trexio f
in
let ao_basis =
Basis_poly.Gaussian (Basis_gaussian.make ~basis ?operators ~cartesian nuclei )
in
{ ao_basis ; cartesian }
| _ -> not_implemented ()
*)
(* Read:2 ends here *)
(* [[file:~/QCaml/ao/basis.org::*Write][Write:2]] *)
(*
let to_trexio f t =
match t.ao_basis with
| Basis_poly.Gaussian b -> Gaussian.Basis.to_trexio f (Basis_gaussian.basis b))
| _ -> not_implemented ()
*)
(* Write:2 ends here *)
(* [[file:~/QCaml/ao/basis.org::*Printers][Printers:2]] *)
let pp ppf t =
begin

View File

@ -4,7 +4,7 @@
(* [[file:~/QCaml/ao/basis.org::*Types][Types:1]] *)
type t
type ao = Ao_dim.t
type ao = Ao_dim.t
open Common
open Particles
@ -44,6 +44,24 @@ val cartesian : t -> bool
val values : t -> Coordinate.t -> ao Vector.t
(* Access:1 ends here *)
(* Read *)
(* [[file:~/QCaml/ao/basis.org::*Read][Read:1]] *)
(*
val of_trexio : Trexio.trexio_file -> t
*)
(* Read:1 ends here *)
(* Write *)
(* [[file:~/QCaml/ao/basis.org::*Write][Write:1]] *)
(*
val to_trexio : Trexio.trexio_file -> t -> unit
*)
(* Write:1 ends here *)
(* Printers *)

View File

@ -3,7 +3,7 @@ open Linear_algebra
open Gaussian
open Gaussian_integrals
open Operators
module Basis = Gaussian.Basis
type t =
@ -79,7 +79,7 @@ let values t point =
(* Computation:2 ends here *)
(* Creates the data structure for atomic orbitals from a Gaussian basis and the
* molecular geometry ~Nuclei.t~.
*
@ -96,28 +96,28 @@ let values t point =
(* [[file:~/QCaml/ao/basis_gaussian.org::*Creation][Creation:2]] *)
let make ~basis ?(operators=[]) ?(cartesian=false) nuclei =
let overlap = lazy (
Overlap.of_basis basis
) in
let ortho = lazy (
Lazy.force overlap
|> Orthonormalization.make ~cartesian ~basis
|> Orthonormalization.make ~cartesian ~basis
) in
let eN_ints = lazy (
Electron_nucleus.of_basis_nuclei ~basis nuclei
) in
let kin_ints = lazy (
Kinetic.of_basis basis
) in
let ee_ints = lazy (
Eri.of_basis basis
) in
let rec get_f12 = function
| (Operator.F12 _ as f) :: _ -> f
| [] -> failwith "Missing F12 operator"
@ -133,11 +133,11 @@ let make ~basis ?(operators=[]) ?(cartesian=false) nuclei =
let ee_lr_ints = lazy (
Eri_long_range.of_basis basis~operator:(get_rs operators)
) in
let f12_ints = lazy (
F12.of_basis basis ~operator:(get_f12 operators)
) in
let f12_over_r12_ints = lazy (
Screened_eri.of_basis basis ~operator:(get_f12 operators)
) in

View File

@ -31,7 +31,7 @@ val overlap : t -> Overlap.t
val size : t -> int
(* Access:1 ends here *)
(* Computation *)
(* Computation *)
(* [[file:~/QCaml/ao/basis_gaussian.org::*Computation][Computation:1]] *)

View File

@ -1,4 +1,4 @@
(* [[file:~/QCaml/ao/basis.org::*Polymorphic%20types][Polymorphic types:2]] *)
(* [[file:~/QCaml/ao/basis.org::*Polymorphic types][Polymorphic types:2]] *)
type t =
| Unknown
| Gaussian of Basis_gaussian.t

View File

@ -4,6 +4,7 @@
(synopsis "Test for ao library")
(libraries
alcotest
trexio
qcaml.ao
)
)

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-01-28 Thu 00:21 -->
<!-- 2023-04-24 Mon 18:06 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Atomic Orbitals</title>
@ -272,31 +272,37 @@ org_html_manager.setup(); // activate after the parameters are set
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org10034f2">1. Summary</a></li>
<li><a href="#org5474da5">2. Gaussian basis</a>
<li><a href="#org87cd388">1. Summary</a></li>
<li><a href="#org5e9a951">2. Gaussian basis</a>
<ul>
<li><a href="#org7b7dfc2">2.1. Type</a></li>
<li><a href="#org9115219">2.2. Access</a></li>
<li><a href="#org7028216">2.3. Computation</a></li>
<li><a href="#org1f24daa">2.4. Creation</a></li>
<li><a href="#orge8bdd89">2.5. Printers</a></li>
<li><a href="#orgf171259">2.1. Type</a></li>
<li><a href="#orgb673ed0">2.2. Access</a></li>
<li><a href="#org11cfca9">2.3. Computation</a></li>
<li><a href="#org2fa1d61">2.4. Creation</a></li>
<li><a href="#org4e9005b">2.5. Printers</a></li>
</ul>
</li>
<li><a href="#org6b9a069">3. Basis</a>
<li><a href="#org4261d95">3. Basis</a>
<ul>
<li><a href="#org68c3519">3.1. Polymorphic types</a></li>
<li><a href="#org5764372">3.2. Types</a></li>
<li><a href="#org6ea365f">3.3. Conversions</a></li>
<li><a href="#org867b16c">3.4. Access</a></li>
<li><a href="#orgf5a488a">3.5. Printers</a></li>
<li><a href="#org5c0d97e">3.1. Polymorphic types</a></li>
<li><a href="#orga5c49f9">3.2. Types</a></li>
<li><a href="#org08915ff">3.3. Conversions</a></li>
<li><a href="#org2d64081">3.4. Access</a></li>
<li><a href="#org71c045d">3.5. TREXIO</a>
<ul>
<li><a href="#orgaa1a673">3.5.1. Read</a></li>
<li><a href="#org96c21ab">3.5.2. Write</a></li>
</ul>
</li>
<li><a href="#org95b5bdd">3.6. Printers</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org10034f2" class="outline-2">
<h2 id="org10034f2"><span class="section-number-2">1</span> Summary</h2>
<div id="outline-container-org87cd388" class="outline-2">
<h2 id="org87cd388"><span class="section-number-2">1</span> Summary</h2>
<div class="outline-text-2" id="text-1">
<p>
This modules contains the data structures used to characterize the
@ -305,11 +311,11 @@ atomic basis set.
</div>
</div>
<div id="outline-container-org5474da5" class="outline-2">
<h2 id="org5474da5"><span class="section-number-2">2</span> Gaussian basis</h2>
<div id="outline-container-org5e9a951" class="outline-2">
<h2 id="org5e9a951"><span class="section-number-2">2</span> Gaussian basis</h2>
<div class="outline-text-2" id="text-2">
<p>
Data structure for Gaussian Atomic Orbitals:
Data structure for Gaussian Atomic Orbitals:
</p>
<p>
@ -324,27 +330,27 @@ nucleus \(A\).
</p>
</div>
<div id="outline-container-org7b7dfc2" class="outline-3">
<h3 id="org7b7dfc2"><span class="section-number-3">2.1</span> Type</h3>
<div id="outline-container-orgf171259" class="outline-3">
<h3 id="orgf171259"><span class="section-number-3">2.1</span> Type</h3>
<div class="outline-text-3" id="text-2-1">
<p>
<a id="org8bd4ea5"><code>Gaussian_basis.t</code></a>
<a id="org1e8ec27"><code>Gaussian_basis.t</code></a>
</p>
<div class="org-src-container">
<pre class="src src-ocaml" id="org5bf215b"><span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Common</span>
<pre class="src src-ocaml" id="org74d75c2"><span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Common</span>
<span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Particles</span>
<span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Linear_algebra</span>
<span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Gaussian_integrals</span>
<span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Operators</span>
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9115219" class="outline-3">
<h3 id="org9115219"><span class="section-number-3">2.2</span> Access</h3>
<div id="outline-container-orgb673ed0" class="outline-3">
<h3 id="orgb673ed0"><span class="section-number-3">2.2</span> Access</h3>
<div class="outline-text-3" id="text-2-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">basis</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Gaussian.Basis.</span>t
@ -435,8 +441,8 @@ nucleus \(A\).
</div>
</div>
<div id="outline-container-org7028216" class="outline-3">
<h3 id="org7028216"><span class="section-number-3">2.3</span> Computation</h3>
<div id="outline-container-org11cfca9" class="outline-3">
<h3 id="org11cfca9"><span class="section-number-3">2.3</span> Computation</h3>
<div class="outline-text-3" id="text-2-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">values</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span>
@ -463,8 +469,8 @@ nucleus \(A\).
</div>
</div>
<div id="outline-container-org1f24daa" class="outline-3">
<h3 id="org1f24daa"><span class="section-number-3">2.4</span> Creation</h3>
<div id="outline-container-org2fa1d61" class="outline-3">
<h3 id="org2fa1d61"><span class="section-number-3">2.4</span> Creation</h3>
<div class="outline-text-3" id="text-2-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">basis</span><span class="org-tuareg-font-lock-operator">:</span><span class="org-tuareg-font-lock-module">Gaussian.Basis.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span>
@ -491,15 +497,15 @@ Defaults:
<p>
Example:
</p>
<pre class="example" id="orgb9ea620">
<pre class="example" id="org6d35d9a">
let b = Ao.Basis_gaussian.make ~basis nuclei ;;
val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs
</pre>
</div>
</div>
<div id="outline-container-orge8bdd89" class="outline-3">
<h3 id="orge8bdd89"><span class="section-number-3">2.5</span> Printers</h3>
<div id="outline-container-org4e9005b" class="outline-3">
<h3 id="org4e9005b"><span class="section-number-3">2.5</span> Printers</h3>
<div class="outline-text-3" id="text-2-5">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -509,22 +515,22 @@ val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs
</div>
</div>
<div id="outline-container-org6b9a069" class="outline-2">
<h2 id="org6b9a069"><span class="section-number-2">3</span> Basis</h2>
<div id="outline-container-org4261d95" class="outline-2">
<h2 id="org4261d95"><span class="section-number-2">3</span> Basis</h2>
<div class="outline-text-2" id="text-3">
<p>
Data structure for Atomic Orbitals.
</p>
</div>
<div id="outline-container-org68c3519" class="outline-3">
<h3 id="org68c3519"><span class="section-number-3">3.1</span> Polymorphic types</h3>
<div id="outline-container-org5c0d97e" class="outline-3">
<h3 id="org5c0d97e"><span class="section-number-3">3.1</span> Polymorphic types</h3>
<div class="outline-text-3" id="text-3-1">
<p>
<a id="org221aabc"><code>Basis.t</code></a>
<a id="org4d89fcd"><code>Basis.t</code></a>
</p>
<div class="org-src-container">
<pre class="src src-ocaml" id="org7f2805d"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span>
<pre class="src src-ocaml" id="org628afe5"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span>
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Unknown</span>
<span class="org-tuareg-font-lock-operator">|</span> <span class="org-tuareg-font-lock-constructor">Gaussian</span> <span class="org-keyword">of</span> <span class="org-tuareg-font-lock-module">Basis_gaussian.</span>t
</pre>
@ -532,15 +538,15 @@ Data structure for Atomic Orbitals.
</div>
</div>
<div id="outline-container-org5764372" class="outline-3">
<h3 id="org5764372"><span class="section-number-3">3.2</span> Types</h3>
<div id="outline-container-orga5c49f9" class="outline-3">
<h3 id="orga5c49f9"><span class="section-number-3">3.2</span> Types</h3>
<div class="outline-text-3" id="text-3-2">
<p>
<a id="orgaf9bd07"><code>Basis.t</code></a>
<a id="org473035a"><code>Basis.t</code></a>
</p>
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">ao</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-module">Ao_dim.</span>t
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">ao</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-module">Ao_dim.</span>t
<span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Common</span>
<span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Particles</span>
@ -551,8 +557,8 @@ Data structure for Atomic Orbitals.
</div>
</div>
<div id="outline-container-org6ea365f" class="outline-3">
<h3 id="org6ea365f"><span class="section-number-3">3.3</span> Conversions</h3>
<div id="outline-container-org08915ff" class="outline-3">
<h3 id="org08915ff"><span class="section-number-3">3.3</span> Conversions</h3>
<div class="outline-text-3" id="text-3-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_nuclei_and_basis_filename</span> <span class="org-tuareg-font-lock-operator">:</span>
@ -593,15 +599,15 @@ Defaults:
<p>
Example:
</p>
<pre class="example" id="org65a225c">
<pre class="example" id="org101d41d">
let b = Ao.Basis.of_nuclei_and_basis_filename ~nuclei filename;;
val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
</pre>
</div>
</div>
<div id="outline-container-org867b16c" class="outline-3">
<h3 id="org867b16c"><span class="section-number-3">3.4</span> Access</h3>
<div id="outline-container-org2d64081" class="outline-3">
<h3 id="org2d64081"><span class="section-number-3">3.4</span> Access</h3>
<div class="outline-text-3" id="text-3-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">size</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> int
@ -699,9 +705,38 @@ val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
</div>
<div id="outline-container-orgf5a488a" class="outline-3">
<h3 id="orgf5a488a"><span class="section-number-3">3.5</span> Printers</h3>
<div id="outline-container-org71c045d" class="outline-3">
<h3 id="org71c045d"><span class="section-number-3">3.5</span> TREXIO</h3>
<div class="outline-text-3" id="text-3-5">
</div>
<div id="outline-container-orgaa1a673" class="outline-4">
<h4 id="orgaa1a673"><span class="section-number-4">3.5.1</span> Read</h4>
<div class="outline-text-4" id="text-3-5-1">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-comment-delimiter">(*</span>
<span class="org-comment">val of_trexio : Trexio.trexio_file -&gt; t</span>
<span class="org-comment-delimiter">*)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org96c21ab" class="outline-4">
<h4 id="org96c21ab"><span class="section-number-4">3.5.2</span> Write</h4>
<div class="outline-text-4" id="text-3-5-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-comment-delimiter">(*</span>
<span class="org-comment">val to_trexio : Trexio.trexio_file -&gt; t -&gt; unit</span>
<span class="org-comment-delimiter">*)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org95b5bdd" class="outline-3">
<h3 id="org95b5bdd"><span class="section-number-3">3.6</span> Printers</h3>
<div class="outline-text-3" id="text-3-6">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
</pre>
@ -712,7 +747,7 @@ val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
</div>
<div id="postamble" class="status">
<p class="author">Author: Anthony Scemama</p>
<p class="date">Created: 2021-01-28 Thu 00:21</p>
<p class="date">Created: 2023-04-24 Mon 18:06</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2023-04-20 Thu 12:08 -->
<!-- 2023-04-24 Mon 19:28 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Gaussian</title>
@ -272,41 +272,41 @@ org_html_manager.setup(); // activate after the parameters are set
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org00fe9a7">1. Summary</a></li>
<li><a href="#org31b1458">2. Atomic shell</a>
<li><a href="#org8752877">1. Summary</a></li>
<li><a href="#orgc12310c">2. Atomic shell</a>
<ul>
<li><a href="#org15c8121">2.1. Type</a></li>
<li><a href="#org027f81e">2.2. Access</a></li>
<li><a href="#org13bea39">2.3. Creation</a></li>
<li><a href="#org108fb3f">2.4. Printers</a></li>
<li><a href="#org3e413df">2.1. Type</a></li>
<li><a href="#orgaa9e5a8">2.2. Access</a></li>
<li><a href="#org40ea971">2.3. Creation</a></li>
<li><a href="#org76ce11e">2.4. Printers</a></li>
</ul>
</li>
<li><a href="#orgaf2dfc2">3. Atomic shell pair couple</a>
<li><a href="#org20ddf7f">3. Atomic shell pair couple</a>
<ul>
<li><a href="#org0916a22">3.1. Type</a></li>
<li><a href="#orgc512c60">3.2. Access</a></li>
<li><a href="#org2d070ca">3.3. Creation</a></li>
<li><a href="#org2ee4957">3.4. Printers</a></li>
<li><a href="#org79cc56e">3.1. Type</a></li>
<li><a href="#org2486daa">3.2. Access</a></li>
<li><a href="#org682c85c">3.3. Creation</a></li>
<li><a href="#org6d637d8">3.4. Printers</a></li>
</ul>
</li>
<li><a href="#org9e877d7">4. Atomic shell pair</a>
<li><a href="#orge37a5fe">4. Atomic shell pair</a>
<ul>
<li><a href="#org5c399ad">4.1. Type</a></li>
<li><a href="#orgaa52bf1">4.2. Access</a></li>
<li><a href="#orgbc5c6ac">4.3. Creation</a></li>
<li><a href="#orgbbed8e3">4.4. Printers</a></li>
<li><a href="#org791264a">4.1. Type</a></li>
<li><a href="#orge08787d">4.2. Access</a></li>
<li><a href="#org49ac790">4.3. Creation</a></li>
<li><a href="#orgb4a074f">4.4. Printers</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org00fe9a7" class="outline-2">
<h2 id="org00fe9a7"><span class="section-number-2">1</span> Summary</h2>
<div id="outline-container-org8752877" class="outline-2">
<h2 id="org8752877"><span class="section-number-2">1</span> Summary</h2>
</div>
<div id="outline-container-org31b1458" class="outline-2">
<h2 id="org31b1458"><span class="section-number-2">2</span> Atomic shell</h2>
<div id="outline-container-orgc12310c" class="outline-2">
<h2 id="orgc12310c"><span class="section-number-2">2</span> Atomic shell</h2>
<div class="outline-text-2" id="text-2">
<p>
Set of contracted Gaussians differing only by the powers of \(x\), \(y\) and \(z\), with a
@ -339,8 +339,8 @@ particular powers of \(x,y,z\) (<code>PrimitiveShell.norm_coef_scale</code>)</li
</div>
<div id="outline-container-org15c8121" class="outline-3">
<h3 id="org15c8121"><span class="section-number-3">2.1</span> Type</h3>
<div id="outline-container-org3e413df" class="outline-3">
<h3 id="org3e413df"><span class="section-number-3">2.1</span> Type</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
@ -351,8 +351,8 @@ particular powers of \(x,y,z\) (<code>PrimitiveShell.norm_coef_scale</code>)</li
</div>
</div>
<div id="outline-container-org027f81e" class="outline-3">
<h3 id="org027f81e"><span class="section-number-3">2.2</span> Access</h3>
<div id="outline-container-orgaa9e5a8" class="outline-3">
<h3 id="orgaa9e5a8"><span class="section-number-3">2.2</span> Access</h3>
<div class="outline-text-3" id="text-2-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">ang_mom</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Angular_momentum.</span>t
@ -429,14 +429,14 @@ particular powers of \(x,y,z\) (<code>PrimitiveShell.norm_coef_scale</code>)</li
</tbody>
</table>
<pre class="example" id="orgbb6756e">
<pre class="example" id="orgd663d82">
</pre>
</div>
</div>
<div id="outline-container-org13bea39" class="outline-3">
<h3 id="org13bea39"><span class="section-number-3">2.3</span> Creation</h3>
<div id="outline-container-org40ea971" class="outline-3">
<h3 id="org40ea971"><span class="section-number-3">2.3</span> Creation</h3>
<div class="outline-text-3" id="text-2-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">?index</span><span class="org-tuareg-font-lock-operator">:</span>int <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Contracted_shell.</span>t array <span class="org-tuareg-font-lock-operator">-&gt;</span> t
@ -468,8 +468,8 @@ particular powers of \(x,y,z\) (<code>PrimitiveShell.norm_coef_scale</code>)</li
</div>
</div>
<div id="outline-container-org108fb3f" class="outline-3">
<h3 id="org108fb3f"><span class="section-number-3">2.4</span> Printers</h3>
<div id="outline-container-org76ce11e" class="outline-3">
<h3 id="org76ce11e"><span class="section-number-3">2.4</span> Printers</h3>
<div class="outline-text-3" id="text-2-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -479,8 +479,8 @@ particular powers of \(x,y,z\) (<code>PrimitiveShell.norm_coef_scale</code>)</li
</div>
</div>
<div id="outline-container-orgaf2dfc2" class="outline-2">
<h2 id="orgaf2dfc2"><span class="section-number-2">3</span> Atomic shell pair couple</h2>
<div id="outline-container-org20ddf7f" class="outline-2">
<h2 id="org20ddf7f"><span class="section-number-2">3</span> Atomic shell pair couple</h2>
<div class="outline-text-2" id="text-3">
<p>
An atomic shell pair couple is the cartesian product between two sets of functions, one
@ -496,8 +496,8 @@ acting on different electrons, since they will be coupled by a two-electron oper
</div>
<div id="outline-container-org0916a22" class="outline-3">
<h3 id="org0916a22"><span class="section-number-3">3.1</span> Type</h3>
<div id="outline-container-org79cc56e" class="outline-3">
<h3 id="org79cc56e"><span class="section-number-3">3.1</span> Type</h3>
<div class="outline-text-3" id="text-3-1">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
@ -508,8 +508,8 @@ acting on different electrons, since they will be coupled by a two-electron oper
</div>
</div>
<div id="outline-container-orgc512c60" class="outline-3">
<h3 id="orgc512c60"><span class="section-number-3">3.2</span> Access</h3>
<div id="outline-container-org2486daa" class="outline-3">
<h3 id="org2486daa"><span class="section-number-3">3.2</span> Access</h3>
<div class="outline-text-3" id="text-3-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">ang_mom</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Angular_momentum.</span>t
@ -594,8 +594,8 @@ acting on different electrons, since they will be coupled by a two-electron oper
</div>
</div>
<div id="outline-container-org2d070ca" class="outline-3">
<h3 id="org2d070ca"><span class="section-number-3">3.3</span> Creation</h3>
<div id="outline-container-org682c85c" class="outline-3">
<h3 id="org682c85c"><span class="section-number-3">3.3</span> Creation</h3>
<div class="outline-text-3" id="text-3-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">?cutoff</span><span class="org-tuareg-font-lock-operator">:</span>float <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Atomic_shell_pair.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Atomic_shell_pair.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> t option
@ -621,14 +621,14 @@ Default cutoff is \(\epsilon\).
</tbody>
</table>
<pre class="example" id="org3be7e29">
<pre class="example" id="orgff2a8ea">
</pre>
</div>
</div>
<div id="outline-container-org2ee4957" class="outline-3">
<h3 id="org2ee4957"><span class="section-number-3">3.4</span> Printers</h3>
<div id="outline-container-org6d637d8" class="outline-3">
<h3 id="org6d637d8"><span class="section-number-3">3.4</span> Printers</h3>
<div class="outline-text-3" id="text-3-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -638,8 +638,8 @@ Default cutoff is \(\epsilon\).
</div>
</div>
<div id="outline-container-org9e877d7" class="outline-2">
<h2 id="org9e877d7"><span class="section-number-2">4</span> Atomic shell pair</h2>
<div id="outline-container-orge37a5fe" class="outline-2">
<h2 id="orge37a5fe"><span class="section-number-2">4</span> Atomic shell pair</h2>
<div class="outline-text-2" id="text-4">
<p>
Data structure to represent pairs of atomic shells. The products of
@ -651,8 +651,8 @@ An atomic shell pair is an array of pairs of contracted shells.
</p>
</div>
<div id="outline-container-org5c399ad" class="outline-3">
<h3 id="org5c399ad"><span class="section-number-3">4.1</span> Type</h3>
<div id="outline-container-org791264a" class="outline-3">
<h3 id="org791264a"><span class="section-number-3">4.1</span> Type</h3>
<div class="outline-text-3" id="text-4-1">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
@ -663,8 +663,8 @@ An atomic shell pair is an array of pairs of contracted shells.
</div>
</div>
<div id="outline-container-orgaa52bf1" class="outline-3">
<h3 id="orgaa52bf1"><span class="section-number-3">4.2</span> Access</h3>
<div id="outline-container-orge08787d" class="outline-3">
<h3 id="orge08787d"><span class="section-number-3">4.2</span> Access</h3>
<div class="outline-text-3" id="text-4-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">atomic_shell_a</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Atomic_shell.</span>t
@ -731,8 +731,8 @@ An atomic shell pair is an array of pairs of contracted shells.
</div>
</div>
<div id="outline-container-orgbc5c6ac" class="outline-3">
<h3 id="orgbc5c6ac"><span class="section-number-3">4.3</span> Creation</h3>
<div id="outline-container-org49ac790" class="outline-3">
<h3 id="org49ac790"><span class="section-number-3">4.3</span> Creation</h3>
<div class="outline-text-3" id="text-4-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">make</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-label">?cutoff</span><span class="org-tuareg-font-lock-operator">:</span>float <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Atomic_shell.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Atomic_shell.</span>t <span class="org-tuareg-font-lock-operator">-&gt;</span> t option
@ -765,8 +765,8 @@ If an atomic shell pair is not significant, sets the value to <code>None</code>.
</div>
</div>
<div id="outline-container-orgbbed8e3" class="outline-3">
<h3 id="orgbbed8e3"><span class="section-number-3">4.4</span> Printers</h3>
<div id="outline-container-orgb4a074f" class="outline-3">
<h3 id="orgb4a074f"><span class="section-number-3">4.4</span> Printers</h3>
<div class="outline-text-3" id="text-4-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -778,7 +778,7 @@ If an atomic shell pair is not significant, sets the value to <code>None</code>.
</div>
<div id="postamble" class="status">
<p class="author">Author: Anthony Scemama</p>
<p class="date">Created: 2023-04-20 Thu 12:08</p>
<p class="date">Created: 2023-04-24 Mon 19:28</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2023-04-24 Mon 14:13 -->
<!-- 2023-04-24 Mon 18:07 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Common</title>
@ -272,75 +272,81 @@ org_html_manager.setup(); // activate after the parameters are set
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org92842ff">1. Summary</a></li>
<li><a href="#org95eedad">2. Electrons</a>
<li><a href="#org6df3964">1. Summary</a></li>
<li><a href="#org5753373">2. Electrons</a>
<ul>
<li><a href="#orgf75fa70">2.1. Type</a></li>
<li><a href="#org9262d69">2.2. Creation</a></li>
<li><a href="#orgeb0efdb">2.3. Access</a></li>
<li><a href="#orgc5d7da2">2.4. Printers</a></li>
<li><a href="#org01f21a7">2.5. Tests</a></li>
<li><a href="#org25fbdd2">2.1. Type</a></li>
<li><a href="#org5d0f6c5">2.2. Creation</a></li>
<li><a href="#org6c90a8b">2.3. Access</a></li>
<li><a href="#orgd40dbf2">2.4. Printers</a></li>
<li><a href="#org20072b6">2.5. Tests</a></li>
</ul>
</li>
<li><a href="#org7557361">3. Element</a>
<li><a href="#orgb411aa8">3. Element</a>
<ul>
<li><a href="#orgf4dc2b6">3.1. Type</a></li>
<li><a href="#orgbea9201">3.2. Conversion</a></li>
<li><a href="#orge438c8d">3.3. Database information</a></li>
<li><a href="#org28ea54a">3.4. Printers</a></li>
<li><a href="#org7b29939">3.1. Type</a></li>
<li><a href="#org46b8b47">3.2. Conversion</a></li>
<li><a href="#org1d70546">3.3. Database information</a></li>
<li><a href="#orgd5738cc">3.4. Printers</a></li>
</ul>
</li>
<li><a href="#org6ec0e5e">4. Atomic mass</a></li>
<li><a href="#org031ab3f">5. Nuclei</a>
<li><a href="#org61359db">4. Atomic mass</a></li>
<li><a href="#org3653358">5. Nuclei</a>
<ul>
<li><a href="#org0fe10a2">5.1. Type</a></li>
<li><a href="#org3736125">5.2. xyz file lexer/parser</a>
<li><a href="#orgdc5c638">5.1. Type</a></li>
<li><a href="#org795558e">5.2. xyz file lexer/parser</a>
<ul>
<li><a href="#orgf7fe255">5.2.1. Lexer</a></li>
<li><a href="#orgc547fcc">5.2.2. Parser</a></li>
<li><a href="#orgfa3e0b9">5.2.1. Lexer</a></li>
<li><a href="#orge4240df">5.2.2. Parser</a></li>
</ul>
</li>
<li><a href="#orgaff8d5e">5.3. Conversion</a></li>
<li><a href="#org4945fbb">5.4. Query</a></li>
<li><a href="#org07c7257">5.5. Printers</a></li>
<li><a href="#org738de5a">5.6. Tests</a></li>
<li><a href="#orgfe57c35">5.3. Conversion</a></li>
<li><a href="#org14de381">5.4. Query</a></li>
<li><a href="#org9224cc6">5.5. TREXIO</a>
<ul>
<li><a href="#org7046b2a">5.5.1. Read</a></li>
<li><a href="#orgd1b3675">5.5.2. Write</a></li>
</ul>
</li>
<li><a href="#orgd367ac4">6. Z-matrix</a>
<li><a href="#org3ece660">5.6. Printers</a></li>
<li><a href="#org6a90479">5.7. Tests</a></li>
</ul>
</li>
<li><a href="#org46003da">6. Z-matrix</a>
<ul>
<li><a href="#org80345d7">6.1. Type</a></li>
<li><a href="#org59c1dba">6.2. Conversion</a></li>
<li><a href="#org0bb6924">6.3. Printers</a></li>
<li><a href="#org5fcb7ed">6.1. Type</a></li>
<li><a href="#orga6c6d0e">6.2. Conversion</a></li>
<li><a href="#org37a7c2e">6.3. Printers</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org92842ff" class="outline-2">
<h2 id="org92842ff"><span class="section-number-2">1</span> Summary</h2>
<div id="outline-container-org6df3964" class="outline-2">
<h2 id="org6df3964"><span class="section-number-2">1</span> Summary</h2>
</div>
<div id="outline-container-org95eedad" class="outline-2">
<h2 id="org95eedad"><span class="section-number-2">2</span> Electrons</h2>
<div id="outline-container-org5753373" class="outline-2">
<h2 id="org5753373"><span class="section-number-2">2</span> Electrons</h2>
<div class="outline-text-2" id="text-2">
<p>
Data structure which contains the number of &alpha; and &beta; electrons.
</p>
</div>
<div id="outline-container-orgf75fa70" class="outline-3">
<h3 id="orgf75fa70"><span class="section-number-3">2.1</span> Type</h3>
<div id="outline-container-org25fbdd2" class="outline-3">
<h3 id="org25fbdd2"><span class="section-number-3">2.1</span> Type</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-ocaml" id="orgb42d55c"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
<pre class="src src-ocaml" id="org59c86ec"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9262d69" class="outline-3">
<h3 id="org9262d69"><span class="section-number-3">2.2</span> Creation</h3>
<div id="outline-container-org5d0f6c5" class="outline-3">
<h3 id="org5d0f6c5"><span class="section-number-3">2.2</span> Creation</h3>
<div class="outline-text-3" id="text-2-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Common</span>
@ -372,15 +378,15 @@ Data structure which contains the number of &alpha; and &beta; electrons.
<tr>
<td class="org-left"><code>of_atoms</code></td>
<td class="org-left">Creates the data relative to electrons for a molecular system described by <a href="#org9b1494e"><code>Nuclei.t</code></a> for a given total charge and spin multiplicity.</td>
<td class="org-left">Creates the data relative to electrons for a molecular system described by <a href="#org1056889"><code>Nuclei.t</code></a> for a given total charge and spin multiplicity.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgeb0efdb" class="outline-3">
<h3 id="orgeb0efdb"><span class="section-number-3">2.3</span> Access</h3>
<div id="outline-container-org6c90a8b" class="outline-3">
<h3 id="org6c90a8b"><span class="section-number-3">2.3</span> Access</h3>
<div class="outline-text-3" id="text-2-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">charge</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Charge.</span>t
@ -429,8 +435,8 @@ Data structure which contains the number of &alpha; and &beta; electrons.
</div>
</div>
<div id="outline-container-orgc5d7da2" class="outline-3">
<h3 id="orgc5d7da2"><span class="section-number-3">2.4</span> Printers</h3>
<div id="outline-container-orgd40dbf2" class="outline-3">
<h3 id="orgd40dbf2"><span class="section-number-3">2.4</span> Printers</h3>
<div class="outline-text-3" id="text-2-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -439,24 +445,24 @@ Data structure which contains the number of &alpha; and &beta; electrons.
</div>
</div>
<div id="outline-container-org01f21a7" class="outline-3">
<h3 id="org01f21a7"><span class="section-number-3">2.5</span> Tests</h3>
<div id="outline-container-org20072b6" class="outline-3">
<h3 id="org20072b6"><span class="section-number-3">2.5</span> Tests</h3>
</div>
</div>
<div id="outline-container-org7557361" class="outline-2">
<h2 id="org7557361"><span class="section-number-2">3</span> Element</h2>
<div id="outline-container-orgb411aa8" class="outline-2">
<h2 id="orgb411aa8"><span class="section-number-2">3</span> Element</h2>
<div class="outline-text-2" id="text-3">
<p>
Chemical elements.
</p>
</div>
<div id="outline-container-orgf4dc2b6" class="outline-3">
<h3 id="orgf4dc2b6"><span class="section-number-3">3.1</span> Type</h3>
<div id="outline-container-org7b29939" class="outline-3">
<h3 id="org7b29939"><span class="section-number-3">3.1</span> Type</h3>
<div class="outline-text-3" id="text-3-1">
<div class="org-src-container">
<pre class="src src-ocaml" id="org80a6f80"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span>
<pre class="src src-ocaml" id="org088d0e5"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span>
<span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">X</span>
<span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">H</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">He</span>
<span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">Li</span><span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">Be</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">B</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">C</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">N</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">O</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">F</span> <span class="org-tuareg-font-lock-operator">|</span><span class="org-tuareg-font-lock-constructor">Ne</span>
@ -473,8 +479,8 @@ Chemical elements.
</div>
</div>
<div id="outline-container-orgbea9201" class="outline-3">
<h3 id="orgbea9201"><span class="section-number-3">3.2</span> Conversion</h3>
<div id="outline-container-org46b8b47" class="outline-3">
<h3 id="org46b8b47"><span class="section-number-3">3.2</span> Conversion</h3>
<div class="outline-text-3" id="text-3-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_string</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-&gt;</span> t
@ -535,7 +541,7 @@ Chemical elements.
</tbody>
</table>
<pre class="example" id="orgaeff9b7">
<pre class="example" id="org3545bb2">
Element.of_string "Fe" ;;
- : Element.t = Particles.Element.Fe
@ -554,8 +560,8 @@ Element.(to_string Fe);;
</div>
</div>
<div id="outline-container-orge438c8d" class="outline-3">
<h3 id="orge438c8d"><span class="section-number-3">3.3</span> Database information</h3>
<div id="outline-container-org1d70546" class="outline-3">
<h3 id="org1d70546"><span class="section-number-3">3.3</span> Database information</h3>
<div class="outline-text-3" id="text-3-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">covalent_radius</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> <span class="org-tuareg-font-lock-module">Non_negative_float.</span>t
@ -604,8 +610,8 @@ Element.(to_string Fe);;
</div>
</div>
<div id="outline-container-org28ea54a" class="outline-3">
<h3 id="org28ea54a"><span class="section-number-3">3.4</span> Printers</h3>
<div id="outline-container-orgd5738cc" class="outline-3">
<h3 id="orgd5738cc"><span class="section-number-3">3.4</span> Printers</h3>
<div class="outline-text-3" id="text-3-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -616,34 +622,34 @@ Element.(to_string Fe);;
</div>
</div>
<div id="outline-container-org6ec0e5e" class="outline-2">
<h2 id="org6ec0e5e"><span class="section-number-2">4</span> Atomic mass</h2>
<div id="outline-container-org61359db" class="outline-2">
<h2 id="org61359db"><span class="section-number-2">4</span> Atomic mass</h2>
<div class="outline-text-2" id="text-4">
<p>
Atomic mass, a non-negative float.
</p>
<div class="org-src-container">
<pre class="src src-ocaml" id="orge6ec335"><span class="org-tuareg-font-lock-governing">include</span> <span class="org-tuareg-font-lock-governing">module type of</span> <span class="org-tuareg-font-lock-module">Common.Non_negative_float</span>
<pre class="src src-ocaml" id="orgff86835"><span class="org-tuareg-font-lock-governing">include</span> <span class="org-tuareg-font-lock-governing">module type of</span> <span class="org-tuareg-font-lock-module">Common.Non_negative_float</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org031ab3f" class="outline-2">
<h2 id="org031ab3f"><span class="section-number-2">5</span> Nuclei</h2>
<div id="outline-container-org3653358" class="outline-2">
<h2 id="org3653358"><span class="section-number-2">5</span> Nuclei</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-org0fe10a2" class="outline-3">
<h3 id="org0fe10a2"><span class="section-number-3">5.1</span> Type</h3>
<div id="outline-container-orgdc5c638" class="outline-3">
<h3 id="orgdc5c638"><span class="section-number-3">5.1</span> Type</h3>
<div class="outline-text-3" id="text-5-1">
<p>
<a id="org9b1494e"><code>Nuclei.t</code></a>
<a id="org1056889"><code>Nuclei.t</code></a>
</p>
<div class="org-src-container">
<pre class="src src-ocaml" id="org39d5b90"><span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Common</span>
<pre class="src src-ocaml" id="org5d75f82"><span class="org-tuareg-font-lock-governing">open </span><span class="org-tuareg-font-lock-module">Common</span>
<span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span> <span class="org-tuareg-font-lock-operator">=</span> <span class="org-tuareg-font-lock-operator">(</span><span class="org-tuareg-font-lock-module">Element.</span>t <span class="org-tuareg-font-lock-operator">*</span> <span class="org-tuareg-font-lock-module">Coordinate.</span>t<span class="org-tuareg-font-lock-operator">)</span> array
</pre>
@ -651,12 +657,12 @@ Atomic mass, a non-negative float.
</div>
</div>
<div id="outline-container-org3736125" class="outline-3">
<h3 id="org3736125"><span class="section-number-3">5.2</span> xyz file lexer/parser</h3>
<div id="outline-container-org795558e" class="outline-3">
<h3 id="org795558e"><span class="section-number-3">5.2</span> xyz file lexer/parser</h3>
<div class="outline-text-3" id="text-5-2">
</div>
<div id="outline-container-orgf7fe255" class="outline-4">
<h4 id="orgf7fe255"><span class="section-number-4">5.2.1</span> Lexer</h4>
<div id="outline-container-orgfa3e0b9" class="outline-4">
<h4 id="orgfa3e0b9"><span class="section-number-4">5.2.1</span> Lexer</h4>
<div class="outline-text-4" id="text-5-2-1">
<p>
<code>nuclei_lexer.mll</code> contains the description of the lexemes used in
@ -709,11 +715,11 @@ rule read_all <span class="org-tuareg-font-lock-operator">=</span> parse
</div>
</div>
<div id="outline-container-orgc547fcc" class="outline-4">
<h4 id="orgc547fcc"><span class="section-number-4">5.2.2</span> Parser</h4>
<div id="outline-container-orge4240df" class="outline-4">
<h4 id="orge4240df"><span class="section-number-4">5.2.2</span> Parser</h4>
<div class="outline-text-4" id="text-5-2-2">
<p>
<code>xyz_parser.mly</code> parses nuclear coordinates in xyz format.
<code>xyz_parser.mly</code> parses nuclear coordinates in xyz format.
</p>
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-operator">%{</span>
@ -829,8 +835,8 @@ an <code>xyz_file</code> data structure.
</div>
</div>
<div id="outline-container-orgaff8d5e" class="outline-3">
<h3 id="orgaff8d5e"><span class="section-number-3">5.3</span> Conversion</h3>
<div id="outline-container-orgfe57c35" class="outline-3">
<h3 id="orgfe57c35"><span class="section-number-3">5.3</span> Conversion</h3>
<div class="outline-text-3" id="text-5-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_xyz_string</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-&gt;</span> t
@ -843,9 +849,6 @@ an <code>xyz_file</code> data structure.
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_string</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> string
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_filename</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-&gt;</span> t
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_trexio</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Trexio.</span>trexio_file <span class="org-tuareg-font-lock-operator">-&gt;</span> t
<span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_trexio</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Trexio.</span>trexio_file <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
</pre>
</div>
@ -887,23 +890,13 @@ an <code>xyz_file</code> data structure.
<td class="org-left"><code>of_filename</code></td>
<td class="org-left">Detects the type of file (xyz, z-matrix) and reads the file</td>
</tr>
<tr>
<td class="org-left"><code>of_trexio</code></td>
<td class="org-left">Reads the geometry from a TREXIO file</td>
</tr>
<tr>
<td class="org-left"><code>to_trexio</code></td>
<td class="org-left">Writes the geometry in a TREXIO file</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-org4945fbb" class="outline-3">
<h3 id="org4945fbb"><span class="section-number-3">5.4</span> Query</h3>
<div id="outline-container-org14de381" class="outline-3">
<h3 id="org14de381"><span class="section-number-3">5.4</span> Query</h3>
<div class="outline-text-3" id="text-5-4">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">formula</span> <span class="org-tuareg-font-lock-operator">:</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> string
@ -952,9 +945,34 @@ an <code>xyz_file</code> data structure.
</div>
</div>
<div id="outline-container-org07c7257" class="outline-3">
<h3 id="org07c7257"><span class="section-number-3">5.5</span> Printers</h3>
<div id="outline-container-org9224cc6" class="outline-3">
<h3 id="org9224cc6"><span class="section-number-3">5.5</span> TREXIO</h3>
<div class="outline-text-3" id="text-5-5">
</div>
<div id="outline-container-org7046b2a" class="outline-4">
<h4 id="org7046b2a"><span class="section-number-4">5.5.1</span> Read</h4>
<div class="outline-text-4" id="text-5-5-1">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_trexio</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Trexio.</span>trexio_file <span class="org-tuareg-font-lock-operator">-&gt;</span> t
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd1b3675" class="outline-4">
<h4 id="orgd1b3675"><span class="section-number-4">5.5.2</span> Write</h4>
<div class="outline-text-4" id="text-5-5-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">to_trexio</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Trexio.</span>trexio_file <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org3ece660" class="outline-3">
<h3 id="org3ece660"><span class="section-number-3">5.6</span> Printers</h3>
<div class="outline-text-3" id="text-5-6">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
</pre>
@ -962,31 +980,31 @@ an <code>xyz_file</code> data structure.
</div>
</div>
<div id="outline-container-org738de5a" class="outline-3">
<h3 id="org738de5a"><span class="section-number-3">5.6</span> Tests</h3>
<div id="outline-container-org6a90479" class="outline-3">
<h3 id="org6a90479"><span class="section-number-3">5.7</span> Tests</h3>
</div>
</div>
<div id="outline-container-orgd367ac4" class="outline-2">
<h2 id="orgd367ac4"><span class="section-number-2">6</span> Z-matrix</h2>
<div id="outline-container-org46003da" class="outline-2">
<h2 id="org46003da"><span class="section-number-2">6</span> Z-matrix</h2>
<div class="outline-text-2" id="text-6">
<p>
Z-matrix representation of nuclear coordinates.
</p>
</div>
<div id="outline-container-org80345d7" class="outline-3">
<h3 id="org80345d7"><span class="section-number-3">6.1</span> Type</h3>
<div id="outline-container-org5fcb7ed" class="outline-3">
<h3 id="org5fcb7ed"><span class="section-number-3">6.1</span> Type</h3>
<div class="outline-text-3" id="text-6-1">
<div class="org-src-container">
<pre class="src src-ocaml" id="org4f1052d"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
<pre class="src src-ocaml" id="orgf9db5fa"><span class="org-tuareg-font-lock-governing">type</span> <span class="org-type">t</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org59c1dba" class="outline-3">
<h3 id="org59c1dba"><span class="section-number-3">6.2</span> Conversion</h3>
<div id="outline-container-orga6c6d0e" class="outline-3">
<h3 id="orga6c6d0e"><span class="section-number-3">6.2</span> Conversion</h3>
<div class="outline-text-3" id="text-6-2">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">of_string</span> <span class="org-tuareg-font-lock-operator">:</span> string <span class="org-tuareg-font-lock-operator">-&gt;</span> t
@ -1021,7 +1039,7 @@ Z-matrix representation of nuclear coordinates.
</tbody>
</table>
<pre class="example" id="org5705752">
<pre class="example" id="org7e18520">
let zmt = Zmatrix.of_string "
n
n 1 nn
@ -1066,8 +1084,8 @@ H -0.568803 -0.793910 1.726048"
</div>
<div id="outline-container-org0bb6924" class="outline-3">
<h3 id="org0bb6924"><span class="section-number-3">6.3</span> Printers</h3>
<div id="outline-container-org37a7c2e" class="outline-3">
<h3 id="org37a7c2e"><span class="section-number-3">6.3</span> Printers</h3>
<div class="outline-text-3" id="text-6-3">
<div class="org-src-container">
<pre class="src src-ocaml"><span class="org-tuareg-font-lock-governing">val</span> <span class="org-function-name">pp</span> <span class="org-tuareg-font-lock-operator">:</span> <span class="org-tuareg-font-lock-module">Format.</span>formatter <span class="org-tuareg-font-lock-operator">-&gt;</span> t <span class="org-tuareg-font-lock-operator">-&gt;</span> unit
@ -1079,7 +1097,7 @@ H -0.568803 -0.793910 1.726048"
</div>
<div id="postamble" class="status">
<p class="author">Author: Anthony Scemama</p>
<p class="date">Created: 2023-04-24 Mon 14:13</p>
<p class="date">Created: 2023-04-24 Mon 18:07</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2023-04-24 Mon 14:13 -->
<!-- 2023-04-24 Mon 19:28 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Top-level</title>
@ -250,18 +250,18 @@ org_html_manager.setup(); // activate after the parameters are set
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgf7c1e66">1. Summary</a></li>
<li><a href="#orgab35359">1. Summary</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgf7c1e66" class="outline-2">
<h2 id="orgf7c1e66"><span class="section-number-2">1</span> Summary</h2>
<div id="outline-container-orgab35359" class="outline-2">
<h2 id="orgab35359"><span class="section-number-2">1</span> Summary</h2>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Anthony Scemama</p>
<p class="date">Created: 2023-04-24 Mon 14:13</p>
<p class="date">Created: 2023-04-24 Mon 19:28</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -1,4 +1,4 @@
type t =
type t =
{
size : int;
contracted_shells : Contracted_shell.t array ;
@ -16,11 +16,11 @@ let general_basis t = t.general_basis
(** Returns an array of the basis set per atom *)
let of_nuclei_and_general_basis nucl bas =
let index_ = ref 0 in
let contracted_shells =
let contracted_shells =
Array.map (fun (e, center) ->
List.assoc e bas
|> Array.map (fun (ang_mom, shell) ->
let lc =
let lc =
Array.map (fun Gb.{exponent ; coefficient} ->
coefficient, Ps.make ang_mom center exponent) shell
in
@ -38,11 +38,11 @@ let of_nuclei_and_general_basis nucl bas =
|> Array.to_list
|> List.sort_uniq compare
in
let csl =
let csl =
Array.to_list contracted_shells
in
List.map (fun (center, ang_mom) ->
let a =
let a =
List.filter (fun x -> Cs.center x = center && Cs.ang_mom x = ang_mom) csl
|> Array.of_list
in
@ -65,7 +65,7 @@ let to_string b =
let b = atomic_shells b in
let line ="
-----------------------------------------------------------------------
" in
" in
"
Atomic Basis set
----------------
@ -85,26 +85,105 @@ let to_string b =
let of_nuclei_and_basis_filename ~nuclei filename =
let general_basis =
let of_nuclei_and_basis_filename ~nuclei filename =
let general_basis =
General_basis.read filename
in
of_nuclei_and_general_basis nuclei general_basis
let of_nuclei_and_basis_string ~nuclei str =
let general_basis =
let of_nuclei_and_basis_string ~nuclei str =
let general_basis =
General_basis.of_string str
in
of_nuclei_and_general_basis nuclei general_basis
let of_nuclei_and_basis_filenames ~nuclei filenames =
let general_basis =
let of_nuclei_and_basis_filenames ~nuclei filenames =
let general_basis =
General_basis.read_many filenames
in
of_nuclei_and_general_basis nuclei general_basis
let of_trexio f =
let nuclei = Particles.Nuclei.of_trexio f in
(*
let nucl_num = Array.length nuclei in
let prim_num = Trexio.read_basis_prim_num f in
let shell_num = Trexio.read_basis_shell_num f in
let shell_factor = Trexio.read_basis_shell_factor f in
let prim_factor = Trexio.read_basis_prim_factor f in
*)
let shell_ang_mom = Trexio.read_basis_shell_ang_mom f
|> Array.map Common.Angular_momentum.of_int
in
let shell_index = Trexio.read_basis_shell_index f
|> Array.to_list
in
let nucleus_index = Trexio.read_basis_nucleus_index f
|> Array.to_list
in
let exponent = Trexio.read_basis_exponent f in
let coefficient = Trexio.read_basis_coefficient f in
let filter_indices ref_index full_array =
List.mapi (fun j idx ->
if idx = ref_index then Some j
else None) full_array
|> List.filter (function
| None -> false
| _ -> true)
|> List.map (function
| Some x -> x
| None -> assert false)
in
let index_ = ref 0 in
let contracted_shells =
Array.mapi (fun i (_,center) ->
let shell_indices = filter_indices i nucleus_index in
List.map (fun ishell ->
let prim_indices = filter_indices ishell shell_index in
let lc = List.map (fun k ->
coefficient.(k),
Ps.make shell_ang_mom.(ishell) center exponent.(k)) prim_indices
|> Array.of_list
in
let result = Cs.make ~index:!index_ lc in
index_ := !index_ + Cs.size_of_shell result;
result
) shell_indices
|> Array.of_list
) nuclei
|> Array.to_list
|> Array.concat
in
let atomic_shells = lazy(
let uniq_center_angmom =
Array.map (fun x -> Cs.center x, Cs.ang_mom x) contracted_shells
|> Array.to_list
|> List.sort_uniq compare
in
let csl =
Array.to_list contracted_shells
in
List.map (fun (center, ang_mom) ->
let a =
List.filter (fun x -> Cs.center x = center && Cs.ang_mom x = ang_mom) csl
|> Array.of_list
in
As.make ~index:(Cs.index a.(0)) a
) uniq_center_angmom
|> List.sort (fun x y -> compare (As.index x) (As.index y))
|> Array.of_list
) in
{ contracted_shells ; atomic_shells ; size = !index_;
general_basis = [];
}
let to_trexio _ _ =
()
let pp ppf t =
Format.fprintf ppf "@[%s@]" (to_string t)

View File

@ -42,6 +42,13 @@ val contracted_shells : t -> Contracted_shell.t array
val general_basis : t -> General_basis.t
(** Returns the [!GeneralBasis] that was used to build the current basis. *)
(** {TREXIO} *)
val of_trexio : Trexio.trexio_file -> t
val to_trexio : Trexio.trexio_file -> t -> unit
(** {2 Printers} *)
val to_string : t -> string

View File

@ -12,20 +12,18 @@ open Xyz_ast
* | ~of_zmt_string~ | Create from a string, in z-matrix format |
* | ~of_zmt_file~ | Create from a file, in z-matrix format |
* | ~to_string~ | Transform to a string, for printing |
* | ~of_filename~ | Detects the type of file (xyz, z-matrix) and reads the file |
* | ~of_trexio~ | Reads the geometry from a TREXIO file |
* | ~to_trexio~ | Writes the geometry in a TREXIO file | *)
* | ~of_filename~ | Detects the type of file (xyz, z-matrix) and reads the file | *)
(* [[file:~/QCaml/particles/nuclei.org::*Conversion][Conversion:2]] *)
let of_xyz_lexbuf lexbuf =
let data =
let data =
Xyz_parser.input Nuclei_lexer.read_all lexbuf
in
let len = List.length data.nuclei in
if len <> data.number_of_atoms then
Printf.sprintf "Error: expected %d atoms but %d read"
Printf.sprintf "Error: expected %d atoms but %d read"
data.number_of_atoms len
|> failwith;
@ -35,7 +33,7 @@ let of_xyz_lexbuf lexbuf =
|> Array.of_list
let of_xyz_string input_string =
let of_xyz_string input_string =
Lexing.from_string input_string
|> of_xyz_lexbuf
@ -45,7 +43,7 @@ let of_xyz_file filename =
let lexbuf =
Lexing.from_channel ic
in
let result =
let result =
of_xyz_lexbuf lexbuf
in
close_in ic;
@ -90,7 +88,7 @@ let to_string atoms =
bohr_to_angstrom coord
in
Printf.sprintf " %5d %5d %5s %12.6f %12.6f %12.6f"
(i+1) (Element.to_int e) (Element.to_string e)
(i+1) (Element.to_int e) (Element.to_string e)
coord.x coord.y coord.z
) atoms
|> Array.to_list
@ -114,22 +112,9 @@ let to_xyz_string t =
in
Printf.sprintf " %5s %12.6f %12.6f %12.6f"
(Element.to_string e) coord.x coord.y coord.z
) t
) t
|> Array.to_list )
|> String.concat "\n"
let of_trexio f =
let num = Trexio.read_nucleus_num f in
let charge = Trexio.read_nucleus_charge f
|> Array.map Charge.of_float in
let coord = Trexio.read_nucleus_coord f in
Array.init num (fun i ->
let coord = Coordinate.{ x = coord.(3*i) ;
y = coord.(3*i+1) ;
z = coord.(3*i+2) } in
(Element.of_charge charge.(i), Coordinate.make coord)
)
(* Conversion:2 ends here *)
@ -160,14 +145,14 @@ let formula t =
accu ^ key ^ "_{" ^ (string_of_int x) ^ "}") ""
let repulsion nuclei =
let get_charge e =
let get_charge e =
Element.to_charge e
|> Charge.to_float
in
Array.fold_left ( fun accu (e1, coord1) ->
accu +.
Array.fold_left ( fun accu (e1, coord1) ->
accu +.
Array.fold_left (fun accu (e2, coord2) ->
let r = Coordinate.(norm (coord1 |- coord2)) in
if r > 0. then
@ -177,26 +162,42 @@ let repulsion nuclei =
) 0. nuclei
let charge nuclei =
let charge nuclei =
Array.fold_left (fun accu (e, _) -> accu + Charge.to_int (Element.to_charge e) )
0 nuclei
0 nuclei
|> Charge.of_int
let small_core a =
let small_core a =
Array.fold_left (fun accu (e,_) -> accu + (Element.small_core e)) 0 a
let large_core a =
let large_core a =
Array.fold_left (fun accu (e,_) -> accu + (Element.large_core e)) 0 a
(* Query:2 ends here *)
(* [[file:~/QCaml/particles/nuclei.org::*Read][Read:2]] *)
let of_trexio f =
let num = Trexio.read_nucleus_num f in
let charge = Trexio.read_nucleus_charge f
|> Array.map Charge.of_float in
let coord = Trexio.read_nucleus_coord f in
Array.init num (fun i ->
let coord = Coordinate.{ x = coord.(3*i) ;
y = coord.(3*i+1) ;
z = coord.(3*i+2) } in
(Element.of_charge charge.(i), Coordinate.make coord)
)
(* Read:2 ends here *)
(* [[file:~/QCaml/particles/nuclei.org::*Write][Write:2]] *)
let to_trexio f t =
let num = Array.length t in
Trexio.write_nucleus_num f num;
Array.map (fun (e, _) -> Element.to_charge e |> Charge.to_float) t
Array.map (fun (e, _) -> Element.to_charge e |> Charge.to_float) t
|> Trexio.write_nucleus_charge f;
Array.map (fun (e, _) -> Element.to_string e) t
|> Trexio.write_nucleus_label f;
@ -206,10 +207,10 @@ let to_trexio f t =
coord.(3*i+1) <- Coordinate.(get Y xyz) ;
coord.(3*i+2) <- Coordinate.(get Z xyz) ) t;
Trexio.write_nucleus_coord f coord;
repulsion t
|> Trexio.write_nucleus_repulsion f
(* Query:2 ends here *)
(* Write:2 ends here *)
(* [[file:~/QCaml/particles/nuclei.org::*Printers][Printers:2]] *)
let pp ppf t =

View File

@ -23,9 +23,6 @@ val of_zmt_file : string -> t
val to_string : t -> string
val of_filename : string -> t
val of_trexio : Trexio.trexio_file -> t
val to_trexio : Trexio.trexio_file -> t -> unit
(* Conversion:1 ends here *)
(* Query *)
@ -39,6 +36,20 @@ val small_core : t -> int
val large_core : t -> int
(* Query:1 ends here *)
(* Read *)
(* [[file:~/QCaml/particles/nuclei.org::*Read][Read:1]] *)
val of_trexio : Trexio.trexio_file -> t
(* Read:1 ends here *)
(* Write *)
(* [[file:~/QCaml/particles/nuclei.org::*Write][Write:1]] *)
val to_trexio : Trexio.trexio_file -> t -> unit
(* Write:1 ends here *)
(* Printers *)

View File

@ -1,8 +1,8 @@
(* Lexer
*
*
* =nuclei_lexer.mll= contains the description of the lexemes used in
* an xyz file. *)
(* [[file:~/QCaml/particles/nuclei.org::*Lexer][Lexer:1]] *)
{

View File

@ -7,7 +7,7 @@
(setq ml (concat lib name ".ml"))
(setq test-ml (concat testdir name ".ml"))
(org-babel-tangle)
#+end_src
#+end_src
* Nuclei
:PROPERTIES:
@ -34,10 +34,10 @@ open Xyz_ast
** xyz file lexer/parser
*** Lexer
=nuclei_lexer.mll= contains the description of the lexemes used in
an xyz file.
#+begin_src ocaml :tangle lib/nuclei_lexer.mll :export none
{
open Xyz_parser
@ -79,11 +79,11 @@ rule read_all = parse
done;
*)
}
#+end_src
#+end_src
*** Parser
=xyz_parser.mly= parses nuclear coordinates in xyz format.
=xyz_parser.mly= parses nuclear coordinates in xyz format.
#+begin_src ocaml :tangle lib/xyz_parser.mly :export none :comments none
%{
open Common
@ -169,12 +169,12 @@ atoms_list:
| atoms_list SPACE INTEGER SPACE FLOAT SPACE FLOAT SPACE FLOAT EOL { output_of_int $5 $7 $9 $3 :: $1 }
| atoms_list SPACE INTEGER SPACE FLOAT SPACE FLOAT SPACE FLOAT SPACE EOL { output_of_int $5 $7 $9 $3 :: $1 }
;
#+end_src
#+end_src
When an xyz file is read by =xyz_parser.mly=, it is converted into
an ~xyz_file~ data structure.
#+begin_src ocaml :tangle lib/xyz_ast.mli
#+begin_src ocaml :tangle lib/xyz_ast.mli
open Common
type nucleus =
@ -204,9 +204,6 @@ val of_zmt_file : string -> t
val to_string : t -> string
val of_filename : string -> t
val of_trexio : Trexio.trexio_file -> t
val to_trexio : Trexio.trexio_file -> t -> unit
#+end_src
| ~of_xyz_string~ | Create from a string, in xyz format |
@ -215,18 +212,16 @@ val to_trexio : Trexio.trexio_file -> t -> unit
| ~of_zmt_file~ | Create from a file, in z-matrix format |
| ~to_string~ | Transform to a string, for printing |
| ~of_filename~ | Detects the type of file (xyz, z-matrix) and reads the file |
| ~of_trexio~ | Reads the geometry from a TREXIO file |
| ~to_trexio~ | Writes the geometry in a TREXIO file |
#+begin_src ocaml :tangle (eval ml) :exports none
let of_xyz_lexbuf lexbuf =
let data =
let data =
Xyz_parser.input Nuclei_lexer.read_all lexbuf
in
let len = List.length data.nuclei in
if len <> data.number_of_atoms then
Printf.sprintf "Error: expected %d atoms but %d read"
Printf.sprintf "Error: expected %d atoms but %d read"
data.number_of_atoms len
|> failwith;
@ -236,7 +231,7 @@ let of_xyz_lexbuf lexbuf =
|> Array.of_list
let of_xyz_string input_string =
let of_xyz_string input_string =
Lexing.from_string input_string
|> of_xyz_lexbuf
@ -246,7 +241,7 @@ let of_xyz_file filename =
let lexbuf =
Lexing.from_channel ic
in
let result =
let result =
of_xyz_lexbuf lexbuf
in
close_in ic;
@ -291,7 +286,7 @@ let to_string atoms =
bohr_to_angstrom coord
in
Printf.sprintf " %5d %5d %5s %12.6f %12.6f %12.6f"
(i+1) (Element.to_int e) (Element.to_string e)
(i+1) (Element.to_int e) (Element.to_string e)
coord.x coord.y coord.z
) atoms
|> Array.to_list
@ -315,48 +310,11 @@ let to_xyz_string t =
in
Printf.sprintf " %5s %12.6f %12.6f %12.6f"
(Element.to_string e) coord.x coord.y coord.z
) t
) t
|> Array.to_list )
|> String.concat "\n"
let of_trexio f =
let num = Trexio.read_nucleus_num f in
let charge = Trexio.read_nucleus_charge f
|> Array.map Charge.of_float in
let coord = Trexio.read_nucleus_coord f in
Array.init num (fun i ->
let coord = Coordinate.{ x = coord.(3*i) ;
y = coord.(3*i+1) ;
z = coord.(3*i+2) } in
(Element.of_charge charge.(i), Coordinate.make coord)
)
#+end_src
#+NAME: trexio_export
#+begin_src ocaml :tangle no :exports none
let to_trexio f t =
let num = Array.length t in
Trexio.write_nucleus_num f num;
Array.map (fun (e, _) -> Element.to_charge e |> Charge.to_float) t
|> Trexio.write_nucleus_charge f;
Array.map (fun (e, _) -> Element.to_string e) t
|> Trexio.write_nucleus_label f;
let coord = Array.init (num*3) (fun _ -> 0.) in
Array.iteri (fun i (_, xyz) ->
coord.(3*i) <- Coordinate.(get X xyz) ;
coord.(3*i+1) <- Coordinate.(get Y xyz) ;
coord.(3*i+2) <- Coordinate.(get Z xyz) ) t;
Trexio.write_nucleus_coord f coord;
repulsion t
|> Trexio.write_nucleus_repulsion f
#+end_src
** Query
@ -375,7 +333,7 @@ val large_core : t -> int
| ~small_core~ | Number of core electrons in the small core model |
| ~large_core~ | Number of core electrons in the large core model |
#+begin_src ocaml :tangle (eval ml) :exports none :noweb yes
#+begin_src ocaml :tangle (eval ml) :exports none
let formula t =
let dict = Hashtbl.create 67 in
Array.iter (fun (e,_) ->
@ -394,14 +352,14 @@ let formula t =
accu ^ key ^ "_{" ^ (string_of_int x) ^ "}") ""
let repulsion nuclei =
let get_charge e =
let get_charge e =
Element.to_charge e
|> Charge.to_float
in
Array.fold_left ( fun accu (e1, coord1) ->
accu +.
Array.fold_left ( fun accu (e1, coord1) ->
accu +.
Array.fold_left (fun accu (e2, coord2) ->
let r = Coordinate.(norm (coord1 |- coord2)) in
if r > 0. then
@ -411,22 +369,72 @@ let repulsion nuclei =
) 0. nuclei
let charge nuclei =
let charge nuclei =
Array.fold_left (fun accu (e, _) -> accu + Charge.to_int (Element.to_charge e) )
0 nuclei
0 nuclei
|> Charge.of_int
let small_core a =
let small_core a =
Array.fold_left (fun accu (e,_) -> accu + (Element.small_core e)) 0 a
let large_core a =
let large_core a =
Array.fold_left (fun accu (e,_) -> accu + (Element.large_core e)) 0 a
<<trexio_export>>
#+end_src
** TREXIO
*** Read
#+begin_src ocaml :tangle (eval mli)
val of_trexio : Trexio.trexio_file -> t
#+end_src
#+begin_src ocaml :tangle (eval ml) :exports none
let of_trexio f =
let num = Trexio.read_nucleus_num f in
let charge = Trexio.read_nucleus_charge f
|> Array.map Charge.of_float in
let coord = Trexio.read_nucleus_coord f in
Array.init num (fun i ->
let coord = Coordinate.{ x = coord.(3*i) ;
y = coord.(3*i+1) ;
z = coord.(3*i+2) } in
(Element.of_charge charge.(i), Coordinate.make coord)
)
#+end_src
*** Write
#+begin_src ocaml :tangle (eval mli)
val to_trexio : Trexio.trexio_file -> t -> unit
#+end_src
#+begin_src ocaml :tangle (eval ml) :exports none
let to_trexio f t =
let num = Array.length t in
Trexio.write_nucleus_num f num;
Array.map (fun (e, _) -> Element.to_charge e |> Charge.to_float) t
|> Trexio.write_nucleus_charge f;
Array.map (fun (e, _) -> Element.to_string e) t
|> Trexio.write_nucleus_label f;
let coord = Array.init (num*3) (fun _ -> 0.) in
Array.iteri (fun i (_, xyz) ->
coord.(3*i) <- Coordinate.(get X xyz) ;
coord.(3*i+1) <- Coordinate.(get Y xyz) ;
coord.(3*i+2) <- Coordinate.(get Z xyz) ) t;
Trexio.write_nucleus_coord f coord;
repulsion t
|> Trexio.write_nucleus_repulsion f
#+end_src
** Printers
#+begin_src ocaml :tangle (eval mli)