diff --git a/common/bitstring.org b/common/bitstring.org index f645e42..52f5b02 100644 --- a/common/bitstring.org +++ b/common/bitstring.org @@ -385,9 +385,8 @@ let rec to_list ?(accu=[]) = function | t -> let newlist = (trailing_zeros t + 1)::accu in - logand t @@ minus_one t - |> to_list ~accu:newlist - (* |> (to_list [@tailcall]) ~accu:newlist tailcall does not work with 4.13*) + let b = logand t @@ minus_one t in + (to_list [@tailcall]) ~accu:newlist b #+end_src #+begin_src ocaml :tangle (eval test-ml) :exports none diff --git a/common/lib/bitstring.ml b/common/lib/bitstring.ml index 453dbdb..179eb16 100644 --- a/common/lib/bitstring.ml +++ b/common/lib/bitstring.ml @@ -1,7 +1,7 @@ (* Single-integer implementation :noexport: *) -(* [[file:~/QCaml/common/bitstring.org::*Single-integer%20implementation][Single-integer implementation:1]] *) +(* [[file:~/QCaml/common/bitstring.org::*Single-integer implementation][Single-integer implementation:1]] *) module One = struct let of_int x = @@ -43,7 +43,7 @@ end (* Zarith implementation :noexport: *) -(* [[file:~/QCaml/common/bitstring.org::*Zarith%20implementation][Zarith implementation:1]] *) +(* [[file:~/QCaml/common/bitstring.org::*Zarith implementation][Zarith implementation:1]] *) module Many = struct let of_z x = x @@ -104,7 +104,7 @@ type t = * | ~to_list~ | Converts a bit string into a list of integers indicating the positions where the bits are set to ~1~. The first value for the position is not ~0~ but ~1~ | *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:2]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:2]] *) let of_int x = One (One.of_int x) @@ -122,7 +122,7 @@ let of_z x = * #+end_example *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:4]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:4]] *) let zero = function | n when n < 64 -> One (One.zero) | _ -> Many (Many.zero) @@ -161,7 +161,7 @@ let testbit = function | Many x -> Many.testbit x (* General implementation:4 ends here *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:6]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:6]] *) let logor a b = match a,b with | One a, One b -> One (One.logor a b) @@ -188,7 +188,7 @@ let lognot = function | Many x -> Many (Many.lognot x) (* General implementation:6 ends here *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:8]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:8]] *) let minus_one = function | One x -> One (One.minus_one x) | Many x -> Many (Many.minus_one x) @@ -215,7 +215,7 @@ let plus_one = function -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:9]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:9]] *) let trailing_zeros = function | One x -> One.trailing_zeros x | Many x -> Many.trailing_zeros x @@ -248,14 +248,14 @@ let popcount = function * #+end_example *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:10]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:10]] *) let rec to_list ?(accu=[]) = function | t when (is_zero t) -> List.rev accu | t -> let newlist = (trailing_zeros t + 1)::accu in - logand t @@ minus_one t - |> (to_list [@tailcall]) ~accu:newlist + let b = logand t @@ minus_one t in + (to_list [@tailcall]) ~accu:newlist b (* General implementation:10 ends here *) @@ -267,7 +267,7 @@ let rec to_list ?(accu=[]) = function * #+end_example *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:12]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:12]] *) let permutations m n = let rec aux k u rest = diff --git a/common/lib/bitstring.mli b/common/lib/bitstring.mli index 9f8ec00..10c19ed 100644 --- a/common/lib/bitstring.mli +++ b/common/lib/bitstring.mli @@ -9,7 +9,7 @@ type t (* General implementation *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:1]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:1]] *) val of_int : int -> t val of_z : Z.t -> t val zero : int -> t diff --git a/common/lib/charge.ml b/common/lib/charge.ml index ba43a74..fb5cc13 100644 --- a/common/lib/charge.ml +++ b/common/lib/charge.ml @@ -25,7 +25,7 @@ let to_string x = "0.0" (* Conversions:2 ends here *) -(* [[file:~/QCaml/common/charge.org::*Simple%20operations][Simple operations:2]] *) +(* [[file:~/QCaml/common/charge.org::*Simple operations][Simple operations:2]] *) let gen_op op = fun a b -> op (to_float a) (to_float b) diff --git a/common/lib/charge.mli b/common/lib/charge.mli index 210ce00..7b316a8 100644 --- a/common/lib/charge.mli +++ b/common/lib/charge.mli @@ -23,7 +23,7 @@ val to_string: t -> string (* Simple operations *) -(* [[file:~/QCaml/common/charge.org::*Simple%20operations][Simple operations:1]] *) +(* [[file:~/QCaml/common/charge.org::*Simple operations][Simple operations:1]] *) val ( + ) : t -> t -> t val ( - ) : t -> t -> t val ( * ) : t -> float -> t diff --git a/common/lib/constants.ml b/common/lib/constants.ml index d3926ef..db2233c 100644 --- a/common/lib/constants.ml +++ b/common/lib/constants.ml @@ -19,7 +19,7 @@ let integrals_cutoff = epsilon * | ~two_over_sq_pi~ | $2 / \sqrt{\pi}$ | *) -(* [[file:~/QCaml/common/constants.org::*Mathematical%20constants][Mathematical constants:2]] *) +(* [[file:~/QCaml/common/constants.org::*Mathematical constants][Mathematical constants:2]] *) let pi = acos (-1.) let two_pi = 2. *. pi let sq_pi = sqrt pi @@ -36,7 +36,7 @@ let two_over_sq_pi = 2. /. sq_pi * | ~ev_to_ha~ | eV to Hartree conversion factor : 1 / ~ha_to_ev~ | *) -(* [[file:~/QCaml/common/constants.org::*Physical%20constants][Physical constants:2]] *) +(* [[file:~/QCaml/common/constants.org::*Physical constants][Physical constants:2]] *) let a0 = 0.529_177_210_67 let a0_inv = 1. /. a0 let ha_to_ev = 27.211_386_02 diff --git a/common/lib/constants.mli b/common/lib/constants.mli index a59be6a..0c85ba6 100644 --- a/common/lib/constants.mli +++ b/common/lib/constants.mli @@ -9,7 +9,7 @@ val integrals_cutoff : float (* Mathematical constants *) -(* [[file:~/QCaml/common/constants.org::*Mathematical%20constants][Mathematical constants:1]] *) +(* [[file:~/QCaml/common/constants.org::*Mathematical constants][Mathematical constants:1]] *) val pi : float val two_pi : float val sq_pi : float @@ -21,7 +21,7 @@ val two_over_sq_pi : float (* Physical constants *) -(* [[file:~/QCaml/common/constants.org::*Physical%20constants][Physical constants:1]] *) +(* [[file:~/QCaml/common/constants.org::*Physical constants][Physical constants:1]] *) val a0 : float val a0_inv : float val ha_to_ev : float diff --git a/common/lib/coordinate.ml b/common/lib/coordinate.ml index 3aa5c8b..cbf11d7 100644 --- a/common/lib/coordinate.ml +++ b/common/lib/coordinate.ml @@ -87,7 +87,7 @@ let angstrom_to_bohr { x ; y ; z } = -(* [[file:~/QCaml/common/coordinate.org::*Vector%20operations][Vector operations:2]] *) +(* [[file:~/QCaml/common/coordinate.org::*Vector operations][Vector operations:2]] *) let get axis { x ; y ; z } = match axis with | X -> x diff --git a/common/lib/coordinate.mli b/common/lib/coordinate.mli index 8a0593e..9e6de64 100644 --- a/common/lib/coordinate.mli +++ b/common/lib/coordinate.mli @@ -40,7 +40,7 @@ val angstrom_to_bohr : angstrom point -> bohr point (* Vector operations *) -(* [[file:~/QCaml/common/coordinate.org::*Vector%20operations][Vector operations:1]] *) +(* [[file:~/QCaml/common/coordinate.org::*Vector operations][Vector operations:1]] *) val neg : t -> t val get : axis -> bohr point -> float val dot : t -> t -> float diff --git a/common/lib/util.c b/common/lib/util.c index 2218834..d03155f 100644 --- a/common/lib/util.c +++ b/common/lib/util.c @@ -8,7 +8,7 @@ /* | ~leadz~ | ~bsf~ instruction | */ -/* [[file:~/QCaml/common/util.org::*External%20C%20functions][External C functions:1]] */ +/* [[file:~/QCaml/common/util.org::*External C functions][External C functions:1]] */ #include #include #include diff --git a/common/lib/util.ml b/common/lib/util.ml index fde7744..4ec6cec 100644 --- a/common/lib/util.ml +++ b/common/lib/util.ml @@ -45,7 +45,7 @@ let leadz i = leadz i |> Int32.to_int * | ~of_some~ | Extracts the value of an option | *) -(* [[file:~/QCaml/common/util.org::*General%20functions][General functions:2]] *) +(* [[file:~/QCaml/common/util.org::*General functions][General functions:2]] *) let memo_float_of_int = Array.init 64 float_of_int @@ -152,7 +152,7 @@ let of_some = function -(* [[file:~/QCaml/common/util.org::*Functions%20related%20to%20the%20Boys%20function][Functions related to the Boys function:2]] *) +(* [[file:~/QCaml/common/util.org::*Functions related to the Boys function][Functions related to the Boys function:2]] *) let incomplete_gamma ~alpha x = assert (alpha >= 0.); assert (x >= 0.); @@ -214,7 +214,7 @@ let incomplete_gamma ~alpha x = * - $F_m(t) = \frac{ 2t\, F_{m+1}(t) + e^{-t} }{2m+1}$ *) -(* [[file:~/QCaml/common/util.org::*Functions%20related%20to%20the%20Boys%20function][Functions related to the Boys function:4]] *) +(* [[file:~/QCaml/common/util.org::*Functions related to the Boys function][Functions related to the Boys function:4]] *) let boys_function ~maxm t = assert (t >= 0.); match maxm with @@ -260,7 +260,7 @@ let boys_function ~maxm t = * | ~list_pack~ | ~list_pack n l~ Creates a list of ~n~-elements lists | *) -(* [[file:~/QCaml/common/util.org::*List%20functions][List functions:2]] *) +(* [[file:~/QCaml/common/util.org::*List functions][List functions:2]] *) let list_some l = List.filter (function None -> false | _ -> true) l |> List.rev_map (function Some x -> x | _ -> assert false) @@ -298,7 +298,7 @@ let list_pack n l = * | ~array_product~ | Returns the product of all the elements of the array | *) -(* [[file:~/QCaml/common/util.org::*Array%20functions][Array functions:2]] *) +(* [[file:~/QCaml/common/util.org::*Array functions][Array functions:2]] *) let array_range first last = if last < first then [| |] else Array.init (last-first+1) (fun i -> i+first) @@ -319,7 +319,7 @@ let array_product a = * | ~stream_fold~ | Apply a fold to the elements of the stream | *) -(* [[file:~/QCaml/common/util.org::*Stream%20functions][Stream functions:2]] *) +(* [[file:~/QCaml/common/util.org::*Stream functions][Stream functions:2]] *) let stream_range first last = Stream.from (fun i -> let result = i+first in diff --git a/common/lib/util.mli b/common/lib/util.mli index b156d95..609ccdd 100644 --- a/common/lib/util.mli +++ b/common/lib/util.mli @@ -28,7 +28,7 @@ val leadz : int64 -> int (* General functions *) -(* [[file:~/QCaml/common/util.org::*General%20functions][General functions:1]] *) +(* [[file:~/QCaml/common/util.org::*General functions][General functions:1]] *) val fact : int -> float (* @raise Invalid_argument for negative arguments or arguments >100. *) val binom : int -> int -> int @@ -48,19 +48,19 @@ val not_implemented : string -> 'a (* Functions related to the Boys function *) -(* [[file:~/QCaml/common/util.org::*Functions%20related%20to%20the%20Boys%20function][Functions related to the Boys function:1]] *) +(* [[file:~/QCaml/common/util.org::*Functions related to the Boys function][Functions related to the Boys function:1]] *) val incomplete_gamma : alpha:float -> float -> float (* @raise Failure when the calculation doesn't converge. *) (* Functions related to the Boys function:1 ends here *) -(* [[file:~/QCaml/common/util.org::*Functions%20related%20to%20the%20Boys%20function][Functions related to the Boys function:3]] *) +(* [[file:~/QCaml/common/util.org::*Functions related to the Boys function][Functions related to the Boys function:3]] *) val boys_function : maxm:int -> float -> float array (* Functions related to the Boys function:3 ends here *) (* List functions *) -(* [[file:~/QCaml/common/util.org::*List%20functions][List functions:1]] *) +(* [[file:~/QCaml/common/util.org::*List functions][List functions:1]] *) val list_some : 'a option list -> 'a list val list_range : int -> int -> int list val list_pack : int -> 'a list -> 'a list list @@ -69,7 +69,7 @@ val list_pack : int -> 'a list -> 'a list list (* Array functions *) -(* [[file:~/QCaml/common/util.org::*Array%20functions][Array functions:1]] *) +(* [[file:~/QCaml/common/util.org::*Array functions][Array functions:1]] *) val array_range : int -> int -> int array val array_sum : float array -> float val array_product : float array -> float @@ -78,7 +78,7 @@ val array_product : float array -> float (* Stream functions *) -(* [[file:~/QCaml/common/util.org::*Stream%20functions][Stream functions:1]] *) +(* [[file:~/QCaml/common/util.org::*Stream functions][Stream functions:1]] *) val stream_range : int -> int -> int Stream.t val stream_to_list : 'a Stream.t -> 'a list val stream_fold : ('a -> 'b -> 'a) -> 'a -> 'b Stream.t -> 'a diff --git a/common/lib/zkey.ml b/common/lib/zkey.ml index 51131b7..da41ef9 100644 --- a/common/lib/zkey.ml +++ b/common/lib/zkey.ml @@ -232,7 +232,7 @@ let to_powers { left ; right ; kind } = * | ~compare~ | Comparison function, used for sorting | *) -(* [[file:~/QCaml/common/zkey.org::*Functions%20for%20hash%20tables][Functions for hash tables:2]] *) +(* [[file:~/QCaml/common/zkey.org::*Functions for hash tables][Functions for hash tables:2]] *) let hash = Hashtbl.hash let equal diff --git a/common/lib/zkey.mli b/common/lib/zkey.mli index ad9e408..b4ea3f3 100644 --- a/common/lib/zkey.mli +++ b/common/lib/zkey.mli @@ -32,7 +32,7 @@ val to_string : t -> string (* Functions for hash tables *) -(* [[file:~/QCaml/common/zkey.org::*Functions%20for%20hash%20tables][Functions for hash tables:1]] *) +(* [[file:~/QCaml/common/zkey.org::*Functions for hash tables][Functions for hash tables:1]] *) val hash : t -> int val equal : t -> t -> bool val compare : t -> t -> int diff --git a/common/test/bitstring.ml b/common/test/bitstring.ml index 7063493..52b56ef 100644 --- a/common/test/bitstring.ml +++ b/common/test/bitstring.ml @@ -1,7 +1,7 @@ (* Tests header :noexport: *) -(* [[file:~/QCaml/common/bitstring.org::*Tests%20header][Tests header:1]] *) +(* [[file:~/QCaml/common/bitstring.org::*Tests header][Tests header:1]] *) open Common.Bitstring let check_bool = Alcotest.(check bool) let check msg x = check_bool msg true x @@ -12,7 +12,7 @@ let test_all () = let many_x = of_z z in (* Tests header:1 ends here *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:3]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:3]] *) check_bool "of_x" true (one_x = (of_int x)); check_bool "of_z" true (one_x = (of_z (Z.of_int x))); (* General implementation:3 ends here *) @@ -41,7 +41,7 @@ check_bool "of_z" true (one_x = (of_z (Z.of_int x))); * #+end_example *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:5]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:5]] *) check_bool "shift_left1" true (of_int (x lsl 3) = shift_left one_x 3); check_bool "shift_left2" true (of_z (Z.shift_left z 3) = shift_left many_x 3); check_bool "shift_left3" true (of_z (Z.shift_left z 100) = shift_left many_x 100); @@ -77,7 +77,7 @@ check_bool "testbit6" false (testbit (of_z (Z.of_int 8)) 4); -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:7]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:7]] *) check_bool "logor1" true (of_int (1 lor 2) = logor (of_int 1) (of_int 2)); check_bool "logor2" true (of_z (Z.of_int (1 lor 2)) = logor (of_z Z.one) (of_z (Z.of_int 2))); check_bool "logxor1" true (of_int (1 lxor 2) = logxor (of_int 1) (of_int 2)); @@ -86,7 +86,7 @@ check_bool "logand1" true (of_int (1 land 3) = logand (of_int 1) (of_int 3)); check_bool "logand2" true (of_z (Z.of_int (1 land 3)) = logand (of_z Z.one) (of_z (Z.of_int 3))); (* General implementation:7 ends here *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:11]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:11]] *) check_bool "to_list" true ([ 1 ; 3 ; 4 ; 6 ] = (to_list (of_int 45))); (* General implementation:11 ends here *) @@ -105,7 +105,7 @@ check_bool "to_list" true ([ 1 ; 3 ; 4 ; 6 ] = (to_list (of_int 45))); * #+end_example *) -(* [[file:~/QCaml/common/bitstring.org::*General%20implementation][General implementation:13]] *) +(* [[file:~/QCaml/common/bitstring.org::*General implementation][General implementation:13]] *) check "permutations" (permutations 2 4 = List.map of_int [ 3 ; 5 ; 6 ; 9 ; 10 ; 12 ]); diff --git a/common/test/util.ml b/common/test/util.ml index 76df7fb..f32b073 100644 --- a/common/test/util.ml +++ b/common/test/util.ml @@ -1,7 +1,7 @@ (* Test header :noexport: *) -(* [[file:~/QCaml/common/util.org::*Test%20header][Test header:1]] *) +(* [[file:~/QCaml/common/util.org::*Test header][Test header:1]] *) open Common.Util open Alcotest (* Test header:1 ends here *) @@ -35,7 +35,7 @@ let test_external () = () (* Test:1 ends here *) -(* [[file:~/QCaml/common/util.org::*General%20functions][General functions:3]] *) +(* [[file:~/QCaml/common/util.org::*General functions][General functions:3]] *) let test_general () = check int "of_some_of_int_fast" 1 (of_some (Some 1)) ; check int "binom" 35 (binom 7 4); @@ -46,7 +46,7 @@ let test_general () = () (* General functions:3 ends here *) -(* [[file:~/QCaml/common/util.org::*Functions%20related%20to%20the%20Boys%20function][Functions related to the Boys function:5]] *) +(* [[file:~/QCaml/common/util.org::*Functions related to the Boys function][Functions related to the Boys function:5]] *) let test_boys () = check (float 1.e-15) "incomplete_gamma" 0.0 (incomplete_gamma ~alpha:0.5 0.); check (float 1.e-15) "incomplete_gamma" 1.114707979049507 (incomplete_gamma ~alpha:0.5 0.4); @@ -63,7 +63,7 @@ let test_boys () = () (* Functions related to the Boys function:5 ends here *) -(* [[file:~/QCaml/common/util.org::*List%20functions][List functions:3]] *) +(* [[file:~/QCaml/common/util.org::*List functions][List functions:3]] *) let test_list () = check bool "list_range" true ([ 2; 3; 4 ] = list_range 2 4); check bool "list_some" true ([ 2; 3; 4 ] = @@ -74,7 +74,7 @@ let test_list () = () (* List functions:3 ends here *) -(* [[file:~/QCaml/common/util.org::*Array%20functions][Array functions:3]] *) +(* [[file:~/QCaml/common/util.org::*Array functions][Array functions:3]] *) let test_array () = check bool "array_range" true ([| 2; 3; 4 |] = array_range 2 4); check (float 1.e-15) "array_sum" 9. (array_sum [| 2.; 3.; 4. |]); @@ -85,7 +85,7 @@ let test_array () = (* Test footer :noexport: *) -(* [[file:~/QCaml/common/util.org::*Test%20footer][Test footer:1]] *) +(* [[file:~/QCaml/common/util.org::*Test footer][Test footer:1]] *) let tests = [ "External", `Quick, test_external; "General" , `Quick, test_general; diff --git a/docs/common.html b/docs/common.html index 9cb6c16..4acd97c 100644 --- a/docs/common.html +++ b/docs/common.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Common @@ -272,143 +272,143 @@ org_html_manager.setup(); // activate after the parameters are set

