mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-06 22:23:42 +01:00
Documentation
This commit is contained in:
parent
8918f49302
commit
24d2eb7e47
@ -192,9 +192,9 @@ let of_basis basis =
|
|||||||
let xl = to_powers powers_l in
|
let xl = to_powers powers_l in
|
||||||
let key =
|
let key =
|
||||||
if swap then
|
if swap then
|
||||||
Zkey.of_powers (Zkey.Twelve (xk,xl,xi,xj))
|
Zkey.of_powers_twelve xk xl xi xj
|
||||||
else
|
else
|
||||||
Zkey.of_powers (Zkey.Twelve (xi,xj,xk,xl))
|
Zkey.of_powers_twelve xi xj xk xl
|
||||||
in
|
in
|
||||||
let value =
|
let value =
|
||||||
Zmap.find cls key
|
Zmap.find cls key
|
||||||
|
@ -140,7 +140,7 @@ let of_basis basis =
|
|||||||
let i_c = shell.(i).index + i_c + 1 in
|
let i_c = shell.(i).index + i_c + 1 in
|
||||||
let xi = to_powers powers_i in
|
let xi = to_powers powers_i in
|
||||||
let key =
|
let key =
|
||||||
Zkey.of_powers (Zkey.Six (xi,xj))
|
Zkey.of_powers_six xi xj
|
||||||
in
|
in
|
||||||
let value =
|
let value =
|
||||||
try Zmap.find cls key
|
try Zmap.find cls key
|
||||||
|
@ -79,7 +79,7 @@ let of_basis_nuclei basis nuclei =
|
|||||||
let j_c = shell.(j).index + j_c + 1 in
|
let j_c = shell.(j).index + j_c + 1 in
|
||||||
let xj = to_powers powers_j in
|
let xj = to_powers powers_j in
|
||||||
let key =
|
let key =
|
||||||
Zkey.of_powers (Zkey.Six (xi,xj))
|
Zkey.of_powers_six xi xj
|
||||||
in
|
in
|
||||||
let value =
|
let value =
|
||||||
Zmap.find cls key
|
Zmap.find cls key
|
||||||
|
@ -37,7 +37,7 @@ let hvrr_one_e angMom_a angMom_b
|
|||||||
match angMom_a.Po.tot with
|
match angMom_a.Po.tot with
|
||||||
| 0 -> zero_m_array
|
| 0 -> zero_m_array
|
||||||
| _ ->
|
| _ ->
|
||||||
let key = Zkey.of_powers (Zkey.Three angMom_a) in
|
let key = Zkey.of_powers_three angMom_a in
|
||||||
|
|
||||||
try Zmap.find map key with
|
try Zmap.find map key with
|
||||||
| Not_found ->
|
| Not_found ->
|
||||||
|
@ -12,7 +12,7 @@ let make_lowdin ?(thresh=1.e-12) ~overlap =
|
|||||||
let u_vec, u_val = diagonalize_symm overlap in
|
let u_vec, u_val = diagonalize_symm overlap in
|
||||||
|
|
||||||
Vec.iter (fun x -> if x < thresh then
|
Vec.iter (fun x -> if x < thresh then
|
||||||
invalid_arg "Orthonormalization.make_lowdin") u_val;
|
invalid_arg (__FILE__^": make_lowdin") ) u_val;
|
||||||
|
|
||||||
let u_val = Vec.reci (Vec.sqrt u_val) in
|
let u_val = Vec.reci (Vec.sqrt u_val) in
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ let of_basis basis =
|
|||||||
let i_c = shell.(i).index + i_c + 1 in
|
let i_c = shell.(i).index + i_c + 1 in
|
||||||
let xi = to_powers powers_i in
|
let xi = to_powers powers_i in
|
||||||
let key =
|
let key =
|
||||||
Zkey.of_powers (Zkey.Six (xi,xj))
|
Zkey.of_powers_six xi xj
|
||||||
in
|
in
|
||||||
let value =
|
let value =
|
||||||
try Zmap.find cls key
|
try Zmap.find cls key
|
||||||
|
@ -96,12 +96,11 @@ let zkey_array a =
|
|||||||
begin
|
begin
|
||||||
match a with
|
match a with
|
||||||
| Singlet l1 ->
|
| Singlet l1 ->
|
||||||
List.map (fun x -> Zkey.of_powers (Zkey.Three x)) (keys_1d @@ to_int l1)
|
List.map (fun x -> Zkey.of_powers_three x) (keys_1d @@ to_int l1)
|
||||||
|
|
||||||
| Doublet (l1, l2) ->
|
| Doublet (l1, l2) ->
|
||||||
List.map (fun a ->
|
List.map (fun a ->
|
||||||
List.map (fun b ->
|
List.map (fun b -> Zkey.of_powers_six a b) (keys_1d @@ to_int l2)
|
||||||
Zkey.of_powers (Zkey.Six (a,b))) (keys_1d @@ to_int l2)
|
|
||||||
) (keys_1d @@ to_int l1)
|
) (keys_1d @@ to_int l1)
|
||||||
|> List.concat
|
|> List.concat
|
||||||
|
|
||||||
@ -110,7 +109,7 @@ let zkey_array a =
|
|||||||
List.map (fun a ->
|
List.map (fun a ->
|
||||||
List.map (fun b ->
|
List.map (fun b ->
|
||||||
List.map (fun c ->
|
List.map (fun c ->
|
||||||
Zkey.of_powers (Zkey.Nine (a,b,c))) (keys_1d @@ to_int l3)
|
Zkey.of_powers_nine a b c) (keys_1d @@ to_int l3)
|
||||||
) (keys_1d @@ to_int l2)
|
) (keys_1d @@ to_int l2)
|
||||||
|> List.concat
|
|> List.concat
|
||||||
) (keys_1d @@ to_int l1)
|
) (keys_1d @@ to_int l1)
|
||||||
@ -122,7 +121,7 @@ let zkey_array a =
|
|||||||
List.map (fun b ->
|
List.map (fun b ->
|
||||||
List.map (fun c ->
|
List.map (fun c ->
|
||||||
List.map (fun d ->
|
List.map (fun d ->
|
||||||
Zkey.of_powers (Zkey.Twelve (a,b,c,d))) (keys_1d @@ to_int l4)
|
Zkey.of_powers_twelve a b c d) (keys_1d @@ to_int l4)
|
||||||
) (keys_1d @@ to_int l3)
|
) (keys_1d @@ to_int l3)
|
||||||
|> List.concat
|
|> List.concat
|
||||||
) (keys_1d @@ to_int l2)
|
) (keys_1d @@ to_int l2)
|
||||||
|
@ -18,6 +18,6 @@ let make ?multiplicity:(multiplicity=1) ?charge:(charge=0) nuclei =
|
|||||||
let n_alpha = n_elec - n_beta in
|
let n_alpha = n_elec - n_beta in
|
||||||
let result = { n_alpha ; n_beta ; multiplicity } in
|
let result = { n_alpha ; n_beta ; multiplicity } in
|
||||||
if multiplicity <> (n_alpha - n_beta)+1 then
|
if multiplicity <> (n_alpha - n_beta)+1 then
|
||||||
invalid_arg "Electrons.make";
|
invalid_arg (__FILE__^": make");
|
||||||
result
|
result
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
type t = float
|
type t = float
|
||||||
|
|
||||||
let of_float x =
|
let of_float x =
|
||||||
assert ( x >= 0. );
|
if x < 0. then invalid_arg (__FILE__^": of_float");
|
||||||
x
|
x
|
||||||
|
|
||||||
external to_float : t -> float = "%identity"
|
external to_float : t -> float = "%identity"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
(** Floats >= 0. *)
|
||||||
type t = private float
|
type t = private float
|
||||||
val of_float : float -> t
|
val of_float : float -> t
|
||||||
val to_float : t -> float
|
val to_float : t -> float
|
||||||
|
@ -5,7 +5,11 @@ let of_int_tuple t =
|
|||||||
match t with
|
match t with
|
||||||
| (x,y,z) -> { x ; y ; z ; tot=x+y+z }
|
| (x,y,z) -> { x ; y ; z ; tot=x+y+z }
|
||||||
in
|
in
|
||||||
assert (result.tot >= 0);
|
if result.x < 0 ||
|
||||||
|
result.y < 0 ||
|
||||||
|
result.z < 0 ||
|
||||||
|
result.tot < 0 then
|
||||||
|
invalid_arg (__FILE__^": of_int_tuple");
|
||||||
result
|
result
|
||||||
|
|
||||||
let to_int_tuple { x ; y ; z ; _ } = (x,y,z)
|
let to_int_tuple { x ; y ; z ; _ } = (x,y,z)
|
||||||
|
@ -1,7 +1,57 @@
|
|||||||
type t = private { x: int ; y : int ; z : int ; tot : int }
|
(** Contains powers of x, y and z describing the polynomials in atomic basis sets. *)
|
||||||
val of_int_tuple : int * int * int -> t
|
|
||||||
val to_int_tuple : t -> int * int * int
|
type t = private {
|
||||||
val get : Coordinate.axis -> t -> int
|
x : int ;
|
||||||
val incr : Coordinate.axis -> t -> t
|
y : int ;
|
||||||
val decr : Coordinate.axis -> t -> t
|
z : int ;
|
||||||
|
tot : int ; (* x + y + z *)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
val of_int_tuple : int * int * int -> t
|
||||||
|
(** Example:
|
||||||
|
[of_int_tuple (2,3,1) -> { x=2 ; y=3 ; z=1 ; tot=6 }]
|
||||||
|
@raise Invalid_argument if x, y or z < 0.
|
||||||
|
*)
|
||||||
|
|
||||||
|
|
||||||
|
val to_int_tuple : t -> int * int * int
|
||||||
|
(** Example:
|
||||||
|
[to_int_tuple { x=2 ; y=3 ; z=1 ; tot=6 } -> (2,3,1) ]
|
||||||
|
*)
|
||||||
|
|
||||||
|
|
||||||
|
val get : Coordinate.axis -> t -> int
|
||||||
|
(** Example:
|
||||||
|
|
||||||
|
[Powers.get Coordinate.Y { x=2 ; y=3 ; z=1 ; tot=6 } -> 3]
|
||||||
|
|
||||||
|
*)
|
||||||
|
|
||||||
|
|
||||||
|
val incr : Coordinate.axis -> t -> t
|
||||||
|
(** Returns a new {!Powers.t} with the power on the given axis incremented.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
{[
|
||||||
|
Powers.incr Coordinate.Y { x=2 ; y=3 ; z=1 ; tot=6 } ->
|
||||||
|
{ x=2 ; y=4 ; z=1 ; tot=7 }
|
||||||
|
]}
|
||||||
|
|
||||||
|
*)
|
||||||
|
|
||||||
|
|
||||||
|
val decr : Coordinate.axis -> t -> t
|
||||||
|
(** 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:
|
||||||
|
|
||||||
|
{[
|
||||||
|
Powers.incr Coordinate.Y { x=2 ; y=3 ; z=1 ; tot=6 } ->
|
||||||
|
{ x=2 ; y=2 ; z=1 ; tot=5 }
|
||||||
|
]}
|
||||||
|
|
||||||
|
*)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user