From 8502befb65f6a2c6c7bf99926a81ae347df70cc6 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 28 Jan 2021 00:34:26 +0100 Subject: [PATCH] Update documentation --- ao/README.org | 19 +- ao/basis.org | 17 +- ao/basis_gaussian.org | 18 +- ao/lib/ao_dim.mli | 2 +- ao/lib/basis.ml | 11 +- ao/lib/basis.mli | 13 +- ao/lib/basis_gaussian.ml | 11 +- ao/lib/basis_gaussian.mli | 7 +- ao/lib/basis_poly.mli | 1 + common/README.org | 20 +- common/angular_momentum.org | 4 + common/bitstring.org | 8 + common/charge.org | 1 + common/command_line.org | 12 +- common/constants.org | 1 - common/coordinate.org | 18 +- common/lib/angular_momentum.ml | 5 +- common/lib/angular_momentum.mli | 1 + common/lib/bitstring.ml | 12 +- common/lib/bitstring.mli | 5 +- common/lib/charge.mli | 5 +- common/lib/command_line.ml | 14 +- common/lib/command_line.mli | 6 +- common/lib/coordinate.ml | 15 +- common/lib/coordinate.mli | 3 +- common/lib/non_negative_float.mli | 5 +- common/lib/powers.ml | 10 +- common/lib/powers.mli | 9 +- common/lib/range.mli | 5 +- common/lib/spin.mli | 5 +- common/lib/util.ml | 7 +- common/lib/util.mli | 9 +- common/lib/zkey.mli | 5 +- common/lib/zmap.mli | 5 +- common/non_negative_float.org | 1 + common/powers.org | 23 +- common/range.org | 1 + common/spin.org | 1 + common/test/bitstring.ml | 9 +- common/util.org | 16 +- common/zkey.org | 2 + common/zmap.org | 1 + docs/ao.html | 187 +++--- docs/common.html | 767 +++++++++++++---------- docs/gaussian.html | 165 ++--- docs/gaussian_integrals.html | 47 +- docs/index.html | 63 +- docs/index.org | 14 +- docs/linear_algebra.html | 47 +- docs/mo.html | 87 +-- docs/org-info.js | 288 +++++++++ docs/particles.html | 255 ++++---- docs/perturbation.html | 91 +-- docs/qcaml.css | 972 ++++++++++++++++++++++++++++++ docs/qcaml.setup | 8 + docs/theme.setup | 7 + docs/top.html | 47 +- gaussian/README.org | 17 +- gaussian_integrals/README.org | 17 +- linear_algebra/README.org | 21 +- mo/README.org | 17 +- operators/README.org | 17 +- particles/README.org | 21 +- perturbation/README.org | 17 +- qcaml/README.org | 11 +- simulation/README.org | 17 +- top/README.org | 14 +- 67 files changed, 2621 insertions(+), 936 deletions(-) create mode 100644 docs/org-info.js create mode 100644 docs/qcaml.css create mode 100644 docs/qcaml.setup create mode 100644 docs/theme.setup diff --git a/ao/README.org b/ao/README.org index 6c03af3..2fb54c6 100644 --- a/ao/README.org +++ b/ao/README.org @@ -1,24 +1,27 @@ #+TITLE: Atomic Orbitals -#+HTML_LINK_HOME: index.html -#+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup +#+SETUPFILE: ../docs/theme.setup + +* Summary #+name: synopsis -#+begin_src ocaml :export output raw +#+begin_src ocaml :exports none :results value "Atomic basis set" #+end_src #+RESULTS: synopsis : Atomic basis set +This modules contains the data structures used to characterize the +atomic basis set. * Dune files :noexport: - + ** Generate dune files Use [C-c C-c] on the code below to create the output for the dune files #+header: :noweb strip-export - #+header: :var name=(file-name-directory buffer-file-name) + #+header: :var name=(file-name-directory buffer-file-name) #+header: :var dune="lib/dune" #+header: :var dunetest="test/dune" #+begin_src python :exports none :results output none @@ -56,7 +59,7 @@ with open(dunetest,'w') as f: ** Dependencies #+name: dependencies - #+begin_src elisp + #+begin_src elisp (libraries qcaml.common qcaml.particles @@ -67,7 +70,7 @@ with open(dunetest,'w') as f: #+end_src ** Modules without implementation - + #+name: noimplementation #+begin_src elisp (modules_without_implementation ao_dim) @@ -86,4 +89,4 @@ with open(dunetest,'w') as f: - + diff --git a/ao/basis.org b/ao/basis.org index 3782712..3ea83fc 100644 --- a/ao/basis.org +++ b/ao/basis.org @@ -16,7 +16,7 @@ Data structure for Atomic Orbitals. -** Dimensions :noexports: +** Dimensions :noexport: #+begin_src ocaml :tangle lib/ao_dim.mli :exports none type t @@ -24,6 +24,7 @@ type t ** Polymorphic types + <<<~Basis.t~>>> #+NAME: types #+begin_src ocaml :tangle lib/basis_poly.mli type t = @@ -37,6 +38,7 @@ type t = ** Types + <<<~Basis.t~>>> #+begin_src ocaml :tangle (eval mli) type t type ao = Ao_dim.t @@ -63,17 +65,24 @@ open Common #+begin_src ocaml :tangle (eval mli) val of_nuclei_and_basis_filename : - ?kind:[> `Gaussian ] -> ?operators:Operator.t list -> ?cartesian:bool -> - nuclei:Nuclei.t -> string -> t + ?kind:[> `Gaussian ] -> + ?operators:Operator.t list -> + ?cartesian:bool -> + nuclei:Nuclei.t -> + string -> + t #+end_src + |--------------------------------+------------------------------------------------------------------------------------------------------------------------| | ~of_nuclei_and_basis_filename~ | Creates the data structure for the atomic orbitals basis from a molecule ~Nuclei.t~ and the name of the basis-set file | + |--------------------------------+------------------------------------------------------------------------------------------------------------------------| Defaults: - ~kind~ : ~`Gaussian~ - ~operators~ : ~[]~ - ~cartesian~ : ~false~ + Example: #+begin_example let b = Ao.Basis.of_nuclei_and_basis_filename ~nuclei filename;; val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs @@ -113,6 +122,7 @@ val cartesian : t -> bool val values : t -> Coordinate.t -> ao Vector.t #+end_src + |---------------------+--------------------------------------------------| | ~size~ | Number of atomic orbitals in the AO basis set | | ~ao_basis~ | One-electron basis set | | ~overlap~ | Overlap matrix | @@ -126,6 +136,7 @@ val values : t -> Coordinate.t -> ao Vector.t | ~f12_over_r12_ints~ | Electron-electron potential integrals | | ~cartesian~ | If true, use cartesian Gaussians (6d, 10f, ...) | | ~values~ | Values of the AOs evaluated at a given point | + |---------------------+--------------------------------------------------| #+begin_src ocaml :tangle (eval ml) :exports none diff --git a/ao/basis_gaussian.org b/ao/basis_gaussian.org index d6d7c4b..7e2f969 100644 --- a/ao/basis_gaussian.org +++ b/ao/basis_gaussian.org @@ -16,11 +16,11 @@ 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) - $$ + \] - where the polynomial $P_Ai and the Gaussian part are both centered on + where the polynomial $P_i$ and the Gaussian part are both centered on nucleus $A$. ** Type @@ -78,6 +78,7 @@ val overlap : t -> Overlap.t val size : t -> int #+end_src + |---------------------+--------------------------------------------------| | ~basis~ | One-electron basis set | | ~cartesian~ | If true, use cartesian Gaussians (6d, 10f, ...) | | ~ee_ints~ | Electron-electron potential integrals | @@ -90,6 +91,7 @@ val size : t -> int | ~ortho~ | Orthonormalization matrix of the overlap | | ~overlap~ | Overlap matrix | | ~size~ | Number of atomic orbitals | + |---------------------+--------------------------------------------------| #+begin_src ocaml :tangle (eval ml) :exports none let basis t = t.basis @@ -109,10 +111,14 @@ let size t = Matrix.dim1 (Lazy.force t.overlap) ** Computation #+begin_src ocaml :tangle (eval mli) -val values : t -> Coordinate.t -> Gaussian.Basis.t Vector.t +val values : t -> + Coordinate.t -> + Gaussian.Basis.t Vector.t #+end_src + |----------+--------------------------------------------------------------| | ~values~ | Returns the values of all the AOs evaluated at a given point | + |----------+--------------------------------------------------------------| #+begin_src ocaml :tangle (eval ml) :exports none module Cs = Contracted_shell @@ -136,7 +142,8 @@ let values t point = val make : basis:Gaussian.Basis.t -> ?operators:Operator.t list -> ?cartesian:bool -> - Nuclei.t -> t + Nuclei.t -> + t #+end_src Creates the data structure for atomic orbitals from a Gaussian basis and the @@ -146,6 +153,7 @@ val make : basis:Gaussian.Basis.t -> - ~operators~ : ~[]~ - ~cartesian~ : ~false~ + Example: #+begin_example let b = Ao.Basis_gaussian.make ~basis nuclei ;; val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs diff --git a/ao/lib/ao_dim.mli b/ao/lib/ao_dim.mli index dfa3042..124d6eb 100644 --- a/ao/lib/ao_dim.mli +++ b/ao/lib/ao_dim.mli @@ -1,4 +1,4 @@ -(* Dimensions :noexports: *) +(* Dimensions :noexport: *) (* [[file:~/QCaml/ao/basis.org::*Dimensions][Dimensions:1]] *) diff --git a/ao/lib/basis.ml b/ao/lib/basis.ml index 1c37629..3fddc66 100644 --- a/ao/lib/basis.ml +++ b/ao/lib/basis.ml @@ -12,13 +12,16 @@ open Common -(* | ~of_nuclei_and_basis_filename~ | Creates the data structure for the atomic orbitals basis from a molecule ~Nuclei.t~ and the name of the basis-set file | +(* |--------------------------------+------------------------------------------------------------------------------------------------------------------------| + * | ~of_nuclei_and_basis_filename~ | Creates the data structure for the atomic orbitals basis from a molecule ~Nuclei.t~ and the name of the basis-set file | + * |--------------------------------+------------------------------------------------------------------------------------------------------------------------| * * Defaults: * - ~kind~ : ~`Gaussian~ * - ~operators~ : ~[]~ * - ~cartesian~ : ~false~ * + * Example: * #+begin_example * let b = Ao.Basis.of_nuclei_and_basis_filename ~nuclei filename;; * val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs @@ -42,7 +45,8 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false) -(* | ~size~ | Number of atomic orbitals in the AO basis set | +(* |---------------------+--------------------------------------------------| + * | ~size~ | Number of atomic orbitals in the AO basis set | * | ~ao_basis~ | One-electron basis set | * | ~overlap~ | Overlap matrix | * | ~multipole~ | Multipole matrices | @@ -54,7 +58,8 @@ let of_nuclei_and_basis_filename ?(kind=`Gaussian) ?operators ?(cartesian=false) * | ~f12_ints~ | Electron-electron potential integrals | * | ~f12_over_r12_ints~ | Electron-electron potential integrals | * | ~cartesian~ | If true, use cartesian Gaussians (6d, 10f, ...) | - * | ~values~ | Values of the AOs evaluated at a given point | *) + * | ~values~ | Values of the AOs evaluated at a given point | + * |---------------------+--------------------------------------------------| *) diff --git a/ao/lib/basis.mli b/ao/lib/basis.mli index 4896d34..00a9815 100644 --- a/ao/lib/basis.mli +++ b/ao/lib/basis.mli @@ -1,5 +1,6 @@ -(* Types *) - +(* Types + * + * <<<~Basis.t~>>> *) (* [[file:~/QCaml/ao/basis.org::*Types][Types:1]] *) type t @@ -16,8 +17,12 @@ open Linear_algebra (* [[file:~/QCaml/ao/basis.org::*Conversions][Conversions:1]] *) val of_nuclei_and_basis_filename : - ?kind:[> `Gaussian ] -> ?operators:Operator.t list -> ?cartesian:bool -> - nuclei:Nuclei.t -> string -> t + ?kind:[> `Gaussian ] -> + ?operators:Operator.t list -> + ?cartesian:bool -> + nuclei:Nuclei.t -> + string -> + t (* Conversions:1 ends here *) (* Access *) diff --git a/ao/lib/basis_gaussian.ml b/ao/lib/basis_gaussian.ml index d31f709..ba9c551 100644 --- a/ao/lib/basis_gaussian.ml +++ b/ao/lib/basis_gaussian.ml @@ -24,7 +24,8 @@ type t = -(* | ~basis~ | One-electron basis set | +(* |---------------------+--------------------------------------------------| + * | ~basis~ | One-electron basis set | * | ~cartesian~ | If true, use cartesian Gaussians (6d, 10f, ...) | * | ~ee_ints~ | Electron-electron potential integrals | * | ~ee_lr_ints~ | Electron-electron long-range potential integrals | @@ -35,7 +36,8 @@ type t = * | ~multipole~ | Multipole matrices | * | ~ortho~ | Orthonormalization matrix of the overlap | * | ~overlap~ | Overlap matrix | - * | ~size~ | Number of atomic orbitals | *) + * | ~size~ | Number of atomic orbitals | + * |---------------------+--------------------------------------------------| *) (* [[file:~/QCaml/ao/basis_gaussian.org::*Access][Access:2]] *) @@ -55,7 +57,9 @@ let size t = Matrix.dim1 (Lazy.force t.overlap) -(* | ~values~ | Returns the values of all the AOs evaluated at a given point | *) +(* |----------+--------------------------------------------------------------| + * | ~values~ | Returns the values of all the AOs evaluated at a given point | + * |----------+--------------------------------------------------------------| *) (* [[file:~/QCaml/ao/basis_gaussian.org::*Computation][Computation:2]] *) @@ -83,6 +87,7 @@ let values t point = * - ~operators~ : ~[]~ * - ~cartesian~ : ~false~ * + * Example: * #+begin_example * let b = Ao.Basis_gaussian.make ~basis nuclei ;; * val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs diff --git a/ao/lib/basis_gaussian.mli b/ao/lib/basis_gaussian.mli index 4ee6a47..40ca913 100644 --- a/ao/lib/basis_gaussian.mli +++ b/ao/lib/basis_gaussian.mli @@ -35,7 +35,9 @@ val size : t -> int (* [[file:~/QCaml/ao/basis_gaussian.org::*Computation][Computation:1]] *) -val values : t -> Coordinate.t -> Gaussian.Basis.t Vector.t +val values : t -> + Coordinate.t -> + Gaussian.Basis.t Vector.t (* Computation:1 ends here *) (* Creation *) @@ -45,7 +47,8 @@ val values : t -> Coordinate.t -> Gaussian.Basis.t Vector.t val make : basis:Gaussian.Basis.t -> ?operators:Operator.t list -> ?cartesian:bool -> - Nuclei.t -> t + Nuclei.t -> + t (* Creation:1 ends here *) (* Printers *) diff --git a/ao/lib/basis_poly.mli b/ao/lib/basis_poly.mli index 7d08b35..5e07bda 100644 --- a/ao/lib/basis_poly.mli +++ b/ao/lib/basis_poly.mli @@ -1,5 +1,6 @@ (* Polymorphic types * + * <<<~Basis.t~>>> * #+NAME: types *) (* [[file:~/QCaml/ao/basis.org::types][types]] *) diff --git a/common/README.org b/common/README.org index 1b15c53..79df007 100644 --- a/common/README.org +++ b/common/README.org @@ -1,15 +1,15 @@ #+TITLE: Common -#+HTML_LINK_HOME: index.html -#+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup +#+SETUPFILE: ../docs/theme.setup +* Summary #+name: synopsis -#+begin_src ocaml :export output raw -"Utility functions used by all the other directories." +#+begin_src ocaml :exports none :results value +"Utility functions used by all the other directories" #+end_src #+RESULTS: synopsis -: Utility functions used by all the other directories. +: Utility functions used by all the other directories * Dune files :noexport: @@ -19,7 +19,7 @@ Use [C-c C-c] on the code below to create the output for the dune files #+header: :noweb strip-export - #+header: :var name=(file-name-directory buffer-file-name) + #+header: :var name=(file-name-directory buffer-file-name) #+header: :var dune="lib/dune" #+header: :var dunetest="test/dune" #+begin_src python :exports none :results output none @@ -56,7 +56,7 @@ with open(dunetest,'w') as f: ** Dependencies #+name: dependencies - #+begin_src elisp + #+begin_src elisp (libraries str zarith @@ -65,7 +65,7 @@ with open(dunetest,'w') as f: #+end_src ** Modules without implementation - + #+name: noimplementation #+begin_src elisp #+end_src @@ -76,7 +76,7 @@ with open(dunetest,'w') as f: functionalities to OCaml, such as support for the ~popcnt~ instruction. #+name: c-files - #+begin_src elisp + #+begin_src elisp (c_names util ) @@ -88,5 +88,5 @@ with open(dunetest,'w') as f: ** Parser #+name: lex-yacc - #+begin_src elisp + #+begin_src elisp #+end_src diff --git a/common/angular_momentum.org b/common/angular_momentum.org index 2d35ed1..2b7313e 100644 --- a/common/angular_momentum.org +++ b/common/angular_momentum.org @@ -19,6 +19,7 @@ ** Type + <<<~Angular_momentum.t~>>> #+NAME: types #+begin_src ocaml :tangle (eval mli) type t = @@ -64,6 +65,7 @@ val to_string : t -> string | ~to_int~ | Returns the $l_{max}$ value of the shell | | ~to_string~ | Converts the angular momentum into a string | + Example: #+begin_example Angular_momentum.of_char 'p';; - : Angular_momentum.t = P @@ -142,6 +144,7 @@ val zkey_array : kind -> Zkey.t array | ~n_functions~ | Returns the number of cartesian functions in a shell. | | ~zkey_array~ | Array of ~Zkey.t~, where each element is a a key associated with the the powers of $x,y,z$. | + Example: #+begin_example Angular_momentum.(n_functions D) ;; - : int = 6 @@ -245,6 +248,7 @@ val ( + ) : t -> t -> t val ( - ) : t -> t -> t #+end_src + Example: #+begin_example Angular_momentum.(D + P);; - : Angular_momentum.t = F diff --git a/common/bitstring.org b/common/bitstring.org index 91ef5fb..c5684d9 100644 --- a/common/bitstring.org +++ b/common/bitstring.org @@ -96,6 +96,7 @@ end ** Type + <<<~Bitstring.t~>>> #+begin_src ocaml :tangle (eval mli) type t #+end_src @@ -186,6 +187,7 @@ check_bool "of_x" true (one_x = (of_int x)); check_bool "of_z" true (one_x = (of_z (Z.of_int x))); #+end_src + Example: #+begin_example Bitstring.of_int 15;; - : Bitstring.t = @@ -231,6 +233,7 @@ let testbit = function | Many x -> Many.testbit x #+end_src + Example: #+begin_example Bitstring.(shift_left (of_int 15) 2);; - : Bitstring.t = @@ -296,6 +299,7 @@ let lognot = function #+end_src + Example: #+begin_example Bitstring.(logor (of_int 15) (of_int 73));; - : Bitstring.t = @@ -333,6 +337,7 @@ let plus_one = function #+end_src + Example: #+begin_example Bitstring.(plus_one (of_int 15));; - : Bitstring.t = @@ -362,6 +367,7 @@ let popcount = function #+end_src + Example: #+begin_example Bitstring.(trailing_zeros (of_int 12));; - : int = 2 @@ -387,6 +393,7 @@ let rec to_list ?(accu=[]) = function check_bool "to_list" true ([ 1 ; 3 ; 4 ; 6 ] = (to_list (of_int 45))); #+end_src + Example: #+begin_example Bitstring.(to_list (of_int 45));; - : int list = [1; 3; 4; 6] @@ -412,6 +419,7 @@ let permutations m n = aux (Util.binom n m) (minus_one (shift_left_one n m)) [] #+end_src + Example: #+begin_example Bitstring.permutations 2 4;; - : Bitstring.t list = diff --git a/common/charge.org b/common/charge.org index c704d49..cef7097 100644 --- a/common/charge.org +++ b/common/charge.org @@ -17,6 +17,7 @@ ** Type + <<<~Charge.t~>>> #+begin_src ocaml :tangle (eval mli) type t #+end_src diff --git a/common/command_line.org b/common/command_line.org index 786bc7d..17ac72e 100644 --- a/common/command_line.org +++ b/common/command_line.org @@ -59,7 +59,7 @@ let multiplicity = in #+end_src -** Type +** Types #+NAME:type #+begin_src ocaml :tangle (eval mli) @@ -67,7 +67,9 @@ type short_opt = char type long_opt = string type optional = Mandatory | Optional type documentation = string -type argument = With_arg of string | Without_arg | With_opt_arg of string +type argument = | With_arg of string + | Without_arg + | With_opt_arg of string type description = { short: short_opt ; @@ -79,9 +81,9 @@ type description = { #+end_src - - Short option: in the command line, a dash with a single character + - <<>>: in the command line, a dash with a single character (ex: =ls -l=) - - Long option: in the command line, two dashes with a word + - <<>>: in the command line, two dashes with a word (ex: =ls --directory=) - Command-line options can be ~Mandatory~ or ~Optional~ - Documentation of the option is used in the help function @@ -163,6 +165,7 @@ let output_text t = Function to build the short description of the command-line arguments, such as + Example: #+begin_example my_program -b [-h] [-u ] -x [--] #+end_example @@ -184,6 +187,7 @@ let output_short x = Function to build the long description of the command-line arguments, such as + Example: #+begin_example -x --xyz= Name of the file containing the nuclear coordinates in xyz format diff --git a/common/constants.org b/common/constants.org index 9bb6af4..c5aa782 100644 --- a/common/constants.org +++ b/common/constants.org @@ -13,7 +13,6 @@ :PROPERTIES: :header-args: :noweb yes :comments both :END: - All constants used in the program. ** Thresholds diff --git a/common/coordinate.org b/common/coordinate.org index d7429c2..0ded6d7 100644 --- a/common/coordinate.org +++ b/common/coordinate.org @@ -22,6 +22,7 @@ ** Type + <<<~Coordinate.t~>>> #+NAME: types #+begin_src ocaml :tangle (eval mli) type bohr @@ -62,7 +63,7 @@ type axis = X | Y | Z #+begin_src ocaml :tangle (eval mli) val make : 'a point -> t val make_angstrom : 'a point -> angstrom point -val zero : bohr point +val zero : bohr point #+end_src | ~make~ | Creates a point in atomic units | @@ -114,14 +115,15 @@ val ( |+ ) : t -> t -> t val ( |- ) : t -> t -> t #+end_src - | ~neg~ | Negative of a point | - | ~get~ | Extracts the projection of the coordinate on an axis | - | ~dot~ | Dot product | - | ~norm~ | $\ell{^2}$ norm of the vector | - | ~¦.~ | Scales the vector by a constant | - | ~¦+~ | Adds two vectors | - | ~¦-~ | Subtracts two vectors | + | ~neg~ | Negative of a point | + | ~get~ | Extracts the projection of the coordinate on an axis | + | ~dot~ | Dot product | + | ~norm~ | $\ell{^2}$ norm of the vector | + | $\vert .$ | Scales the vector by a constant | + | $\vert +$ | Adds two vectors | + | $\vert -$ | Subtracts two vectors | + Example: #+begin_example Coordinate.neg { x=1. ; y=2. ; z=3. } ;; - : Coordinate.t = -1.0000 -2.0000 -3.0000 diff --git a/common/lib/angular_momentum.ml b/common/lib/angular_momentum.ml index 57bcfa4..d76486d 100644 --- a/common/lib/angular_momentum.ml +++ b/common/lib/angular_momentum.ml @@ -31,6 +31,7 @@ open Powers * | ~to_int~ | Returns the $l_{max}$ value of the shell | * | ~to_string~ | Converts the angular momentum into a string | * + * Example: * #+begin_example * Angular_momentum.of_char 'p';; * - : Angular_momentum.t = P @@ -105,6 +106,7 @@ let of_int = function (* | ~n_functions~ | Returns the number of cartesian functions in a shell. | * | ~zkey_array~ | Array of ~Zkey.t~, where each element is a a key associated with the the powers of $x,y,z$. | * + * Example: * #+begin_example * Angular_momentum.(n_functions D) ;; * - : int = 6 @@ -204,7 +206,8 @@ let zkey_array a = -(* #+begin_example +(* Example: + * #+begin_example * Angular_momentum.(D + P);; * - : Angular_momentum.t = F * diff --git a/common/lib/angular_momentum.mli b/common/lib/angular_momentum.mli index 148708a..527ab18 100644 --- a/common/lib/angular_momentum.mli +++ b/common/lib/angular_momentum.mli @@ -1,5 +1,6 @@ (* Type * + * <<<~Angular_momentum.t~>>> * #+NAME: types *) (* [[file:~/QCaml/common/angular_momentum.org::types][types]] *) diff --git a/common/lib/bitstring.ml b/common/lib/bitstring.ml index 1a8c553..453dbdb 100644 --- a/common/lib/bitstring.ml +++ b/common/lib/bitstring.ml @@ -114,7 +114,8 @@ let of_z x = -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.of_int 15;; * - : Bitstring.t = * ++++------------------------------------------------------------ @@ -201,7 +202,8 @@ let plus_one = function -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.(plus_one (of_int 15));; * - : Bitstring.t = * ----+----------------------------------------------------------- @@ -233,7 +235,8 @@ let popcount = function -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.(trailing_zeros (of_int 12));; * - : int = 2 * @@ -257,7 +260,8 @@ let rec to_list ?(accu=[]) = function -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.(to_list (of_int 45));; * - : int list = [1; 3; 4; 6] * #+end_example *) diff --git a/common/lib/bitstring.mli b/common/lib/bitstring.mli index 78d88e3..9f8ec00 100644 --- a/common/lib/bitstring.mli +++ b/common/lib/bitstring.mli @@ -1,5 +1,6 @@ -(* Type *) - +(* Type + * + * <<<~Bitstring.t~>>> *) (* [[file:~/QCaml/common/bitstring.org::*Type][Type:1]] *) type t diff --git a/common/lib/charge.mli b/common/lib/charge.mli index 23b0141..210ce00 100644 --- a/common/lib/charge.mli +++ b/common/lib/charge.mli @@ -1,5 +1,6 @@ -(* Type *) - +(* Type + * + * <<<~Charge.t~>>> *) (* [[file:~/QCaml/common/charge.org::*Type][Type:1]] *) type t diff --git a/common/lib/command_line.ml b/common/lib/command_line.ml index 3e6a025..f1081a1 100644 --- a/common/lib/command_line.ml +++ b/common/lib/command_line.ml @@ -1,8 +1,8 @@ -(* - Short option: in the command line, a dash with a single character +(* - <<>>: in the command line, a dash with a single character * (ex: =ls -l=) - * - Long option: in the command line, two dashes with a word + * - <<>>: in the command line, two dashes with a word * (ex: =ls --directory=) * - Command-line options can be ~Mandatory~ or ~Optional~ * - Documentation of the option is used in the help function @@ -11,12 +11,14 @@ * (~git --log[=]~) *) -(* [[file:~/QCaml/common/command_line.org::*Type][Type:2]] *) +(* [[file:~/QCaml/common/command_line.org::*Types][Types:2]] *) type short_opt = char type long_opt = string type optional = Mandatory | Optional type documentation = string -type argument = With_arg of string | Without_arg | With_opt_arg of string +type argument = | With_arg of string + | Without_arg + | With_opt_arg of string type description = { short: short_opt ; @@ -25,7 +27,7 @@ type description = { doc : documentation ; arg : argument ; } -(* Type:2 ends here *) +(* Types:2 ends here *) (* Mutable attributes * @@ -96,6 +98,7 @@ let output_text t = (* Function to build the short description of the command-line * arguments, such as * + * Example: * #+begin_example * my_program -b [-h] [-u ] -x [--] * #+end_example *) @@ -120,6 +123,7 @@ let output_short x = (* Function to build the long description of the command-line * arguments, such as * + * Example: * #+begin_example * -x --xyz= Name of the file containing the nuclear * coordinates in xyz format diff --git a/common/lib/command_line.mli b/common/lib/command_line.mli index f177df7..12e9a0e 100644 --- a/common/lib/command_line.mli +++ b/common/lib/command_line.mli @@ -1,4 +1,4 @@ -(* Type +(* Types * * #+NAME:type *) @@ -7,7 +7,9 @@ type short_opt = char type long_opt = string type optional = Mandatory | Optional type documentation = string -type argument = With_arg of string | Without_arg | With_opt_arg of string +type argument = | With_arg of string + | Without_arg + | With_opt_arg of string type description = { short: short_opt ; diff --git a/common/lib/coordinate.ml b/common/lib/coordinate.ml index 9e3a051..3aa5c8b 100644 --- a/common/lib/coordinate.ml +++ b/common/lib/coordinate.ml @@ -53,14 +53,15 @@ let angstrom_to_bohr { x ; y ; z } = -(* | ~neg~ | Negative of a point | - * | ~get~ | Extracts the projection of the coordinate on an axis | - * | ~dot~ | Dot product | - * | ~norm~ | $\ell{^2}$ norm of the vector | - * | ~¦.~ | Scales the vector by a constant | - * | ~¦+~ | Adds two vectors | - * | ~¦-~ | Subtracts two vectors | +(* | ~neg~ | Negative of a point | + * | ~get~ | Extracts the projection of the coordinate on an axis | + * | ~dot~ | Dot product | + * | ~norm~ | $\ell{^2}$ norm of the vector | + * | $\vert .$ | Scales the vector by a constant | + * | $\vert +$ | Adds two vectors | + * | $\vert -$ | Subtracts two vectors | * + * Example: * #+begin_example * Coordinate.neg { x=1. ; y=2. ; z=3. } ;; * - : Coordinate.t = -1.0000 -2.0000 -3.0000 diff --git a/common/lib/coordinate.mli b/common/lib/coordinate.mli index 512eb36..8a0593e 100644 --- a/common/lib/coordinate.mli +++ b/common/lib/coordinate.mli @@ -1,5 +1,6 @@ (* Type * + * <<<~Coordinate.t~>>> * #+NAME: types *) (* [[file:~/QCaml/common/coordinate.org::types][types]] *) @@ -25,7 +26,7 @@ type axis = X | Y | Z (* [[file:~/QCaml/common/coordinate.org::*Creation][Creation:1]] *) val make : 'a point -> t val make_angstrom : 'a point -> angstrom point -val zero : bohr point +val zero : bohr point (* Creation:1 ends here *) (* Conversion *) diff --git a/common/lib/non_negative_float.mli b/common/lib/non_negative_float.mli index a117ca5..efdfb63 100644 --- a/common/lib/non_negative_float.mli +++ b/common/lib/non_negative_float.mli @@ -1,5 +1,6 @@ -(* Type *) - +(* Type + * + * <<<~Non_negative_float.t~>> *) (* [[file:~/QCaml/common/non_negative_float.org::*Type][Type:1]] *) type t = private float diff --git a/common/lib/powers.ml b/common/lib/powers.ml index 94983bf..2e60db5 100644 --- a/common/lib/powers.ml +++ b/common/lib/powers.ml @@ -8,13 +8,14 @@ type t = { x : int ; y : int ; z : int ; - tot : int ; + tot : int ; } (* Type:2 ends here *) -(* #+begin_example +(* Example: + * #+begin_example * Powers.of_int_tuple (2,3,1);; * - : Powers.t = x^2 + y^3 + z^1 * @@ -24,9 +25,9 @@ type t = { (* [[file:~/QCaml/common/powers.org::*Conversions][Conversions:2]] *) -let of_int_tuple t = +let of_int_tuple t = let result = - match t with + match t with | (x,y,z) -> { x ; y ; z ; tot=x+y+z } in if result.x < 0 || @@ -46,6 +47,7 @@ let to_int_tuple { x ; y ; z ; _ } = (x,y,z) * | ~incr~ | Returns a new ~Powers.t~ with the power on the given axis incremented | * | ~decr~ | Returns a new ~Powers.t~ with the power on the given axis decremented. As opposed to ~of_int_tuple~, the values may become negative| * + * Example: * #+begin_example * Powers.get Coordinate.Y (Powers.of_int_tuple (2,3,1));; * - : int = 3 diff --git a/common/lib/powers.mli b/common/lib/powers.mli index c90723c..c2ac295 100644 --- a/common/lib/powers.mli +++ b/common/lib/powers.mli @@ -1,12 +1,13 @@ -(* Type *) - +(* Type + * + * <<<~Powers.t~>>> *) (* [[file:~/QCaml/common/powers.org::*Type][Type:1]] *) type t = private { x : int ; y : int ; z : int ; - tot : int ; + tot : int ; } (* Type:1 ends here *) @@ -23,7 +24,7 @@ val to_int_tuple : t -> int * int * int (* [[file:~/QCaml/common/powers.org::*Operations][Operations:1]] *) val get : Coordinate.axis -> t -> int -val incr : Coordinate.axis -> t -> t +val incr : Coordinate.axis -> t -> t val decr : Coordinate.axis -> t -> t (* Operations:1 ends here *) diff --git a/common/lib/range.mli b/common/lib/range.mli index cc4fd91..b99a18c 100644 --- a/common/lib/range.mli +++ b/common/lib/range.mli @@ -1,5 +1,6 @@ -(* Type *) - +(* Type + * + * <<<~Range.t~>>> *) (* [[file:~/QCaml/common/range.org::*Type][Type:1]] *) type t diff --git a/common/lib/spin.mli b/common/lib/spin.mli index f028f83..0b2391a 100644 --- a/common/lib/spin.mli +++ b/common/lib/spin.mli @@ -1,5 +1,6 @@ -(* Type *) - +(* Type + * + * <<<~Spin.t~>>> *) (* [[file:~/QCaml/common/spin.org::*Type][Type:1]] *) type t = Alfa | Beta diff --git a/common/lib/util.ml b/common/lib/util.ml index 85bec0e..fde7744 100644 --- a/common/lib/util.ml +++ b/common/lib/util.ml @@ -1,5 +1,6 @@ (* [[file:~/QCaml/common/util.org::*Erf][Erf:3]] *) -external erf_float : float -> float = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] +external erf_float : float -> float + = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] (* Erf:3 ends here *) (* [[file:~/QCaml/common/util.org::*Erfc][Erfc:3]] *) @@ -7,7 +8,8 @@ external erfc_float : float -> float = "erfc_float_bytecode" "erfc_float" [@@unb (* Erfc:3 ends here *) (* [[file:~/QCaml/common/util.org::*Gamma][Gamma:3]] *) -external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] +external gamma_float : float -> float + = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] (* Gamma:3 ends here *) (* [[file:~/QCaml/common/util.org::*Popcnt][Popcnt:3]] *) @@ -362,6 +364,7 @@ let stream_fold f init stream = * | ~pp_float_2darray_size~ | Printer for matrices with size | * | ~pp_bitstring~ | Printer for bit strings (used by ~Bitstring~ module) | * + * Example: * #+begin_example * pp_float_array_size: * [ 6: 1.000000 1.732051 1.732051 1.000000 1.732051 1.000000 ] diff --git a/common/lib/util.mli b/common/lib/util.mli index 68df4ba..b156d95 100644 --- a/common/lib/util.mli +++ b/common/lib/util.mli @@ -1,13 +1,16 @@ (* [[file:~/QCaml/common/util.org::*Erf][Erf:2]] *) -external erf_float : float -> float = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] +external erf_float : float -> float + = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] (* Erf:2 ends here *) (* [[file:~/QCaml/common/util.org::*Erfc][Erfc:2]] *) -external erfc_float : float -> float = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc] +external erfc_float : float -> float + = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc] (* Erfc:2 ends here *) (* [[file:~/QCaml/common/util.org::*Gamma][Gamma:2]] *) -external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] +external gamma_float : float -> float + = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] (* Gamma:2 ends here *) (* [[file:~/QCaml/common/util.org::*Popcnt][Popcnt:2]] *) diff --git a/common/lib/zkey.mli b/common/lib/zkey.mli index 8a9a722..ad9e408 100644 --- a/common/lib/zkey.mli +++ b/common/lib/zkey.mli @@ -1,5 +1,6 @@ -(* Types *) - +(* Types + * + * <<<~Zkey.t~>>> *) (* [[file:~/QCaml/common/zkey.org::*Types][Types:1]] *) type t diff --git a/common/lib/zmap.mli b/common/lib/zmap.mli index eee97be..198e7ce 100644 --- a/common/lib/zmap.mli +++ b/common/lib/zmap.mli @@ -1,5 +1,6 @@ -(* Type *) - +(* Type + * + * <<<~Zmap.t~>>> *) (* [[file:~/QCaml/common/zmap.org::*Type][Type:1]] *) include module type of Hashtbl.Make(Zkey) diff --git a/common/non_negative_float.org b/common/non_negative_float.org index d8356a9..ca79f3b 100644 --- a/common/non_negative_float.org +++ b/common/non_negative_float.org @@ -16,6 +16,7 @@ ** Type + <<<~Non_negative_float.t~>> #+begin_src ocaml :tangle (eval mli) type t = private float #+end_src diff --git a/common/powers.org b/common/powers.org index 9366b63..f8f72a0 100644 --- a/common/powers.org +++ b/common/powers.org @@ -7,34 +7,35 @@ (setq ml (concat lib name ".ml")) (setq test-ml (concat testdir name ".ml")) (org-babel-tangle) -#+end_src +#+end_src * Powers :PROPERTIES: :header-args: :noweb yes :comments both :END: - Contains powers of x, y and z describing the polynomials in atomic basis sets. + Contains powers of $x$, $y$ and $z$ describing the polynomials in atomic basis sets. ** Type + <<<~Powers.t~>>> #+begin_src ocaml :tangle (eval mli) type t = private { x : int ; y : int ; z : int ; - tot : int ; + tot : int ; } #+end_src ~tot~ always contains ~x+y+z~. - + #+begin_src ocaml :tangle (eval ml) :exports none type t = { x : int ; y : int ; z : int ; - tot : int ; + tot : int ; } #+end_src @@ -42,9 +43,10 @@ type t = { #+begin_src ocaml :tangle (eval mli) val of_int_tuple : int * int * int -> t -val to_int_tuple : t -> int * int * int +val to_int_tuple : t -> int * int * int #+end_src + Example: #+begin_example Powers.of_int_tuple (2,3,1);; - : Powers.t = x^2 + y^3 + z^1 @@ -54,9 +56,9 @@ Powers.(to_int_tuple (of_int_tuple (2,3,1)));; #+end_example #+begin_src ocaml :tangle (eval ml) :exports none -let of_int_tuple t = +let of_int_tuple t = let result = - match t with + match t with | (x,y,z) -> { x ; y ; z ; tot=x+y+z } in if result.x < 0 || @@ -67,14 +69,14 @@ let of_int_tuple t = result -let to_int_tuple { x ; y ; z ; _ } = (x,y,z) +let to_int_tuple { x ; y ; z ; _ } = (x,y,z) #+end_src ** Operations #+begin_src ocaml :tangle (eval mli) val get : Coordinate.axis -> t -> int -val incr : Coordinate.axis -> t -> t +val incr : Coordinate.axis -> t -> t val decr : Coordinate.axis -> t -> t #+end_src @@ -82,6 +84,7 @@ val decr : Coordinate.axis -> t -> t | ~incr~ | Returns a new ~Powers.t~ with the power on the given axis incremented | | ~decr~ | Returns a new ~Powers.t~ with the power on the given axis decremented. As opposed to ~of_int_tuple~, the values may become negative| + Example: #+begin_example Powers.get Coordinate.Y (Powers.of_int_tuple (2,3,1));; - : int = 3 diff --git a/common/range.org b/common/range.org index c8520cd..06de80f 100644 --- a/common/range.org +++ b/common/range.org @@ -24,6 +24,7 @@ ** Type + <<<~Range.t~>>> #+begin_src ocaml :tangle (eval mli) type t #+end_src diff --git a/common/spin.org b/common/spin.org index ca18383..9d501c8 100644 --- a/common/spin.org +++ b/common/spin.org @@ -18,6 +18,7 @@ ** Type + <<<~Spin.t~>>> #+begin_src ocaml :tangle (eval mli) type t = Alfa | Beta #+end_src diff --git a/common/test/bitstring.ml b/common/test/bitstring.ml index 906d3d6..7063493 100644 --- a/common/test/bitstring.ml +++ b/common/test/bitstring.ml @@ -19,7 +19,8 @@ check_bool "of_z" true (one_x = (of_z (Z.of_int x))); -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.(shift_left (of_int 15) 2);; * - : Bitstring.t = * --++++---------------------------------------------------------- @@ -59,7 +60,8 @@ check_bool "testbit6" false (testbit (of_z (Z.of_int 8)) 4); -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.(logor (of_int 15) (of_int 73));; * - : Bitstring.t = * ++++--+--------------------------------------------------------- @@ -90,7 +92,8 @@ check_bool "to_list" true ([ 1 ; 3 ; 4 ; 6 ] = (to_list (of_int 45))); -(* #+begin_example +(* Example: + * #+begin_example * Bitstring.permutations 2 4;; * - : Bitstring.t list = * [++--------------------------------------------------------------; diff --git a/common/util.org b/common/util.org index 3f0d21f..ba7031a 100644 --- a/common/util.org +++ b/common/util.org @@ -53,11 +53,13 @@ CAMLprim double erf_float(double x) { #+end_src #+begin_src ocaml :tangle (eval mli) -external erf_float : float -> float = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] +external erf_float : float -> float + = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] #+end_src #+begin_src ocaml :tangle (eval ml) :exports none -external erf_float : float -> float = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] +external erf_float : float -> float + = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc] #+end_src *** Erfc @@ -73,7 +75,8 @@ CAMLprim double erfc_float(double x) { #+end_src #+begin_src ocaml :tangle (eval mli) -external erfc_float : float -> float = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc] +external erfc_float : float -> float + = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc] #+end_src #+begin_src ocaml :tangle (eval ml) :exports none @@ -94,11 +97,13 @@ CAMLprim double gamma_float(double x) { #+end_src #+begin_src ocaml :tangle (eval mli) -external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] +external gamma_float : float -> float + = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] #+end_src #+begin_src ocaml :tangle (eval ml) :exports none -external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] +external gamma_float : float -> float + = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] #+end_src *** Popcnt @@ -627,6 +632,7 @@ val pp_bitstring : int -> Format.formatter -> Z.t -> unit | ~pp_float_2darray_size~ | Printer for matrices with size | | ~pp_bitstring~ | Printer for bit strings (used by ~Bitstring~ module) | + Example: #+begin_example pp_float_array_size: [ 6: 1.000000 1.732051 1.732051 1.000000 1.732051 1.000000 ] diff --git a/common/zkey.org b/common/zkey.org index e825a82..5a7bd04 100644 --- a/common/zkey.org +++ b/common/zkey.org @@ -21,6 +21,7 @@ The small integers x, y and z are stored compactly in this 126-bits space: + Example: #+begin_example Left Right 3 [--------------------------------------------------------------] [------------------|---------------|---------------|---------------] @@ -41,6 +42,7 @@ ** Types + <<<~Zkey.t~>>> #+begin_src ocaml :tangle (eval mli) type t diff --git a/common/zmap.org b/common/zmap.org index 1883da2..c4b01de 100644 --- a/common/zmap.org +++ b/common/zmap.org @@ -18,6 +18,7 @@ ** Type + <<<~Zmap.t~>>> #+begin_src ocaml :tangle (eval mli) include module type of Hashtbl.Make(Zkey) #+end_src diff --git a/docs/ao.html b/docs/ao.html index b5d2d46..3cadee8 100644 --- a/docs/ao.html +++ b/docs/ao.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Atomic Orbitals @@ -193,12 +193,29 @@ .org-svg { width: 90%; } /*]]>*/--> - - - - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + -
+
+ UP + | + HOME +

