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

62 lines
1.7 KiB
OCaml
Raw Normal View History

2024-02-28 10:34:39 +01:00
(** Z-matrix representation of nuclear coordinates *)
(** let zmt = Zmatrix.of_string "
* n
* n 1 nn
* h 1 hn 2 hnn
* h 2 hn 1 hnn 3 dih4
* h 1 hn 2 hnn 4 dih5
* h 2 hn 1 hnn 3 dih5
*
* nn 1.446
* hn 1.016
* hnn 106.0
* dih4 -54.38
* dih5 54.38
* " ;;
* - : Zmatrix.t = N
* N 1 1.446000
* H 1 1.016000 2 106.000000
* H 2 1.016000 1 106.000000 3 -54.380000
* H 1 1.016000 2 106.000000 4 54.380000
* H 2 1.016000 1 106.000000 3 54.380000
*
*
* Zmatrix.to_xyz zmt ;;
* - : (Element.t * float * float * float) array =
* [|(N, 0., 0., 0.); (N, 0., 0., 1.446);
* (H, -0.976641883073332107, 0., -0.280047553510071046);
* (H, -0.568802835186988709, 0.793909757123734683, 1.726047553510071);
* (H, 0.314092649983635563, 0.924756819385119, -0.280047553510071101);
* (H, -0.568802835186988709, -0.793909757123734683, 1.726047553510071)|]
*
*
* Zmatrix.to_xyz_string zmt ;;
* - : string =
* "N 0.000000 0.000000 0.000000
* N 0.000000 0.000000 1.446000
* H -0.976642 0.000000 -0.280048
* H -0.568803 0.793910 1.726048
* H 0.314093 0.924757 -0.280048
* H -0.568803 -0.793910 1.726048"
*)
2020-12-29 02:29:43 +01:00
type t
2024-02-28 10:34:39 +01:00
(** Conversion *)
2020-12-29 02:29:43 +01:00
val of_string : string -> t
2024-02-28 10:34:39 +01:00
(** Reads a z-matrix from a string *)
2020-12-29 02:29:43 +01:00
val to_xyz : t -> (Element.t * float * float * float) array
2024-02-28 10:34:39 +01:00
(** Converts to xyz format, as in the ~Nuclei~ module *)
2020-12-29 02:29:43 +01:00
val to_xyz_string : t -> string
2024-02-28 10:34:39 +01:00
(** Converts to xyz format, as a string *)
2020-12-29 02:29:43 +01:00
2024-02-28 10:34:39 +01:00
(** Printers *)
2020-12-29 02:29:43 +01:00
val pp : Format.formatter -> t -> unit