Table of Contents

-
-

1 Summary

+
+

1 Summary

-
-

2 Angular Momentum

+
+

2 Angular Momentum

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

-
-

2.1 Type

+
+

2.1 Type

-Angular_momentum.t +Angular_momentum.t

-
type t =
+
type t =
   | S | P | D | F | G | H | I | J | K | L | M | N | O
   | Int of int
 
@@ -424,7 +424,7 @@ Azimuthal quantum number, repsesented as \( s,p,d,\dots \) .
 

-An exception is raised when the Angular_momentum.t element can't +An exception is raised when the Angular_momentum.t element can't be created.

@@ -435,8 +435,8 @@ quartets, use in the two-electron operators.
-
-

2.2 Conversions

+
+

2.2 Conversions

val of_char : char -> t
@@ -460,7 +460,7 @@ quartets, use in the two-electron operators.
 
 
 of_char
-Returns an Angular_momentum.t when a shell is given as  a character (case insensitive)
+Returns an Angular_momentum.t when a shell is given as  a character (case insensitive)
 
 
 
@@ -488,7 +488,7 @@ quartets, use in the two-electron operators.
 

Example:

-
+
 Angular_momentum.of_char 'p';;
 - : Angular_momentum.t = P
 
@@ -507,8 +507,8 @@ Angular_momentum.(to_string D);;
 
-
-

2.3 Shell functions

+
+

2.3 Shell functions

val n_functions : t -> int
@@ -532,7 +532,7 @@ Angular_momentum.(to_string D);;
 
 
 zkey_array
-Array of Zkey.t, where each element is a a key associated with the the powers of \(x,y,z\).
+Array of Zkey.t, where each element is a a key associated with the the powers of \(x,y,z\).
 
 
 
@@ -540,7 +540,7 @@ Angular_momentum.(to_string D);;
 

Example:

-
+
 Angular_momentum.(n_functions D) ;;
 - : int = 6
 
@@ -553,8 +553,8 @@ Angular_momentum.( zkey_array (Doublet (P,S)) );;
 
-
-

2.4 Arithmetic

+
+

2.4 Arithmetic

val ( + ) : t -> t -> t
@@ -565,7 +565,7 @@ Angular_momentum.( zkey_array (Doublet (P,S)) );;
 

Example:

-
+
 Angular_momentum.(D + P);;
 - : Angular_momentum.t = F
 
@@ -575,8 +575,8 @@ Angular_momentum.(F - P);;
 
-
-

2.5 Printers

+
+

2.5 Printers

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

-
-

2.6 TODO Tests

+
+

2.6 TODO Tests

-
-

3 Bit string

+
+

3 Bit string

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

-
-

3.1 Type

+
+

3.1 Type

-Bitstring.t +Bitstring.t

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

3.2 General implementation

+
+

3.2 General implementation

val of_int : int -> t
@@ -774,7 +774,7 @@ bit string as a multi-precision integer.
 

Example:

-
+
 Bitstring.of_int 15;;
 - : Bitstring.t =
 ++++------------------------------------------------------------
@@ -783,7 +783,7 @@ Bitstring.of_int 15;;
 

Example:

-
+
 Bitstring.(shift_left (of_int 15) 2);;
 - : Bitstring.t =
 --++++----------------------------------------------------------
@@ -806,7 +806,7 @@ Bitstring.(testbit (of_int 15) 4);;
 

Example:

-
+
 Bitstring.(logor (of_int 15) (of_int 73));;
 - : Bitstring.t =
 ++++--+---------------------------------------------------------
@@ -824,7 +824,7 @@ Bitstring.(logxor (of_int 15) (of_int 73));;
 

Example:

-
+
 Bitstring.(plus_one (of_int 15));;
 - : Bitstring.t =
 ----+-----------------------------------------------------------
@@ -838,7 +838,7 @@ Bitstring.(minus_one (of_int 15));;
 

Example:

-
+
 Bitstring.(trailing_zeros (of_int 12));;
 - : int = 2
 
