10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 20:33:36 +01:00
QCaml/common/lib/spin.ml

25 lines
333 B
OCaml

(** Spin *)
(** Type *)
type t = (* m_s *)
| Alfa (* {% $m_s = +1/2$ %} *)
| Beta (* {% $m_s = -1/2$ %} *)
(** Functions *)
let other = function
| Alfa -> Beta
| Beta -> Alfa
let to_string = function
| Alfa -> "Alpha"
| Beta -> "Beta "
(** Printers *)
let pp ppf t =
Format.fprintf ppf "@[%s@]" (to_string t)