mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-22 20:33:36 +01:00
90 lines
1.9 KiB
OCaml
90 lines
1.9 KiB
OCaml
(** Azimuthal quantum number, repsesented as \( s,p,d,\dots \) *)
|
|
|
|
type t =
|
|
| S | P | D | F | G | H | I | J | K | L | M | N | O
|
|
| Int of int
|
|
|
|
exception Angular_momentum_error of string
|
|
(** An exception is raised when the ~Angular_momentum.t~ element can't
|
|
be created. *)
|
|
|
|
type kind =
|
|
| Singlet of t
|
|
| Doublet of (t * t)
|
|
| Triplet of (t * t * t)
|
|
| Quartet of (t * t * t * t)
|
|
|
|
(** Type ~kind~ is used to build shells, shell doublets, triplets or
|
|
quartets, use in the two-electron operators. *)
|
|
|
|
|
|
(** Conversions *)
|
|
|
|
val of_char : char -> t
|
|
(** Returns an ~Angular_momentum.t~ when a shell is given as a character
|
|
(case insensitive)
|
|
|
|
Angular_momentum.of_char 'p';;
|
|
- : Angular_momentum.t = P
|
|
*)
|
|
|
|
val to_char : t -> char
|
|
(** Converts the angular momentum into a char
|
|
|
|
Angular_momentum.(to_char P);;
|
|
- : char = 'P'
|
|
*)
|
|
|
|
val to_int : t -> int
|
|
(** Returns the $l_{max}$ value of the shell
|
|
|
|
Angular_momentum.(to_int D);;
|
|
- : int = 2
|
|
*)
|
|
|
|
val of_int : int -> t
|
|
(** Returns a shell given an $l$ value
|
|
|
|
Angular_momentum.of_int 2;;
|
|
- : Angular_momentum.t = D
|
|
*)
|
|
|
|
val to_string : t -> string
|
|
(** Converts the angular momentum into a string
|
|
|
|
Angular_momentum.(to_string D);;
|
|
- : string = "D"
|
|
*)
|
|
|
|
|
|
(** Shell functions *)
|
|
|
|
val n_functions : t -> int
|
|
(** Returns the number of cartesian functions in a shell. *)
|
|
|
|
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$. *)
|
|
|
|
|
|
(** Arithmetic *)
|
|
|
|
val ( + ) : t -> t -> t
|
|
(**
|
|
Angular_momentum.(D + P);;
|
|
- : Angular_momentum.t = F
|
|
*)
|
|
|
|
val ( - ) : t -> t -> t
|
|
(**
|
|
Angular_momentum.(F - P);;
|
|
- : Angular_momentum.t = D
|
|
*)
|
|
|
|
|
|
(** Printers *)
|
|
|
|
val pp : Format.formatter -> t -> unit
|
|
val pp_string : Format.formatter -> t -> unit
|
|
val pp_int : Format.formatter -> t -> unit
|