Home >
Community >
How to convert an XYZ file to Z-matrix?
Upvote
32
Downvote
+ Software
+ Cheminformatics
+ Chemistry
Posted by
Nick Parks
How to convert an XYZ file to Z-matrix?
According to the manual of the newzmat utility of Gaussian 16, it accepts unadorned Cartesian coordinates (G16 online manual). The format you have posted is actually (simple) xmol. This means the first line denotes the number of atoms, the second line denotes a comment, and both need to be skipped.
Therefore your file should look like this:
C 0.539202 -0.539202 1.933833
C -0.539202 0.539202 1.933833
H 1.536064 -0.098299 1.932264
H 0.459532 -1.174264 2.816008
H 0.456405 -1.179449 1.055941
H -1.536064 0.098299 1.932264
H -0.459532 1.174264 2.816008
H -0.456405 1.179449 1.055941
C 0.539202 0.539202 -1.933833
C -0.539202 -0.539202 -1.933833
H 1.179449 0.456405 -1.055941
H 1.174264 0.459532 -2.816008
H 0.098299 1.536064 -1.932264
H -1.174264 -0.459532 -2.816008
H -0.098299 -1.536064 -1.932264
H -1.179449 -0.456405 -1.055941
In Gaussian terms, a block of cartesian coordinates is also a z-matrix. Therefore you also need to tell Gaussian to rebuild it (-rebuildzmat). This will likely fail on your input with an error:
Input z-matrix variables are not compatible with final structure.
If you allow rounding (-round) it will work. The complete command is:
newzmat -ixyz -ozmat -round -rebuildzmat
The following file is produced (it is a valid Gaussian input file):
Whether or not this z-matrix does actually fits the purpose you are needing it for, is a different question. For the most tasks, where z-matrices are the superior input, I recommend building it by hand.
According to the manual of the newzmat utility of Gaussian 16, it accepts unadorned Cartesian coordinates (G16 online manual). The format you have posted is actually (simple) xmol. This means the first line denotes the number of atoms, the second line denotes a comment, and both need to be skipped.
In Gaussian terms, a block of cartesian coordinates is also a z-matrix. Therefore you also need to tell Gaussian to rebuild it (-rebuildzmat). This will likely fail on your input with an error:
Input z-matrix variables are not compatible with final structure.
If you allow rounding (-round) it will work. The complete command is:
newzmat -ixyz -ozmat -round -rebuildzmat
The following file is produced (it is a valid Gaussian input file):
Whether or not this z-matrix does actually fits the purpose you are needing it for, is a different question. For the most tasks, where z-matrices are the superior input, I recommend building it by hand.
According to the manual of the
newzmatutility of Gaussian 16, it accepts unadorned Cartesian coordinates (G16 online manual). The format you have posted is actually (simple)xmol. This means the first line denotes the number of atoms, the second line denotes a comment, and both need to be skipped.Therefore your file should look like this:
In Gaussian terms, a block of cartesian coordinates is also a z-matrix. Therefore you also need to tell Gaussian to rebuild it (
-rebuildzmat). This will likely fail on your input with an error:If you allow rounding (
-round) it will work. The complete command is:The following file is produced (it is a valid Gaussian input file):
Whether or not this z-matrix does actually fits the purpose you are needing it for, is a different question. For the most tasks, where z-matrices are the superior input, I recommend building it by hand.
According to the manual of the
newzmatutility of Gaussian 16, it accepts unadorned Cartesian coordinates (G16 online manual). The format you have posted is actually (simple)xmol. This means the first line denotes the number of atoms, the second line denotes a comment, and both need to be skipped.Therefore your file should look like this:
In Gaussian terms, a block of cartesian coordinates is also a z-matrix. Therefore you also need to tell Gaussian to rebuild it (
-rebuildzmat). This will likely fail on your input with an error:If you allow rounding (
-round) it will work. The complete command is:The following file is produced (it is a valid Gaussian input file):
Whether or not this z-matrix does actually fits the purpose you are needing it for, is a different question. For the most tasks, where z-matrices are the superior input, I recommend building it by hand.
More
VOTE
Here is a ZMAT for your XYZ coordinates:
I copied and pasted your XYZ into this: https://www.webqc.org/molecularformatsconverter.php
Here is a ZMAT for your XYZ coordinates:
I copied and pasted your XYZ into this: https://www.webqc.org/molecularformatsconverter.php
More
VOTE