QCaml documentation

-
-

Table of Contents

- -
-
-

chamo_bg.png +

+

chamo_bg.png

-QCaml is an OCaml library for writing quantum chemistry codes. +QCaml is an OCaml library for writing quantum chemistry codes. It is written using literate programming with org-mode.

@@ -259,9 +272,11 @@ This loads all the sub-libraries provided with QCaml, and installs the pretty printers.

-
-

1 Documentation of Modules

-
+ +

+List of modules +

+
  • Ao
  • Common
  • @@ -277,11 +292,9 @@ the pretty printers.
  • Top
-
-

Author: Anthony Scemama

-

Created: 2021-01-08 Fri 23:16

+

Created: 2021-01-27 Wed 23:36

Validate

diff --git a/docs/index.org b/docs/index.org index fb5cd0a..1ca4aa7 100644 --- a/docs/index.org +++ b/docs/index.org @@ -1,9 +1,10 @@ #+TITLE: QCaml documentation -#+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup +#+SETUPFILE: ../docs/theme.setup + #+ATTR_HTML: :width 400px [[./chamo_bg.png]] - - QCaml is an OCaml library for writing quantum chemistry codes. + + QCaml is an OCaml library for writing quantum chemistry codes. It is written using literate programming with org-mode. To use it interactively in the top level or in a Jupyter or org-mode @@ -15,13 +16,14 @@ This loads all the sub-libraries provided with QCaml, and installs the pretty printers. - -* Documentation of Modules + + + *List of modules* #+NAME: modules #+begin_src sh :exports none ls ../*/README.org \ - | cut -d '/' -f 2 + | cut -d '/' -f 2 #+end_src #+NAME: list diff --git a/docs/linear_algebra.html b/docs/linear_algebra.html index 4a30ad3..1258139 100644 --- a/docs/linear_algebra.html +++ b/docs/linear_algebra.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Linear Algebra @@ -193,12 +193,29 @@ .org-svg { width: 90%; } /*]]>*/--> - - - - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - - + + + + +