2023-06-27 10:15:50 +02:00
|
|
|
(** Azimuthal quantum number, repsesented as \( s,p,d,\dots \) *)
|
2018-02-24 23:57:38 +01:00
|
|
|
|
2018-03-15 15:25:49 +01:00
|
|
|
type t =
|
2020-12-26 01:47:55 +01:00
|
|
|
| S | P | D | F | G | H | I | J | K | L | M | N | O
|
|
|
|
| Int of int
|
2023-06-27 10:15:50 +02:00
|
|
|
|
2020-09-26 12:02:53 +02:00
|
|
|
exception Angular_momentum_error of string
|
2023-06-27 10:15:50 +02:00
|
|
|
(** An exception is raised when the ~Angular_momentum.t~ element can't
|
|
|
|
be created. *)
|
2018-02-24 23:57:38 +01:00
|
|
|
|
2020-12-26 01:47:55 +01:00
|
|
|
type kind =
|
2023-06-27 10:15:50 +02:00
|
|
|
| Singlet of t
|
2020-12-26 01:47:55 +01:00
|
|
|
| Doublet of (t * t)
|
|
|
|
| Triplet of (t * t * t)
|
|
|
|
| Quartet of (t * t * t * t)
|
|
|
|
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Type ~kind~ is used to build shells, shell doublets, triplets or
|
|
|
|
quartets, use in the two-electron operators. *)
|
|
|
|
|
2018-03-16 00:23:47 +01:00
|
|
|
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Conversions *)
|
2020-12-26 01:47:55 +01:00
|
|
|
|
2018-02-24 23:57:38 +01:00
|
|
|
val of_char : char -> t
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Returns an ~Angular_momentum.t~ when a shell is given as a character
|
|
|
|
(case insensitive)
|
|
|
|
|
|
|
|
Angular_momentum.of_char 'p';;
|
|
|
|
- : Angular_momentum.t = P
|
|
|
|
*)
|
|
|
|
|
2018-02-24 23:57:38 +01:00
|
|
|
val to_char : t -> char
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Converts the angular momentum into a char
|
|
|
|
|
|
|
|
Angular_momentum.(to_char P);;
|
|
|
|
- : char = 'P'
|
|
|
|
*)
|
2018-02-24 23:57:38 +01:00
|
|
|
|
|
|
|
val to_int : t -> int
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Returns the $l_{max}$ value of the shell
|
|
|
|
|
|
|
|
Angular_momentum.(to_int D);;
|
|
|
|
- : int = 2
|
|
|
|
*)
|
|
|
|
|
2018-02-24 23:57:38 +01:00
|
|
|
val of_int : int -> t
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Returns a shell given an $l$ value
|
|
|
|
|
|
|
|
Angular_momentum.of_int 2;;
|
|
|
|
- : Angular_momentum.t = D
|
|
|
|
*)
|
2018-02-24 23:57:38 +01:00
|
|
|
|
2020-12-27 23:08:12 +01:00
|
|
|
val to_string : t -> string
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Converts the angular momentum into a string
|
|
|
|
|
|
|
|
Angular_momentum.(to_string D);;
|
|
|
|
- : string = "D"
|
|
|
|
*)
|
2018-02-24 23:57:38 +01:00
|
|
|
|
2020-12-26 01:47:55 +01:00
|
|
|
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Shell functions *)
|
2020-12-26 01:47:55 +01:00
|
|
|
|
2020-12-27 23:08:12 +01:00
|
|
|
val n_functions : t -> int
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Returns the number of cartesian functions in a shell. *)
|
|
|
|
|
2020-12-27 23:08:12 +01:00
|
|
|
val zkey_array : kind -> Zkey.t array
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Array of ~Zkey.t~, where each element is a a key associated with the
|
|
|
|
the powers of $x,y,z$. *)
|
2018-02-24 23:57:38 +01:00
|
|
|
|
|
|
|
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Arithmetic *)
|
2018-03-14 21:58:55 +01:00
|
|
|
|
|
|
|
val ( + ) : t -> t -> t
|
2023-06-27 10:15:50 +02:00
|
|
|
(**
|
|
|
|
Angular_momentum.(D + P);;
|
|
|
|
- : Angular_momentum.t = F
|
|
|
|
*)
|
|
|
|
|
2018-03-14 21:58:55 +01:00
|
|
|
val ( - ) : t -> t -> t
|
2023-06-27 10:15:50 +02:00
|
|
|
(**
|
|
|
|
Angular_momentum.(F - P);;
|
|
|
|
- : Angular_momentum.t = D
|
|
|
|
*)
|
2018-03-14 21:58:55 +01:00
|
|
|
|
2018-03-15 15:25:49 +01:00
|
|
|
|
2023-06-27 10:15:50 +02:00
|
|
|
(** Printers *)
|
2018-03-15 15:25:49 +01:00
|
|
|
|
2020-12-27 23:08:12 +01:00
|
|
|
val pp : Format.formatter -> t -> unit
|
2020-12-26 01:47:55 +01:00
|
|
|
val pp_string : Format.formatter -> t -> unit
|
2020-12-27 23:08:12 +01:00
|
|
|
val pp_int : Format.formatter -> t -> unit
|