mcocdawc / chemcoord

A python module for manipulating cartesian and internal coordinates.
GNU Lesser General Public License v3.0
72 stars 19 forks source link

Question: How to specify individual zmat generation #43

Closed Eldrad-Ulthran closed 7 years ago

Eldrad-Ulthran commented 7 years ago

I'd like to specify the ordering of atoms in a zmatrix, but unfortunately there is no tutorial on this issue yet. According to the documentation get_zmat can be provided with a construction_table, but how does this table should look like? get_construction_table requires a fragment list, which in turn consists of "fragment" and its construction table, which resembles a closed circle. Also there is no description of how "fragment" should look like.

Maybe an explicit working example could help, like e.g. for the water dimer from the tutorial, where oxygen 2 (atom nr. 4) is the first atom in the zmat, oxygen 1 (atom nr. 1) is the second one, while all of the hydrogens are entered automatically.

mcocdawc commented 7 years ago

Have a look at the updated tutorial http://nbviewer.jupyter.org/github/mcocdawc/chemcoord/blob/master/Tutorial/Transformation.ipynb

Does this answer your question?

Eldrad-Ulthran commented 7 years ago

Thank you, now I got the zmat to be ordered like I want it. Is there a more elegant way to redefine the first atoms in the zmat instead of entering these magic numbers? Atm I'm doing the following with my coordinate file called "ester":

ester_frag = ester.fragmentate()
ester_c_table = pd.DataFrame([[-9223372036854775808, -9223372036854775805, -9223372036854775807],
[0, -9223372036854775805, -9223372036854775807],
[1, 0, -9223372036854775807],
[2, 1, 0],
[3, 2, 1],
[4, 3, 2],
[6, 4, 3],
[7, 6, 4]], columns=['b', 'a', 'd'], index=[0, 1, 2, 3, 4, 6, 7, 8])
ester_const_table = ester.get_construction_table(fragment_list=[(ester_frag[0], ester_c_table)])
zester = ester.get_zmat(ester_const_table)
mcocdawc commented 7 years ago

Yes there is. I recently made a commit for it. Now you can use also the "magic strings"

['origin', 'e_x', 'e_y', 'e_z']

The names should be self explaining. Documentation has still to be updated.