From d0f61750da7e376fb315642f4f600693a4ebc2b2 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 20 Jan 2021 23:55:34 +0100 Subject: [PATCH] Add Gaussian.Atomic_shell_pair --- ao/README.org | 1 + ao/basis_gaussian.org | 1 + ao/lib/basis_gaussian.mli | 1 + common/README.org | 1 + docs/ao.html | 101 ++++--- docs/common.html | 468 +++++++++++++++-------------- docs/gaussian.html | 222 +++++++++++--- docs/gaussian_integrals.html | 12 +- docs/index.html | 12 +- docs/index.org | 35 --- docs/linear_algebra.html | 12 +- docs/mo.html | 48 +-- docs/particles.html | 182 +++++------ docs/perturbation.html | 52 ++-- docs/top.html | 12 +- gaussian/README.org | 1 + gaussian/atomic_shell_pair.org | 161 ++++++++++ gaussian/lib/atomic_shell_pair.ml | 70 +++-- gaussian/lib/atomic_shell_pair.mli | 78 +++-- gaussian_integrals/README.org | 1 + linear_algebra/README.org | 1 + mo/README.org | 1 + operators/README.org | 1 + particles/README.org | 1 + particles/lib/nuclei.mli | 1 + particles/nuclei.org | 1 + perturbation/README.org | 1 + qcaml/README.org | 1 + simulation/README.org | 1 + top/README.org | 1 + top/lib/install_printers.ml | 1 + 31 files changed, 921 insertions(+), 561 deletions(-) create mode 100644 gaussian/atomic_shell_pair.org diff --git a/ao/README.org b/ao/README.org index a35bc76..6c03af3 100644 --- a/ao/README.org +++ b/ao/README.org @@ -1,4 +1,5 @@ #+TITLE: Atomic Orbitals +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/ao/basis_gaussian.org b/ao/basis_gaussian.org index 745536a..d6d7c4b 100644 --- a/ao/basis_gaussian.org +++ b/ao/basis_gaussian.org @@ -25,6 +25,7 @@ ** Type + <<<~Gaussian_basis.t~>>> #+NAME: types #+begin_src ocaml :tangle (eval mli) open Common diff --git a/ao/lib/basis_gaussian.mli b/ao/lib/basis_gaussian.mli index 311a462..4ee6a47 100644 --- a/ao/lib/basis_gaussian.mli +++ b/ao/lib/basis_gaussian.mli @@ -1,5 +1,6 @@ (* Type * + * <<<~Gaussian_basis.t~>>> * #+NAME: types *) (* [[file:~/QCaml/ao/basis_gaussian.org::types][types]] *) diff --git a/common/README.org b/common/README.org index a4153f1..1b15c53 100644 --- a/common/README.org +++ b/common/README.org @@ -1,4 +1,5 @@ #+TITLE: Common +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup diff --git a/docs/ao.html b/docs/ao.html index 6e8580d..b5d2d46 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 @@ -245,42 +245,46 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"> -
+
+ UP + | + HOME +

Atomic Orbitals

-
"Atomic basis set"
+
"Atomic basis set"
 
-
-

1 Gaussian basis

+
+

1 Gaussian basis

Data structure for Gaussian Atomic Orbitals: @@ -298,11 +302,14 @@ nucleus \(A\).

-
-

1.1 Type

+
+

1.1 Type

+

+Gaussian_basis.t +

-
open Common
+
open Common
 open Particles
 open Linear_algebra
 open Gaussian_integrals
@@ -314,8 +321,8 @@ nucleus \(A\).
 
-
-

1.2 Access

+
+

1.2 Access

val basis             : t -> Gaussian.Basis.t
@@ -406,8 +413,8 @@ nucleus \(A\).
 
-
-

1.3 Computation

+
+

1.3 Computation

val values : t -> Coordinate.t -> Gaussian.Basis.t Vector.t
@@ -432,8 +439,8 @@ nucleus \(A\).
 
-
-

1.4 Creation

+
+

1.4 Creation