@@ -852,7 +852,7 @@ Bitstring.(popcount (of_int 15));;
 

Example:

-
+
 Bitstring.(to_list (of_int 45));;
 - : int list = [1; 3; 4; 6]
 
@@ -860,7 +860,7 @@ Bitstring.(to_list (of_int 45));;

Example:

-
+
    Bitstring.permutations 2 4;;
 - : Bitstring.t list =
 [++--------------------------------------------------------------;
@@ -873,8 +873,8 @@ Example:
 
-
-

3.3 Printers

+
+

3.3 Printers

val pp : Format.formatter -> t -> unit
@@ -884,16 +884,16 @@ Example:
 
-
-

4 Charge

+
+

4 Charge

-
-

4.1 Type

+
+

4.1 Type

-Charge.t +Charge.t

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

4.2 Conversions

+
+

4.2 Conversions

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

4.3 Simple operations

+
+

4.3 Simple operations

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

4.4 Printers

+
+

4.4 Printers

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

5 Command line

+
+

5 Command line

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

-
-

5.1 Types

+
+

5.1 Types

-
type short_opt     = char
+
type short_opt     = char
 type long_opt      = string
 type optional      = Mandatory | Optional
 type documentation = string
@@ -1029,9 +1029,9 @@ Then, define what to do with the arguments:
 
    -
  • Short option: in the command line, a dash with a single character +
  • Short option: in the command line, a dash with a single character (ex: ls -l)
  • -
  • Long option: in the command line, two dashes with a word +
  • Long option: 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
  • @@ -1042,12 +1042,12 @@ don't (ls -l) and for some arguments the argument is optional
-
-

5.2 Mutable attributes

+
+

5.2 Mutable attributes

All the options are stored in the hash table dict where the key -is the long option and the value is a value of type description. +is the long option and the value is a value of type description.

@@ -1073,8 +1073,8 @@ Function to create an anonymous argument.
-
-

5.3 Query functions

+
+

5.3 Query functions

val get       : long_opt -> string option
@@ -1094,7 +1094,7 @@ Function to create an anonymous argument.
 
 
 get
-Returns the argument associated with a long option
+Returns the argument associated with a long option
 
 
 
@@ -1112,8 +1112,8 @@ Function to create an anonymous argument.
 
-
-

5.4 Specification

+
+

5.4 Specification

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

6 Constants

+
+

6 Constants

All constants used in the program.

-
-

6.1 Thresholds

+
+

6.1 Thresholds

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

6.2 Mathematical constants

+
+

6.2 Mathematical constants

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

6.3 Physical constants

+
+

6.3 Physical constants

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

7 Coordinate

+
+

7 Coordinate

Coordinates in 3D space. @@ -1283,14 +1283,14 @@ module.

-
-

7.1 Type

+
+

7.1 Type

-Coordinate.t +Coordinate.t

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

7.2 Creation

+
+

7.2 Creation

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

7.3 Conversion

+
+

7.3 Conversion

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

7.4 Vector operations

+
+

7.4 Vector operations

val neg    : t -> t
@@ -1442,7 +1442,7 @@ module.
 

Example:

-
+
 Coordinate.neg { x=1. ; y=2. ; z=3. } ;;
 - : Coordinate.t =  -1.0000  -2.0000  -3.0000
 
@@ -1468,8 +1468,8 @@ Coordinate.(
 
-
-

7.5 Printers

+
+

7.5 Printers

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

8 Non-negative float

+
+

8 Non-negative float

-
-

8.1 Type

+
+

8.1 Type

-< +<

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

8.2 Conversions

+
+

8.2 Conversions

val of_float        : float -> t
@@ -1524,19 +1524,19 @@ The unsafe variant doesn't do this check.
 
-
-

9 Powers

+
+

9 Powers

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

-
-

9.1 Type

+
+

9.1 Type

-Powers.t +Powers.t

type t = private {
@@ -1554,8 +1554,8 @@ Contains powers of \(x\), \(y\) and \(z\) describing the polynomials in atomic b
 
-
-

9.2 Conversions

+
+

9.2 Conversions

val of_int_tuple : int * int * int -> t
@@ -1566,7 +1566,7 @@ Contains powers of \(x\), \(y\) and \(z\) describing the polynomials in atomic b
 

Example:

-
+
 Powers.of_int_tuple (2,3,1);;
 - : Powers.t = x^2 + y^3 + z^1
 
@@ -1576,8 +1576,8 @@ Powers.(to_int_tuple (of_int_tuple (2,3,1)));;
 
-
-

9.3 Operations

+
+

9.3 Operations

val get  : Coordinate.axis -> t -> int
@@ -1602,12 +1602,12 @@ Powers.(to_int_tuple (of_int_tuple (2,3,1)));;
 
 
 incr
-Returns a new Powers.t with the power on the given axis incremented
+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
+Returns a new Powers.t with the power on the given axis decremented. As opposed to of_int_tuple, the values may become negative
 
 
 
@@ -1615,7 +1615,7 @@ Powers.(to_int_tuple (of_int_tuple (2,3,1)));;
 

Example:

-
+
 Powers.get Coordinate.Y (Powers.of_int_tuple (2,3,1));;
 - : int = 3
 
@@ -1629,8 +1629,8 @@ Powers.decr Coordinate.Y (Powers.of_int_tuple (2,3,1));;
 
-
-

9.4 Printers

+
+

9.4 Printers

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

10 QCaml

+
+

10 QCaml

QCaml-specific parameters @@ -1676,8 +1676,8 @@ QCaml-specific parameters

-
-

11 Range

+
+

11 Range

A range is a sorted list of integers in an interval. @@ -1692,11 +1692,11 @@ A range is a sorted list of integers in an interval.

-
-

11.1 Type

+
+

11.1 Type

-Range.t +Range.t

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

11.2 Conversion

+
+

11.2 Conversion

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

11.3 Printers

+
+

11.3 Printers

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

12 Spin

+
+

12 Spin

Electron spin

-
-

12.1 Type

+
+

12.1 Type

-Spin.t +Spin.t

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

12.2 Functions

+
+

12.2 Functions

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

12.3 Printers

+
+

12.3 Printers

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

13 Util

+
+

13 Util

Utility functions. @@ -1789,8 +1789,8 @@ Utility functions.

-
-

13.1 External C functions

+
+

13.1 External C functions

@@ -1834,8 +1834,8 @@ Utility functions.
-
-

13.1.1 Erf

+
+

13.1.1 Erf

external erf_float : float -> float
@@ -1845,8 +1845,8 @@ Utility functions.
 
-
-

13.1.2 Erfc

+
+

13.1.2 Erfc

external erfc_float : float -> float
@@ -1856,8 +1856,8 @@ Utility functions.
 
-
-

13.1.3 Gamma

+
+

13.1.3 Gamma

external gamma_float : float -> float
@@ -1867,8 +1867,8 @@ Utility functions.
 
-
-

13.1.4 Popcnt

+
+

13.1.4 Popcnt

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

13.1.5 Trailz

+
+

13.1.5 Trailz

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

13.1.6 Leadz

+
+

13.1.6 Leadz

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

13.1.7 Test

+
+

13.1.7 Test

-
-

13.2 General functions

+
+

13.2 General functions

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

13.3 Functions related to the Boys function

+
+

13.3 Functions related to the Boys function

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

13.4 List functions

+
+

13.4 List functions

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

13.5 Array functions

+
+

13.5 Array functions

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

13.6 Stream functions

+
+

13.6 Stream functions

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

13.7 Printers

+
+

13.7 Printers

val pp_float_array_size   : Format.formatter -> float array -> unit
@@ -2199,7 +2199,7 @@ where \(\gamma\) is the incomplete gamma function.
 

Example:

-
+
 pp_float_array_size:
 [ 6:   1.000000   1.732051   1.732051   1.000000   1.732051   1.000000 ]
 
@@ -2222,8 +2222,8 @@ pp_bitstring 14:
 
-
-

14 Zkey

+
+

14 Zkey

Encodes the powers of x, y, z in a compact form, suitable for being @@ -2231,7 +2231,7 @@ used as keys in a hash table.

-Internally, the Zkey.t is made of two integers, left and right. +Internally, the Zkey.t is made of two integers, left and right. The small integers x, y and z are stored compactly in this 126-bits space:

@@ -2239,7 +2239,7 @@ space:

Example:

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

-
-

14.1 Types

+
+

14.1 Types

-Zkey.t +Zkey.t

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

14.2 Conversions

+
+

14.2 Conversions

val of_powers_three  : Powers.t -> t
@@ -2308,22 +2308,22 @@ The values of x,y,z should be positive and should not exceed 32767 for
 
 
 of_powers_three
-Create from a Powers.t
+Create from a Powers.t
 
 
 
 of_powers_six
-Create from two Powers.t
+Create from two Powers.t
 
 
 
 of_powers_nine
-Create from three Powers.t
+Create from three Powers.t
 
 
 
 of_powers_twelve
-Create from four Powers.t
+Create from four Powers.t
 
 
 
@@ -2348,7 +2348,7 @@ The values of x,y,z should be positive and should not exceed 32767 for
 
 
 to_powers
-Convert to an Powers.t array
+Convert to an Powers.t array
 
 
 
@@ -2360,8 +2360,8 @@ The values of x,y,z should be positive and should not exceed 32767 for
 
-
-

14.3 Functions for hash tables

+
+

14.3 Functions for hash tables

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

14.4 Printers

+
+

14.4 Printers

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

15 Zmap

+
+

15 Zmap

A hash table where the keys are Zkey

-
-

15.1 Type

+
+

15.1 Type

-Zmap.t +Zmap.t

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

Author: Anthony Scemama

-

Created: 2021-10-19 Tue 16:20

+

Created: 2022-11-07 Mon 14:58

Validate

diff --git a/docs/gaussian.html b/docs/gaussian.html index f0934cf..0d53dd4 100644 --- a/docs/gaussian.html +++ b/docs/gaussian.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Gaussian @@ -272,41 +272,41 @@ org_html_manager.setup(); // activate after the parameters are set

Table of Contents

-
-

1 Summary

+
+

1 Summary

-
-

2 Atomic shell

+
+

2 Atomic shell

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

-

2.1 Type

+
+

2.1 Type

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

2.2 Access

+
+

2.2 Access

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

2.3 Creation

+
+

2.3 Creation

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

2.4 Printers

+
+

2.4 Printers

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

3 Atomic shell pair couple

+
+

3 Atomic shell pair couple

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

-
-

3.1 Type

+
+

3.1 Type

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

3.2 Access

+
+

3.2 Access

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

3.3 Creation

+
+

3.3 Creation

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

3.4 Printers

+
+

3.4 Printers

val pp : Format.formatter -> t -> unit
@@ -638,8 +638,8 @@ Default cutoff is \(\epsilon\).
 
-
-

4 Atomic shell pair

+
+

4 Atomic shell pair

Data structure to represent pairs of atomic shells. The products of @@ -651,8 +651,8 @@ An atomic shell pair is an array of pairs of contracted shells.

-
-

4.1 Type

+
+

4.1 Type

type t
@@ -663,8 +663,8 @@ An atomic shell pair is an array of pairs of contracted shells.
 
-
-

4.2 Access

+
+

4.2 Access

val atomic_shell_a         : t -> Atomic_shell.t
@@ -731,8 +731,8 @@ An atomic shell pair is an array of pairs of contracted shells.
 
-
-

4.3 Creation

+
+

4.3 Creation

val make : ?cutoff:float -> Atomic_shell.t -> Atomic_shell.t -> t option
@@ -765,8 +765,8 @@ If an atomic shell pair is not significant, sets the value to None.
 
-
-

4.4 Printers

+
+

4.4 Printers

val pp : Format.formatter -> t -> unit
@@ -778,7 +778,7 @@ If an atomic shell pair is not significant, sets the value to None.
 

Author: Anthony Scemama

-

Created: 2021-10-19 Tue 16:20

+

Created: 2022-11-07 Mon 11:28

Validate

diff --git a/docs/top.html b/docs/top.html index eae2012..ae6170e 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 @@ -250,18 +250,18 @@ org_html_manager.setup(); // activate after the parameters are set

Table of Contents

-
-

1 Summary

+
+

1 Summary

Author: Anthony Scemama

-

Created: 2021-10-19 Tue 16:20

+

Created: 2022-11-07 Mon 14:58

Validate

diff --git a/top/lib/install_printers.ml b/top/lib/install_printers.ml index 3573de7..09ffdd8 100644 --- a/top/lib/install_printers.ml +++ b/top/lib/install_printers.ml @@ -1,4 +1,4 @@ -(* [[file:~/QCaml/top/install_printers.org::*Intall%20printers][Intall printers:3]] *) +(* [[file:~/QCaml/top/install_printers.org::*Intall printers][Intall printers:3]] *) let printers = [ "Ao.Basis.pp" ;