10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 14:43:41 +01:00
QCaml/Utils/AngularMomentum.mli

116 lines
2.0 KiB
OCaml
Raw Normal View History

2018-03-06 18:25:48 +01:00
(** Azimuthal quantum number, represented as {% $s,p,d,\dots$ %} *)
2018-02-24 23:57:38 +01:00
2018-03-15 15:25:49 +01:00
type t =
| S | P | D | F | G | H | I | J | K | L | M | N | O
| Int of int
2018-02-24 23:57:38 +01:00
exception AngularMomentumError of string
(** Raised when the {!AngularMomentum.t} element can't be created.
*)
2018-03-16 00:23:47 +01:00
2018-02-24 23:57:38 +01:00
val of_char : char -> t
(** Returns an {!AngularMomentum.t} when a shell is given as a character (case
insensitive).
Example:
2018-03-16 00:23:47 +01:00
{[
AngularMomentum.of_char 'p' -> AngularMomentum.P
]}
2018-02-24 23:57:38 +01:00
*)
val to_string : t -> string
(**
2018-03-16 00:23:47 +01:00
{[
AngularMomentum.(to_string D) -> "D"
]}
2018-02-24 23:57:38 +01:00
*)
val to_char : t -> char
(**
2018-03-16 00:23:47 +01:00
{[
AngularMomentum.(to_char D) -> 'D'
]}
2018-02-24 23:57:38 +01:00
*)
val to_int : t -> int
(**
Returns the l{_max} value of the shell.
Example:
2018-03-16 00:23:47 +01:00
{[
AngularMomentum.of_int 3 -> AngularMomentum.F
]}
2018-02-24 23:57:38 +01:00
*)
val of_int : int -> t
(**
Opposite of {!of_int}.
Example:
2018-03-16 00:23:47 +01:00
{[
AngularMomentum.of_int 3 -> AngularMomentum.F
]}
2018-02-24 23:57:38 +01:00
*)
type kind =
Singlet of t
| Doublet of (t * t)
| Triplet of (t * t * t)
| Quartet of (t * t * t * t)
val n_functions : t -> int
(** Number of cartesian functions in shell.
Example:
2018-03-16 00:23:47 +01:00
{[
AngularMomentum.n_functions D -> 6
]}
2018-02-24 23:57:38 +01:00
*)
val zkey_array : kind -> Zkey.t array
(** Array of {!Zkey.t}, where each element is a a key associated with the
the powers of x,y,z.
Example:
2018-03-16 00:23:47 +01:00
{[
2018-02-24 23:57:38 +01:00
AngularMomentum.( zkey_array Doublet (P,S) ) ->
[| {Zkey.left = 0; right = 1125899906842624} ;
{Zkey.left = 0; right = 1099511627776} ;
{Zkey.left = 0; right = 1073741824} |]
=
let s,x,y,z =
Powers.( of_int_tuple (0,0,0),
of_int_tuple (1,0,0),
of_int_tuple (0,1,0),
of_int_tuple (0,0,1) )
in
Array.map (fun (a,b) -> {!Zkey.of_powers_six} a b)
[| (x,s) ; (y,s) ; (z,s) |]
2018-03-16 00:23:47 +01:00
]}
2018-02-24 23:57:38 +01:00
2018-03-16 00:23:47 +01:00
*)
2018-03-14 21:58:55 +01:00
val ( + ) : t -> t -> t
val ( - ) : t -> t -> t
2018-03-15 15:25:49 +01:00
(** {2 Printers} *)
val pp_string : Format.formatter -> t -> unit
(** Prints as a string S, P, D, ... *)
val pp_int : Format.formatter -> t -> unit
(** Prints as an integer 0, 1, 2, ... *)