mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-11-14 18:13:51 +01:00
33 lines
692 B
OCaml
33 lines
692 B
OCaml
|
open Core;;
|
||
|
|
||
|
type t =
|
||
|
| Guess
|
||
|
| Canonical
|
||
|
| Natural
|
||
|
| Localized
|
||
|
| Orthonormalized
|
||
|
| None
|
||
|
[@@deriving sexp]
|
||
|
;;
|
||
|
|
||
|
let to_string = function
|
||
|
| Guess -> "Guess"
|
||
|
| Canonical -> "Canonical"
|
||
|
| Orthonormalized -> "Orthonormalized"
|
||
|
| Natural -> "Natural"
|
||
|
| Localized -> "Localized"
|
||
|
| None -> "None"
|
||
|
;;
|
||
|
|
||
|
let of_string s =
|
||
|
match String.lowercase (String.strip s) with
|
||
|
| "guess" -> Guess
|
||
|
| "canonical" -> Canonical
|
||
|
| "natural" -> Natural
|
||
|
| "localized" -> Localized
|
||
|
| "orthonormalized" -> Orthonormalized
|
||
|
| "none" -> None
|
||
|
| _ -> (print_endline s ; failwith "MO_label should be one of:
|
||
|
Guess | Orthonormalized | Canonical | Natural | Localized | None.")
|
||
|
;;
|