10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-23 04:43:32 +01:00
QCaml/particles/zmatrix.org
2020-12-29 02:38:12 +01:00

11 KiB

Z-matrix

Z-matrix representation of nuclear coordinates.

Type

type t

Conversion

val of_string      : string -> t
val to_xyz         : t -> (Element.t * float * float * float) array
val to_xyz_string  : t -> string
of_string Reads a z-matrix from a string
to_xyz Converts to xyz format, as in the Nuclei module
to_xyz_string Converts to xyz format, as a string
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"

Printers

val pp : Format.formatter -> t -> unit