10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-23 04:43:32 +01:00
QCaml/common/lib/spin.ml

25 lines
333 B
OCaml
Raw Normal View History

2024-01-17 13:59:05 +01:00
(** Spin *)
2019-02-18 12:41:54 +01:00
2024-01-17 13:59:05 +01:00
(** Type *)
2019-02-18 12:41:54 +01:00
2020-12-28 01:08:55 +01:00
type t = (* m_s *)
| Alfa (* {% $m_s = +1/2$ %} *)
| Beta (* {% $m_s = -1/2$ %} *)
2019-02-22 19:19:11 +01:00
2024-01-17 13:59:05 +01:00
(** Functions *)
2019-02-22 19:19:11 +01:00
2020-12-28 01:08:55 +01:00
let other = function
| Alfa -> Beta
| Beta -> Alfa
let to_string = function
| Alfa -> "Alpha"
| Beta -> "Beta "
2024-01-17 13:59:05 +01:00
(** Printers *)
2020-12-28 01:08:55 +01:00
let pp ppf t =
Format.fprintf ppf "@[%s@]" (to_string t)