val make : basis:Gaussian.Basis.t ->
@@ -456,15 +463,15 @@ Defaults:
 
  • cartesian : false
  • -
    +
     let b = Ao.Basis_gaussian.make ~basis nuclei ;;
     val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs
     
    -
    -

    1.5 Printers

    +
    +

    1.5 Printers

    val pp : Format.formatter -> t -> unit
    @@ -474,23 +481,23 @@ val b : Ao.Basis_gaussian.t = Gaussian Basis, spherical, 15 AOs
     
    -
    -

    2 Basis

    +
    +

    2 Basis

    Data structure for Atomic Orbitals.

    -
    -

    2.1 Dimensions   noexports

    +
    +

    2.1 Dimensions   noexports

    -
    -

    2.2 Polymorphic types

    +
    +

    2.2 Polymorphic types

    -
    type t =
    +
    type t =
       | Unknown
       | Gaussian of Basis_gaussian.t
     
    @@ -498,8 +505,8 @@ Data structure for Atomic Orbitals.
    -
    -

    2.3 Types

    +
    +

    2.3 Types

    type t
    @@ -514,8 +521,8 @@ Data structure for Atomic Orbitals.
     
    -
    -

    2.4 Conversions

    +
    +

    2.4 Conversions

    val of_nuclei_and_basis_filename :
    @@ -549,15 +556,15 @@ Defaults:
     
  • cartesian : false
  • -
    +
     let b = Ao.Basis.of_nuclei_and_basis_filename ~nuclei filename;;
     val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
     
    -
    -

    2.5 Access

    +
    +

    2.5 Access

    val size              : t -> int
    @@ -655,8 +662,8 @@ val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
     
    -
    -

    2.6 Printers

    +
    +

    2.6 Printers

    val pp : Format.formatter -> t -> unit
    @@ -668,7 +675,7 @@ val b : Ao.Basis.t = Gaussian Basis, spherical, 15 AOs
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/common.html b/docs/common.html index f41a29f..c20c6a9 100644 --- a/docs/common.html +++ b/docs/common.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Common @@ -245,146 +245,150 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"> -
    +
    + UP + | + HOME +

    Common

    Table of Contents

    -
    "Utility functions used by all the other directories."
    +
    "Utility functions used by all the other directories."
     
    -
    -

    1 Angular Momentum

    +
    +

    1 Angular Momentum

    Azimuthal quantum number, repsesented as \( s,p,d,\dots \) .

    -
    -

    1.1 Type

    +
    +

    1.1 Type

    -
    type t =
    +
    type t =
       | S | P | D | F | G | H | I | J | K | L | M | N | O
       | Int of int
     
    @@ -411,8 +415,8 @@ quartets, use in the two-electron operators.
     
    -
    -

    1.2 Conversions

    +
    +

    1.2 Conversions

    val of_char : char -> t
    @@ -461,7 +465,7 @@ quartets, use in the two-electron operators.
     
     
     
    -
    +
     Angular_momentum.of_char 'p';;
     - : Angular_momentum.t = P
     
    @@ -480,8 +484,8 @@ Angular_momentum.(to_string D);;
     
    -
    -

    1.3 Shell functions

    +
    +

    1.3 Shell functions

    val n_functions : t -> int
    @@ -510,7 +514,7 @@ Angular_momentum.(to_string D);;
     
     
     
    -
    +
     Angular_momentum.(n_functions D) ;;
     - : int = 6
     
    @@ -523,8 +527,8 @@ Angular_momentum.( zkey_array (Doublet (P,S)) );;
     
    -
    -

    1.4 Arithmetic

    +
    +

    1.4 Arithmetic

    val ( + ) : t -> t -> t
    @@ -532,7 +536,7 @@ Angular_momentum.( zkey_array (Doublet (P,S)) );;
     
    -
    +
     Angular_momentum.(D + P);;
     - : Angular_momentum.t = F
     
    @@ -542,8 +546,8 @@ Angular_momentum.(F - P);;
     
    -
    -

    1.5 Printers

    +
    +

    1.5 Printers

    Printers can print as a string (default) or as an integer. @@ -558,12 +562,12 @@ Printers can print as a string (default) or as an integer.

    -
    -

    1.6 TODO Tests

    +
    +

    1.6 TODO Tests

    -
    -

    2 Bit string

    +
    +

    2 Bit string

    We define here a data type to handle bit strings efficiently. When @@ -575,8 +579,8 @@ bit string as a multi-precision integer.

    -
    -

    2.1 Type

    +
    +

    2.1 Type

    type t
    @@ -585,8 +589,8 @@ bit string as a multi-precision integer.
     
    -
    -

    2.2 General implementation

    +
    +

    2.2 General implementation

    val of_int : int -> t
    @@ -735,13 +739,13 @@ bit string as a multi-precision integer.
     
     
     
    -
    +
     Bitstring.of_int 15;;
     - : Bitstring.t =
     ++++------------------------------------------------------------
     
    -
    +
     Bitstring.(shift_left (of_int 15) 2);;
     - : Bitstring.t =
     --++++----------------------------------------------------------
    @@ -761,7 +765,7 @@ Bitstring.(testbit (of_int 15) 4);;
     - : bool = false
     
    -
    +
     Bitstring.(logor (of_int 15) (of_int 73));;
     - : Bitstring.t =
     ++++--+---------------------------------------------------------
    @@ -776,7 +780,7 @@ Bitstring.(logxor (of_int 15) (of_int 73));;
     
    -
    +
     Bitstring.(plus_one (of_int 15));;
     - : Bitstring.t =
     ----+-----------------------------------------------------------
    @@ -787,7 +791,7 @@ Bitstring.(minus_one (of_int 15));;
     
    -
    +
     Bitstring.(trailing_zeros (of_int 12));;
     - : int = 2
     
    @@ -798,12 +802,12 @@ Bitstring.(popcount (of_int 15));;
     - : int = 4
     
    -
    +
     Bitstring.(to_list (of_int 45));;
     - : int list = [1; 3; 4; 6]
     
    -
    +
        Bitstring.permutations 2 4;;
     - : Bitstring.t list =
     [++--------------------------------------------------------------;
    @@ -816,8 +820,8 @@ Bitstring.(to_list (of_int 45));;
     
    -
    -

    2.3 Printers

    +
    +

    2.3 Printers

    val pp : Format.formatter -> t -> unit
    @@ -827,13 +831,13 @@ Bitstring.(to_list (of_int 45));;
     
    -
    -

    3 Charge

    +
    +

    3 Charge

    -
    -

    3.1 Type

    +
    +

    3.1 Type

    type t
    @@ -846,8 +850,8 @@ This type should be used for all charges in the program (electrons, nuclei, 
     
    -
    -

    3.2 Conversions

    +
    +

    3.2 Conversions

    val of_float : float -> t
    @@ -863,8 +867,8 @@ This type should be used for all charges in the program (electrons, nuclei, 
     
    -
    -

    3.3 Simple operations

    +
    +

    3.3 Simple operations

    val ( + ) : t -> t -> t
    @@ -877,8 +881,8 @@ This type should be used for all charges in the program (electrons, nuclei, 
     
    -
    -

    3.4 Printers

    +
    +

    3.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -888,8 +892,8 @@ This type should be used for all charges in the program (electrons, nuclei, 
     
    -
    -

    4 Command line

    +
    +

    4 Command line

    This module is a wrapper around the Getopt library and helps to @@ -945,11 +949,11 @@ Then, define what to do with the arguments:

    -
    -

    4.1 Type

    +
    +

    4.1 Type

    -
    type short_opt     = char
    +
    type short_opt     = char
     type long_opt      = string
     type optional      = Mandatory | Optional
     type documentation = string
    @@ -980,8 +984,8 @@ don't (ls -l) and for some arguments the argument is optional
     
    -
    -

    4.2 Mutable attributes

    +
    +

    4.2 Mutable attributes

    All the options are stored in the hash table dict where the key @@ -1011,8 +1015,8 @@ Function to create an anonymous argument.

    -
    -

    4.3 Query functions

    +
    +

    4.3 Query functions

    val get       : long_opt -> string option
    @@ -1050,8 +1054,8 @@ Function to create an anonymous argument.
     
    -
    -

    4.4 Specification

    +
    +

    4.4 Specification

    val set_specs : description list -> unit
    @@ -1066,16 +1070,16 @@ Sets the specifications of the current program from a list of
     
    -
    -

    5 Constants

    +
    +

    5 Constants

    All constants used in the program.

    -
    -

    5.1 Thresholds

    +
    +

    5.1 Thresholds

    val epsilon          : float
    @@ -1106,8 +1110,8 @@ All constants used in the program.
     
    -
    -

    5.2 Mathematical constants

    +
    +

    5.2 Mathematical constants

    val pi             : float
    @@ -1162,8 +1166,8 @@ All constants used in the program.
     
    -
    -

    5.3 Physical constants

    +
    +

    5.3 Physical constants

    val a0       : float
    @@ -1207,8 +1211,8 @@ All constants used in the program.
     
    -
    -

    6 Coordinate

    +
    +

    6 Coordinate

    Coordinates in 3D space. @@ -1221,11 +1225,11 @@ module.

    -
    -

    6.1 Type

    +
    +

    6.1 Type

    -
    type bohr 
    +
    type bohr 
     type angstrom 
     
     type xyz = {
    @@ -1244,8 +1248,8 @@ module.
     
    -
    -

    6.2 Creation

    +
    +

    6.2 Creation

    val make          : 'a point -> t
    @@ -1282,8 +1286,8 @@ module.
     
    -
    -

    6.3 Conversion

    +
    +

    6.3 Conversion

    val bohr_to_angstrom : bohr point -> angstrom point
    @@ -1314,8 +1318,8 @@ module.
     
    -
    -

    6.4 Vector operations

    +
    +

    6.4 Vector operations

    val neg    : t -> t
    @@ -1374,7 +1378,7 @@ module.
     
     
     
    -
    +
     Coordinate.neg { x=1. ; y=2. ; z=3. } ;;
     - : Coordinate.t =  -1.0000  -2.0000  -3.0000
     
    @@ -1400,8 +1404,8 @@ Coordinate.(
     
    -
    -

    6.5 Printers

    +
    +

    6.5 Printers

    val pp : Format.formatter -> t -> unit
    @@ -1417,13 +1421,13 @@ Coordinates can be printed in bohr or angstrom.
     
    -
    -

    7 Non-negative float

    +
    +

    7 Non-negative float

    -
    -

    7.1 Type

    +
    +

    7.1 Type

    type t = private float
    @@ -1432,8 +1436,8 @@ Coordinates can be printed in bohr or angstrom.
     
    -
    -

    7.2 Conversions

    +
    +

    7.2 Conversions

    val of_float        : float -> t
    @@ -1453,16 +1457,16 @@ The unsafe variant doesn't do this check.
     
    -
    -

    8 Powers

    +
    +

    8 Powers

    Contains powers of x, y and z describing the polynomials in atomic basis sets.

    -
    -

    8.1 Type

    +
    +

    8.1 Type

    type t = private {
    @@ -1480,8 +1484,8 @@ Contains powers of x, y and z describing the polynomials in atomic basis sets.
     
    -
    -

    8.2 Conversions

    +
    +

    8.2 Conversions

    val of_int_tuple : int * int * int -> t
    @@ -1489,7 +1493,7 @@ Contains powers of x, y and z describing the polynomials in atomic basis sets.
     
    -
    +
     Powers.of_int_tuple (2,3,1);;
     - : Powers.t = x^2 + y^3 + z^1
     
    @@ -1499,8 +1503,8 @@ Powers.(to_int_tuple (of_int_tuple (2,3,1)));;
     
    -
    -

    8.3 Operations

    +
    +

    8.3 Operations

    val get  : Coordinate.axis -> t -> int
    @@ -1535,7 +1539,7 @@ Powers.(to_int_tuple (of_int_tuple (2,3,1)));;
     
     
     
    -
    +
     Powers.get Coordinate.Y (Powers.of_int_tuple (2,3,1));;
     - : int = 3
     
    @@ -1549,8 +1553,8 @@ Powers.decr Coordinate.Y (Powers.of_int_tuple (2,3,1));;
     
    -
    -

    8.4 Printers

    +
    +

    8.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -1560,8 +1564,8 @@ Powers.decr Coordinate.Y (Powers.of_int_tuple (2,3,1));;
     
    -
    -

    9 QCaml

    +
    +

    9 QCaml

    QCaml-specific parameters @@ -1596,8 +1600,8 @@ QCaml-specific parameters

    -
    -

    10 Range

    +
    +

    10 Range

    A range is a sorted list of integers in an interval. @@ -1612,8 +1616,8 @@ A range is a sorted list of integers in an interval.

    -
    -

    10.1 Type

    +
    +

    10.1 Type

    type t
    @@ -1622,8 +1626,8 @@ A range is a sorted list of integers in an interval.
     
    -
    -

    10.2 Conversion

    +
    +

    10.2 Conversion

    val of_string   : string -> t
    @@ -1634,8 +1638,8 @@ A range is a sorted list of integers in an interval.
     
    -
    -

    10.3 Printers

    +
    +

    10.3 Printers

    val pp : Format.formatter -> t -> unit
    @@ -1645,16 +1649,16 @@ A range is a sorted list of integers in an interval.
     
    -
    -

    11 Spin

    +
    +

    11 Spin

    Electron spin

    -
    -

    11.1 Type

    +
    +

    11.1 Type

    type t = Alfa | Beta
    @@ -1669,8 +1673,8 @@ letters as Beta, so the alignment of the code is nicer.
     
    -
    -

    11.2 Functions

    +
    +

    11.2 Functions

    val other : t -> t
    @@ -1683,8 +1687,8 @@ Returns the opposite spin
     
    -
    -

    11.3 Printers

    +
    +

    11.3 Printers

    val pp : Format.formatter -> t -> unit
    @@ -1694,8 +1698,8 @@ Returns the opposite spin
     
    -
    -

    12 Util

    +
    +

    12 Util

    Utility functions. @@ -1703,8 +1707,8 @@ Utility functions.

    -
    -

    12.1 External C functions

    +
    +

    12.1 External C functions

    @@ -1748,8 +1752,8 @@ Utility functions.
    -
    -

    12.1.1 Erf

    +
    +

    12.1.1 Erf

    external erf_float : float -> float = "erf_float_bytecode" "erf_float" [@@unboxed] [@@noalloc]
    @@ -1758,8 +1762,8 @@ Utility functions.
     
    -
    -

    12.1.2 Erfc

    +
    +

    12.1.2 Erfc

    external erfc_float : float -> float = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc]
    @@ -1768,8 +1772,8 @@ Utility functions.
     
    -
    -

    12.1.3 Gamma

    +
    +

    12.1.3 Gamma

    external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc]
    @@ -1778,8 +1782,8 @@ Utility functions.
     
    -
    -

    12.1.4 Popcnt

    +
    +

    12.1.4 Popcnt

    val popcnt : int64 -> int
    @@ -1788,8 +1792,8 @@ Utility functions.
     
    -
    -

    12.1.5 Trailz

    +
    +

    12.1.5 Trailz

    val trailz : int64 -> int
    @@ -1798,8 +1802,8 @@ Utility functions.
     
    -
    -

    12.1.6 Leadz

    +
    +

    12.1.6 Leadz

    val leadz : int64 -> int
    @@ -1808,13 +1812,13 @@ Utility functions.
     
    -
    -

    12.1.7 Test

    +
    +

    12.1.7 Test

    -
    -

    12.2 General functions

    +
    +

    12.2 General functions

    val fact : int -> float
    @@ -1887,8 +1891,8 @@ Utility functions.
     
    -
    -

    12.3 Functions related to the Boys function

    +
    +

    12.3 Functions related to the Boys function

    val incomplete_gamma : alpha:float -> float -> float
    @@ -1945,8 +1949,8 @@ where \(\gamma\) is the incomplete gamma function.
     
    -
    -

    12.4 List functions

    +
    +

    12.4 List functions

    val list_some  : 'a option list -> 'a list
    @@ -1983,8 +1987,8 @@ where \(\gamma\) is the incomplete gamma function.
     
    -
    -

    12.5 Array functions

    +
    +

    12.5 Array functions

    val array_range   : int -> int -> int array
    @@ -2021,8 +2025,8 @@ where \(\gamma\) is the incomplete gamma function.
     
    -
    -

    12.6 Stream functions

    +
    +

    12.6 Stream functions

    val stream_range   : int -> int -> int Stream.t
    @@ -2059,8 +2063,8 @@ where \(\gamma\) is the incomplete gamma function.
     
    -
    -

    12.7 Printers

    +
    +

    12.7 Printers

    val pp_float_array_size   : Format.formatter -> float array -> unit
    @@ -2107,7 +2111,7 @@ where \(\gamma\) is the incomplete gamma function.
     
     
     
    -
    +
     pp_float_array_size:
     [ 6:   1.000000   1.732051   1.732051   1.000000   1.732051   1.000000 ]
     
    @@ -2130,8 +2134,8 @@ pp_bitstring 14:
     
    -
    -

    13 Zkey

    +
    +

    13 Zkey

    Encodes the powers of x, y, z in a compact form, suitable for being @@ -2144,7 +2148,7 @@ The small integers x, y and z are stored compactly in this 126-bits space:

    -
    +
                                     Left                                                                Right
      3 [--------------------------------------------------------------]       [------------------|---------------|---------------|---------------]
                                                                                                          x               y               z        
    @@ -2165,8 +2169,8 @@ The values of x,y,z should be positive and should not exceed 32767 for
     

    -
    -

    13.1 Types

    +
    +

    13.1 Types

    type t 
    @@ -2182,8 +2186,8 @@ The values of x,y,z should be positive and should not exceed 32767 for
     
    -
    -

    13.2 Conversions

    +
    +

    13.2 Conversions

    val of_powers_three  : Powers.t -> t
    @@ -2262,8 +2266,8 @@ The values of x,y,z should be positive and should not exceed 32767 for
     
    -
    -

    13.3 Functions for hash tables

    +
    +

    13.3 Functions for hash tables

    val hash    : t -> int
    @@ -2300,8 +2304,8 @@ The values of x,y,z should be positive and should not exceed 32767 for
     
    -
    -

    13.4 Printers

    +
    +

    13.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -2311,16 +2315,16 @@ The values of x,y,z should be positive and should not exceed 32767 for
     
    -
    -

    14 Zmap

    +
    +

    14 Zmap

    A hash table where the keys are Zkey

    -
    -

    14.1 Type

    +
    +

    14.1 Type

    include module type of Hashtbl.Make(Zkey)
    @@ -2332,7 +2336,7 @@ A hash table where the keys are Zkey
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/gaussian.html b/docs/gaussian.html index dbc8d02..6ad5d7b 100644 --- a/docs/gaussian.html +++ b/docs/gaussian.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Gaussian @@ -245,39 +245,51 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"> -
    +
    + UP + | + HOME +

    Gaussian

    -
    "Gaussian basis sets"
    +
    "Gaussian basis sets"
     
    -
    -

    1 Atomic shell

    +
    +

    1 Atomic shell

    Set of contracted Gaussians differing only by the powers of \(x\), \(y\) and \(z\), with a @@ -310,8 +322,8 @@ particular powers of \(x,y,z\) (PrimitiveShell.norm_coef_scale) -

    -

    1.1 Type

    +
    +

    1.1 Type

    type t
    @@ -322,8 +334,8 @@ particular powers of \(x,y,z\) (PrimitiveShell.norm_coef_scale)
     
    -
    -

    1.2 Access

    +
    +

    1.2 Access

    val ang_mom           : t -> Angular_momentum.t
    @@ -400,14 +412,14 @@ particular powers of \(x,y,z\) (PrimitiveShell.norm_coef_scale)
     
     
    -
    +
     
     
    -
    -

    1.3 Creation

    +
    +

    1.3 Creation

    val make : ?index:int -> Contracted_shell.t array -> t 
    @@ -439,8 +451,8 @@ particular powers of \(x,y,z\) (PrimitiveShell.norm_coef_scale)
     
    -
    -

    1.4 Printers

    +
    +

    1.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -450,8 +462,8 @@ particular powers of \(x,y,z\) (PrimitiveShell.norm_coef_scale)
     
    -
    -

    2 Atomic shell pair couple

    +
    +

    2 Atomic shell pair couple

    An atomic shell pair couple is the cartesian product between two sets of functions, one @@ -467,8 +479,8 @@ acting on different electrons, since they will be coupled by a two-electron oper

    -
    -

    2.1 Type

    +
    +

    2.1 Type

    type t
    @@ -479,8 +491,8 @@ acting on different electrons, since they will be coupled by a two-electron oper
     
    -
    -

    2.2 Access

    +
    +

    2.2 Access

    val ang_mom                       : t -> Angular_momentum.t
    @@ -565,8 +577,8 @@ acting on different electrons, since they will be coupled by a two-electron oper
     
    -
    -

    2.3 Creation

    +
    +

    2.3 Creation

    val make : ?cutoff:float -> Atomic_shell_pair.t -> Atomic_shell_pair.t -> t option
    @@ -592,14 +604,14 @@ Default cutoff is \(\epsilon\).
     
     
     
    -
    +
     
     
    -
    -

    2.4 Printers

    +
    +

    2.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -608,10 +620,148 @@ Default cutoff is \(\epsilon\).
     
    + +
    +

    3 Atomic shell pair

    +
    +

    +Data structure to represent pairs of atomic shells. The products of +functions in the shell pair are one-electron functions. +

    + +

    +An atomic shell pair is an array of pairs of contracted shells. +

    +
    + +
    +

    3.1 Type

    +
    +
    +
    type t
    +
    +open Common
    +
    +
    +
    +
    + +
    +

    3.2 Access

    +
    +
    +
    val atomic_shell_a         : t -> Atomic_shell.t
    +val atomic_shell_b         : t -> Atomic_shell.t
    +val contracted_shell_pairs : t -> Contracted_shell_pair.t list
    +val ang_mom                : t -> Angular_momentum.t
    +val monocentric            : t -> bool
    +val norm_scales            : t -> float array
    +val a_minus_b              : t -> Coordinate.t
    +val a_minus_b_sq           : t -> float
    +
    +
    + + + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    atomic_shell_aReturns the first Atomic_shell.t which was used to build the atomic shell pair.
    atomic_shell_bReturns the second Atomic_shell.t which was used to build the atomic shell pair.
    contracted_shell_pairsReturns an array of ContractedShellPair.t, containing all the pairs of contracted functions used to build the atomic shell pair.
    norm_scalesnormcoef.(i) / normcoef.(0)
    ang_momTotal angular Momentum
    monocentricIf true, the two atomic shells have the same center.
    a_minus_bReturns \(A-B\)
    a_minus_b_sqReturns \(\vert A-B \vert^2\)
    +
    +
    + +
    +

    3.3 Creation

    +
    +
    +
    val make : ?cutoff:float -> Atomic_shell.t -> Atomic_shell.t -> t option
    +
    +
    + +

    +Creates an atomic shell pair from two atomic shells. +

    + +

    +The contracted shell pairs contains the only pairs of primitives for which +the norm is greater than cutoff. +

    + +

    +If all the contracted shell pairs are not significant, the function returns +None. +

    + +
    +
    val of_atomic_shell_array : ?cutoff:float -> Atomic_shell.t array -> t option array array
    +
    +
    + +

    +Creates all possible atomic shell pairs from an array of atomic shells. +If an atomic shell pair is not significant, sets the value to None. +

    +
    +
    + +
    +

    3.4 Printers

    +
    +
    +
    val pp : Format.formatter -> t -> unit
    +
    +
    +
    +
    +

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:20

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/gaussian_integrals.html b/docs/gaussian_integrals.html index dd7f4b6..8fe8419 100644 --- a/docs/gaussian_integrals.html +++ b/docs/gaussian_integrals.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Gaussian integrals @@ -223,16 +223,20 @@ -
    +
    + UP + | + HOME +

    Gaussian integrals

    -
    "Integrals on the Gaussian basis sets"
    +
    "Integrals on the Gaussian basis sets"
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/index.html b/docs/index.html index c2fcd70..338794b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + QCaml documentation @@ -229,12 +229,12 @@

    Table of Contents

    -
    +

    chamo_bg.png

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

    -
    -

    1 Documentation of Modules

    +
    +

    1 Documentation of Modules

    • Ao
    • @@ -281,7 +281,7 @@ the pretty printers.

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-08 Fri 23:16

    Validate

    diff --git a/docs/index.org b/docs/index.org index 78cb746..fb5cd0a 100644 --- a/docs/index.org +++ b/docs/index.org @@ -24,20 +24,6 @@ ls ../*/README.org \ | cut -d '/' -f 2 #+end_src - #+RESULTS: modules - | ao | - | common | - | gaussian_integrals | - | gaussian | - | linear_algebra | - | mo | - | operators | - | particles | - | perturbation | - | qcaml | - | simulation | - | top | - #+NAME: list #+begin_src python :var modules=modules :exports results :results output drawer for m in modules: @@ -45,24 +31,3 @@ for m in modules: m2 = m.replace("_"," ").capitalize() print(f"- [[./{m}.html][{m2}]]") #+end_src - - #+RESULTS: list - :results: - - [[./ao.html][Ao]] - - [[./common.html][Common]] - - [[./gaussian_integrals.html][Gaussian integrals]] - - [[./gaussian.html][Gaussian]] - - [[./linear_algebra.html][Linear algebra]] - - [[./mo.html][Mo]] - - [[./operators.html][Operators]] - - [[./particles.html][Particles]] - - [[./perturbation.html][Perturbation]] - - [[./qcaml.html][Qcaml]] - - [[./simulation.html][Simulation]] - - [[./top.html][Top]] - :end: - - - - - diff --git a/docs/linear_algebra.html b/docs/linear_algebra.html index 23e773a..4a30ad3 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 @@ -223,16 +223,20 @@ -
    +
    + UP + | + HOME +

    Linear Algebra

    -
    "Linear algebra utilities of QCaml libraries."
    +
    "Linear algebra utilities of QCaml libraries."
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/mo.html b/docs/mo.html index aa1b075..a6035cc 100644 --- a/docs/mo.html +++ b/docs/mo.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Molecular orbitals @@ -223,42 +223,46 @@ -
    +
    + UP + | + HOME +

    Molecular orbitals

    -
    "Molecular orbitals"
    +
    "Molecular orbitals"
     
    -
    -

    1 Frozen core

    +
    +

    1 Frozen core

    Defines how the core electrons are frozen, for each atom.

    -
    -

    1.1 Type

    +
    +

    1.1 Type

    -
    type kind =
    +
    type kind =
       | All_electron
       | Small
       | Large
    @@ -272,8 +276,8 @@ Defines how the core electrons are frozen, for each atom.
     
    -
    -

    1.2 Creation

    +
    +

    1.2 Creation

    val make : kind -> Particles.Nuclei.t -> t
    @@ -309,7 +313,7 @@ Defines how the core electrons are frozen, for each atom.
     
     
     
    -
    +
     let f = Frozen_core.(make Small nuclei) ;;
     val f : Frozen_core.t = [|0; 2; 2; 0|]
     
    @@ -319,8 +323,8 @@ val f : Frozen_core.t = [|0; 2; 2; 0|]
     
    -
    -

    1.3 Access

    +
    +

    1.3 Access

    val num_elec : t -> int
    @@ -349,7 +353,7 @@ val f : Frozen_core.t = [|0; 2; 2; 0|]
     
     
     
    -
    +
     Frozen_core.num_elec f ;;
     - : int = 4
     
    @@ -359,8 +363,8 @@ Frozen_core.num_mos f ;;
     
    -
    -

    1.4 Printers

    +
    +

    1.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -372,7 +376,7 @@ Frozen_core.num_mos f ;;
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/particles.html b/docs/particles.html index a4a7e40..69b8aee 100644 --- a/docs/particles.html +++ b/docs/particles.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Common @@ -245,81 +245,85 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"> -
    +
    + UP + | + HOME +

    Common

    -
    "Information relative to particles (electrons and nuclei)."
    +
    "Information relative to particles (electrons and nuclei)."
     
    -
    -

    1 Electrons

    +
    +

    1 Electrons

    Data structure which contains the number of α and β electrons.

    -
    -

    1.1 Type

    +
    +

    1.1 Type

    -
    type t 
    +
    type t 
     
    -
    -

    1.2 Creation

    +
    +

    1.2 Creation

    open Common
    @@ -351,15 +355,15 @@ Data structure which contains the number of α and β electrons.
     
     
     of_atoms
    -Creates the data relative to electrons for a molecular system described by Nuclei.t for a given total charge and spin multiplicity.
    +Creates the data relative to electrons for a molecular system described by Nuclei.t for a given total charge and spin multiplicity.
     
     
     
     
    -
    -

    1.3 Access

    +
    +

    1.3 Access

    val charge       : t -> Charge.t
    @@ -408,8 +412,8 @@ Data structure which contains the number of α and β electrons.
     
    -
    -

    1.4 Printers

    +
    +

    1.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -418,24 +422,24 @@ Data structure which contains the number of α and β electrons.
     
    -
    -

    1.5 Tests

    +
    +

    1.5 Tests

    -
    -

    2 Element

    +
    +

    2 Element

    Chemical elements.

    -
    -

    2.1 Type

    +
    +

    2.1 Type

    -
    type t =
    +
    type t =
       |X
       |H                                                 |He
       |Li|Be                              |B |C |N |O |F |Ne
    @@ -452,8 +456,8 @@ Chemical elements.
     
    -
    -

    2.2 Conversion

    +
    +

    2.2 Conversion

    val of_string      : string -> t
    @@ -514,7 +518,7 @@ Chemical elements.
     
     
     
    -
    +
     Element.of_string "Fe" ;;
     - : Element.t = Particles.Element.Fe
     
    @@ -533,8 +537,8 @@ Element.(to_string Fe);;
     
    -
    -

    2.3 Database information

    +
    +

    2.3 Database information

    val covalent_radius : t -> Non_negative_float.t
    @@ -583,8 +587,8 @@ Element.(to_string Fe);;
     
    -
    -

    2.4 Printers

    +
    +

    2.4 Printers

    val pp      : Format.formatter -> t -> unit
    @@ -595,30 +599,34 @@ Element.(to_string Fe);;
     
    -
    -

    3 Atomic mass

    +
    +

    3 Atomic mass

    Atomic mass, a non-negative float.

    -
    include module type of Common.Non_negative_float
    +
    include module type of Common.Non_negative_float
     
    -
    -

    4 Nuclei

    +
    +

    4 Nuclei

    -
    -

    4.1 Type

    +
    +

    4.1 Type

    +

    +Nuclei.t +

    +
    -
    open Common
    +
    open Common
     
     type t = (Element.t * Coordinate.t) array
     
    @@ -626,12 +634,12 @@ Atomic mass, a non-negative float.
    -
    -

    4.2 xyz file lexer/parser

    +
    +

    4.2 xyz file lexer/parser

    -
    -

    4.2.1 Lexer

    +
    +

    4.2.1 Lexer

    nuclei_lexer.mll contains the description of the lexemes used in @@ -684,8 +692,8 @@ rule read_all = parse

    -
    -

    4.2.2 Parser

    +
    +

    4.2.2 Parser

    xyz_parser.mly parses nuclear coordinates in xyz format. @@ -804,8 +812,8 @@ an xyz_file data structure.

    -
    -

    4.3 Conversion

    +
    +

    4.3 Conversion

    val of_xyz_string : string -> t
    @@ -864,8 +872,8 @@ an xyz_file data structure.
     
    -
    -

    4.4 TODO Query

    +
    +

    4.4 TODO Query

    val formula    : t -> string
    @@ -914,8 +922,8 @@ an xyz_file data structure.
     
    -
    -

    4.5 Printers

    +
    +

    4.5 Printers

    val pp : Format.formatter -> t -> unit
    @@ -924,31 +932,31 @@ an xyz_file data structure.
     
    -
    -

    4.6 Tests

    +
    +

    4.6 Tests

    -
    -

    5 Z-matrix

    +
    +

    5 Z-matrix

    Z-matrix representation of nuclear coordinates.

    -
    -

    5.1 Type

    +
    +

    5.1 Type

    -
    type t 
    +
    type t 
     
    -
    -

    5.2 Conversion

    +
    +

    5.2 Conversion

    val of_string      : string -> t
    @@ -983,7 +991,7 @@ Z-matrix representation of nuclear coordinates.
     
     
     
    -
    +
     let zmt = Zmatrix.of_string "
      n
      n    1 nn
    @@ -1028,8 +1036,8 @@ H -0.568803 -0.793910 1.726048"
     
    -
    -

    5.3 Printers

    +
    +

    5.3 Printers

    val pp : Format.formatter -> t -> unit
    @@ -1041,7 +1049,7 @@ H -0.568803 -0.793910 1.726048"
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/perturbation.html b/docs/perturbation.html index 70c42f5..35abede 100644 --- a/docs/perturbation.html +++ b/docs/perturbation.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Perturbation @@ -223,37 +223,41 @@ -
    +
    + UP + | + HOME +

    Perturbation

    -
    "Perturbation theory"
    +
    "Perturbation theory"
     
    -
    -

    1 MP2

    +
    +

    1 MP2

    -
    -

    1.1 Type

    +
    +

    1.1 Type

    type t
    @@ -262,8 +266,8 @@
     
    -
    -

    1.2 Creation

    +
    +

    1.2 Creation

    val make : frozen_core:Mo.Frozen_core.t -> Mo.Basis.t -> t
    @@ -286,7 +290,7 @@
     
     
     
    -
    +
     let mp2 =
       Perturbation.Mp2.make ~frozen_core:(Mo.Frozen_core.(make Small nuclei)) mo_basis
       ;;
    @@ -295,8 +299,8 @@ val mp2 : Perturbation.Mp2.t = E(MP2)=-0.185523
     
    -
    -

    1.3 Access

    +
    +

    1.3 Access

    val energy      : t -> float
    @@ -331,14 +335,14 @@ val mp2 : Perturbation.Mp2.t = E(MP2)=-0.185523
     
     
     
    -
    +
     
     
    -
    -

    1.4 Printers

    +
    +

    1.4 Printers

    val pp : Format.formatter -> t -> unit
    @@ -347,14 +351,14 @@ val mp2 : Perturbation.Mp2.t = E(MP2)=-0.185523
     
    -
    -

    1.5 Tests

    +
    +

    1.5 Tests

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:10

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/docs/top.html b/docs/top.html index 485180a..89e05f2 100644 --- a/docs/top.html +++ b/docs/top.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Top-level @@ -223,16 +223,20 @@ -
    +
    + UP + | + HOME +

    Top-level

    -
    "Installs pretty printers for top-level."
    +
    "Installs pretty printers for top-level."
     

    Author: Anthony Scemama

    -

    Created: 2021-01-07 Thu 09:20

    +

    Created: 2021-01-20 Wed 23:52

    Validate

    diff --git a/gaussian/README.org b/gaussian/README.org index 43f6afe..eebd4a6 100644 --- a/gaussian/README.org +++ b/gaussian/README.org @@ -1,4 +1,5 @@ #+TITLE: Gaussian +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/gaussian/atomic_shell_pair.org b/gaussian/atomic_shell_pair.org new file mode 100644 index 0000000..b8af4c0 --- /dev/null +++ b/gaussian/atomic_shell_pair.org @@ -0,0 +1,161 @@ +#+begin_src elisp tangle: no :results none :exports none +(setq pwd (file-name-directory buffer-file-name)) +(setq name (file-name-nondirectory (substring buffer-file-name 0 -4))) +(setq lib (concat pwd "lib/")) +(setq testdir (concat pwd "test/")) +(setq mli (concat lib name ".mli")) +(setq ml (concat lib name ".ml")) +(setq test-ml (concat testdir name ".ml")) +(org-babel-tangle) +#+end_src + +* Atomic shell pair + :PROPERTIES: + :header-args: :noweb yes :comments both + :END: + + Data structure to represent pairs of atomic shells. The products of + functions in the shell pair are one-electron functions. + + An atomic shell pair is an array of pairs of contracted shells. + +** Type + + #+begin_src ocaml :tangle (eval mli) +type t + +open Common + #+end_src + + #+begin_src ocaml :tangle (eval ml) :exports none +open Common + +type t = +{ + contracted_shell_pairs : Contracted_shell_pair.t list; + atomic_shell_a : Atomic_shell.t; + atomic_shell_b : Atomic_shell.t; +} + + +module Am = Angular_momentum +module As = Atomic_shell +module Co = Coordinate +module Cs = Contracted_shell +module Csp = Contracted_shell_pair + #+end_src + +** Access + + #+begin_src ocaml :tangle (eval mli) +val atomic_shell_a : t -> Atomic_shell.t +val atomic_shell_b : t -> Atomic_shell.t +val contracted_shell_pairs : t -> Contracted_shell_pair.t list +val ang_mom : t -> Angular_momentum.t +val monocentric : t -> bool +val norm_scales : t -> float array +val a_minus_b : t -> Coordinate.t +val a_minus_b_sq : t -> float + #+end_src + + | ~atomic_shell_a~ | Returns the first ~Atomic_shell.t~ which was used to build the atomic shell pair. | + | ~atomic_shell_b~ | Returns the second ~Atomic_shell.t~ which was used to build the atomic shell pair. | + | ~contracted_shell_pairs~ | Returns an array of ~ContractedShellPair.t~, containing all the pairs of contracted functions used to build the atomic shell pair. | + | ~norm_scales~ | norm_coef.(i) / norm_coef.(0) | + | ~ang_mom~ | Total angular Momentum | + | ~monocentric~ | If true, the two atomic shells have the same center. | + | ~a_minus_b~ | Returns $A-B$ | + | ~a_minus_b_sq~ | Returns $\vert A-B \vert^2$ | + + #+begin_src ocaml :tangle (eval ml) :exports none +let atomic_shell_a x = x.atomic_shell_a +let atomic_shell_b x = x.atomic_shell_b +let contracted_shell_pairs x = x.contracted_shell_pairs + +let monocentric x = + Csp.monocentric @@ List.hd x.contracted_shell_pairs + +let a_minus_b x = + Csp.a_minus_b @@ List.hd x.contracted_shell_pairs + +let a_minus_b_sq x = + Csp.a_minus_b_sq @@ List.hd x.contracted_shell_pairs + +let ang_mom x = + Csp.ang_mom @@ List.hd x.contracted_shell_pairs + +let norm_scales x = + Csp.norm_scales @@ List.hd x.contracted_shell_pairs + + #+end_src + +** Creation + + #+begin_src ocaml :tangle (eval mli) +val make : ?cutoff:float -> Atomic_shell.t -> Atomic_shell.t -> t option + #+end_src + + Creates an atomic shell pair from two atomic shells. + + The contracted shell pairs contains the only pairs of primitives for which + the norm is greater than ~cutoff~. + + If all the contracted shell pairs are not significant, the function returns + ~None~. + + #+begin_src ocaml :tangle (eval mli) +val of_atomic_shell_array : ?cutoff:float -> Atomic_shell.t array -> t option array array + #+end_src + + Creates all possible atomic shell pairs from an array of atomic shells. + If an atomic shell pair is not significant, sets the value to ~None~. + + #+begin_src ocaml :tangle (eval ml) :exports none +let make ?(cutoff=Constants.epsilon) atomic_shell_a atomic_shell_b = + + let l_a = Array.to_list (As.contracted_shells atomic_shell_a) + and l_b = Array.to_list (As.contracted_shells atomic_shell_b) + in + + let contracted_shell_pairs = + List.concat_map (fun s_a -> + List.map (fun s_b -> + if Cs.index s_b <= Cs.index s_a then + Csp.make ~cutoff s_a s_b + else + None + ) l_b + ) l_a + |> Util.list_some + in + match contracted_shell_pairs with + | [] -> None + | _ -> Some { atomic_shell_a ; atomic_shell_b ; contracted_shell_pairs } + + + +let of_atomic_shell_array ?(cutoff=Constants.epsilon) basis = + Array.mapi (fun i shell_a -> + Array.map (fun shell_b -> + make ~cutoff shell_a shell_b) + (Array.sub basis 0 (i+1)) + ) basis + + #+end_src + + +** Printers + + #+begin_src ocaml :tangle (eval mli) +val pp : Format.formatter -> t -> unit + #+end_src + + #+begin_src ocaml :tangle (eval ml) :exports none +let pp ppf s = + let open Format in + fprintf ppf "@[%a@ %a@]" + Atomic_shell.pp s.atomic_shell_a + Atomic_shell.pp s.atomic_shell_b + + #+end_src + diff --git a/gaussian/lib/atomic_shell_pair.ml b/gaussian/lib/atomic_shell_pair.ml index 10d6956..a50f0fc 100644 --- a/gaussian/lib/atomic_shell_pair.ml +++ b/gaussian/lib/atomic_shell_pair.ml @@ -1,3 +1,4 @@ +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Type][Type:2]] *) open Common type t = @@ -13,9 +14,48 @@ module As = Atomic_shell module Co = Coordinate module Cs = Contracted_shell module Csp = Contracted_shell_pair +(* Type:2 ends here *) -(** Creates an atomic shell pair : an array of pairs of contracted shells. -*) + + +(* | ~atomic_shell_a~ | Returns the first ~Atomic_shell.t~ which was used to build the atomic shell pair. | + * | ~atomic_shell_b~ | Returns the second ~Atomic_shell.t~ which was used to build the atomic shell pair. | + * | ~contracted_shell_pairs~ | Returns an array of ~ContractedShellPair.t~, containing all the pairs of contracted functions used to build the atomic shell pair. | + * | ~norm_scales~ | norm_coef.(i) / norm_coef.(0) | + * | ~ang_mom~ | Total angular Momentum | + * | ~monocentric~ | If true, the two atomic shells have the same center. | + * | ~a_minus_b~ | Returns $A-B$ | + * | ~a_minus_b_sq~ | Returns $\vert A-B \vert^2$ | *) + + +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Access][Access:2]] *) +let atomic_shell_a x = x.atomic_shell_a +let atomic_shell_b x = x.atomic_shell_b +let contracted_shell_pairs x = x.contracted_shell_pairs + +let monocentric x = + Csp.monocentric @@ List.hd x.contracted_shell_pairs + +let a_minus_b x = + Csp.a_minus_b @@ List.hd x.contracted_shell_pairs + +let a_minus_b_sq x = + Csp.a_minus_b_sq @@ List.hd x.contracted_shell_pairs + +let ang_mom x = + Csp.ang_mom @@ List.hd x.contracted_shell_pairs + +let norm_scales x = + Csp.norm_scales @@ List.hd x.contracted_shell_pairs +(* Access:2 ends here *) + + + +(* Creates all possible atomic shell pairs from an array of atomic shells. + * If an atomic shell pair is not significant, sets the value to ~None~. *) + + +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Creation][Creation:3]] *) let make ?(cutoff=Constants.epsilon) atomic_shell_a atomic_shell_b = let l_a = Array.to_list (As.contracted_shells atomic_shell_a) @@ -38,29 +78,19 @@ let make ?(cutoff=Constants.epsilon) atomic_shell_a atomic_shell_b = | _ -> Some { atomic_shell_a ; atomic_shell_b ; contracted_shell_pairs } -let atomic_shell_a x = x.atomic_shell_a -let atomic_shell_b x = x.atomic_shell_b -let contracted_shell_pairs x = x.contracted_shell_pairs -let monocentric x = Csp.monocentric @@ List.hd x.contracted_shell_pairs - -let a_minus_b x = Csp.a_minus_b @@ List.hd x.contracted_shell_pairs - -let a_minus_b_sq x = Csp.a_minus_b_sq @@ List.hd x.contracted_shell_pairs - -let ang_mom x = Csp.ang_mom @@ List.hd x.contracted_shell_pairs - -let norm_scales x = Csp.norm_scales @@ List.hd x.contracted_shell_pairs - -(** The array of all shell pairs with their correspondance in the list - of contracted shells. -*) let of_atomic_shell_array ?(cutoff=Constants.epsilon) basis = Array.mapi (fun i shell_a -> Array.map (fun shell_b -> make ~cutoff shell_a shell_b) (Array.sub basis 0 (i+1)) ) basis +(* Creation:3 ends here *) - - +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Printers][Printers:2]] *) +let pp ppf s = + let open Format in + fprintf ppf "@[%a@ %a@]" + Atomic_shell.pp s.atomic_shell_a + Atomic_shell.pp s.atomic_shell_b +(* Printers:2 ends here *) diff --git a/gaussian/lib/atomic_shell_pair.mli b/gaussian/lib/atomic_shell_pair.mli index a72e3ca..39a7551 100644 --- a/gaussian/lib/atomic_shell_pair.mli +++ b/gaussian/lib/atomic_shell_pair.mli @@ -1,53 +1,51 @@ -(** A datastructure to represent pairs of atomic shells. -*) +(* Type *) + +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Type][Type:1]] *) type t open Common +(* Type:1 ends here *) + +(* Access *) -val make : ?cutoff:float -> Atomic_shell.t -> Atomic_shell.t -> t option -(** Creates an atomic shell pair from two atomic shells. - - The contracted shell pairs contains the only pairs of primitives for which - the norm is greater than [cutoff]. - - If all the contracted shell pairs are not significant, the function returns - [None]. -*) - -val of_atomic_shell_array : ?cutoff:float -> Atomic_shell.t array -> t option array array -(** Creates all possible atomic shell pairs from an array of atomic shells. - If an atomic shell pair is not significant, sets the value to [None]. -*) - -val atomic_shell_a : t -> Atomic_shell.t -(** Returns the first {!Atomic_shell.t} which was used to build the atomic - shell pair. -*) - -val atomic_shell_b : t -> Atomic_shell.t -(** Returns the second {!Atomic_shell.t} which was used to build the atomic - shell pair. -*) - +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Access][Access:1]] *) +val atomic_shell_a : t -> Atomic_shell.t +val atomic_shell_b : t -> Atomic_shell.t val contracted_shell_pairs : t -> Contracted_shell_pair.t list -(** Returns an array of {!ContractedShellPair.t}, containing all the pairs of - contracted functions used to build the atomic shell pair. -*) +val ang_mom : t -> Angular_momentum.t +val monocentric : t -> bool +val norm_scales : t -> float array +val a_minus_b : t -> Coordinate.t +val a_minus_b_sq : t -> float +(* Access:1 ends here *) -val a_minus_b : t -> Coordinate.t - (* A-B *) +(* Creation *) -val a_minus_b_sq : t -> float - (* |A-B|^2 *) -val norm_scales : t -> float array - (* norm_coef.(i) / norm_coef.(0) *) +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Creation][Creation:1]] *) +val make : ?cutoff:float -> Atomic_shell.t -> Atomic_shell.t -> t option +(* Creation:1 ends here *) -val ang_mom : t -> Angular_momentum.t - (* Total angular Momentum *) -val monocentric : t -> bool -(** If true, the two atomic shells have the same center. *) +(* Creates an atomic shell pair from two atomic shells. + * + * The contracted shell pairs contains the only pairs of primitives for which + * the norm is greater than ~cutoff~. + * + * If all the contracted shell pairs are not significant, the function returns + * ~None~. *) + + +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Creation][Creation:2]] *) +val of_atomic_shell_array : ?cutoff:float -> Atomic_shell.t array -> t option array array +(* Creation:2 ends here *) + +(* Printers *) + + +(* [[file:~/QCaml/gaussian/atomic_shell_pair.org::*Printers][Printers:1]] *) +val pp : Format.formatter -> t -> unit +(* Printers:1 ends here *) diff --git a/gaussian_integrals/README.org b/gaussian_integrals/README.org index cfb4c28..167e080 100644 --- a/gaussian_integrals/README.org +++ b/gaussian_integrals/README.org @@ -1,4 +1,5 @@ #+TITLE: Gaussian integrals +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/linear_algebra/README.org b/linear_algebra/README.org index 6d6a33c..62acd8d 100644 --- a/linear_algebra/README.org +++ b/linear_algebra/README.org @@ -1,4 +1,5 @@ #+TITLE: Linear Algebra +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/mo/README.org b/mo/README.org index 2ba9c59..66d8920 100644 --- a/mo/README.org +++ b/mo/README.org @@ -1,4 +1,5 @@ #+TITLE: Molecular orbitals +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/operators/README.org b/operators/README.org index 6008ac0..9c78a18 100644 --- a/operators/README.org +++ b/operators/README.org @@ -1,4 +1,5 @@ #+TITLE: Operators +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/particles/README.org b/particles/README.org index 302f974..6e7c267 100644 --- a/particles/README.org +++ b/particles/README.org @@ -1,4 +1,5 @@ #+TITLE: Common +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/particles/lib/nuclei.mli b/particles/lib/nuclei.mli index 1949410..24ab6be 100644 --- a/particles/lib/nuclei.mli +++ b/particles/lib/nuclei.mli @@ -1,4 +1,5 @@ (* Type + * <<<~Nuclei.t~>>> * * #+NAME: types *) diff --git a/particles/nuclei.org b/particles/nuclei.org index 2b3e278..c4d7109 100644 --- a/particles/nuclei.org +++ b/particles/nuclei.org @@ -15,6 +15,7 @@ :END: ** Type + <<<~Nuclei.t~>>> #+NAME: types #+begin_src ocaml :tangle (eval mli) diff --git a/perturbation/README.org b/perturbation/README.org index a9a1bab..43a53ed 100644 --- a/perturbation/README.org +++ b/perturbation/README.org @@ -1,4 +1,5 @@ #+TITLE: Perturbation +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/qcaml/README.org b/qcaml/README.org index 0b4d782..0e95bd3 100644 --- a/qcaml/README.org +++ b/qcaml/README.org @@ -1,4 +1,5 @@ #+TITLE: QCaml +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/simulation/README.org b/simulation/README.org index b7458e8..b4ae2a6 100644 --- a/simulation/README.org +++ b/simulation/README.org @@ -1,4 +1,5 @@ #+TITLE: Simulation +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup #+name: synopsis diff --git a/top/README.org b/top/README.org index 4835b11..4aa8707 100644 --- a/top/README.org +++ b/top/README.org @@ -1,4 +1,5 @@ #+TITLE: Top-level +#+HTML_LINK_HOME: index.html #+SETUPFILE: ../docs/org-html-themes/org/theme-readtheorg.setup diff --git a/top/lib/install_printers.ml b/top/lib/install_printers.ml index ef90fa6..f8fb0b5 100644 --- a/top/lib/install_printers.ml +++ b/top/lib/install_printers.ml @@ -12,6 +12,7 @@ let printers = "Common.Spin.pp" ; "Common.Zkey.pp" ; "Gaussian.Atomic_shell.pp" ; + "Gaussian.Atomic_shell_pair.pp" ; "Gaussian.Atomic_shell_pair_couple.pp" ; "Mo.Frozen_core.pp" ; "Particles.Electrons.pp" ;