chemcoord.Cartesian.get_zmat

Cartesian.get_zmat(construction_table=None, use_lookup=None)

Transform to internal coordinates.

Transforming to internal coordinates involves basically three steps:

1. Define an order of how to build and define for each atom the used reference atoms.

2. Check for problematic local linearity. In this algorithm an angle with 170 < angle < 10 is assumed to be linear. This is not the mathematical definition, but makes it safer against “floating point noise”

3. Calculate the bond lengths, angles and dihedrals using the references defined in step 1 and 2.

In the first two steps a so called construction_table is created. This is basically a Zmatrix without the values for the bonds, angles and dihedrals hence containing only the information about the used references. ChemCoord uses a pandas.DataFrame with the columns ['b', 'a', 'd']. Look into get_construction_table() for more information.

It is important to know, that calculating the construction table is a very costly step since the algoritym tries to make some guesses based on connectivity to create a “chemical” zmatrix.

If you create several zmatrices based on the same references you can obtain the construction table of a zmatrix with Zmat_instance.loc[:, ['b', 'a', 'd']] If you then pass the buildlist as argument to give_zmat, the algorithm directly starts with step 3 (which is much faster).

If a construction_table is passed into get_zmat() the check for pathological linearity is not performed! So if a construction_table is either manually created, or obtained from get_construction_table() under the option perform_checks = False, it is recommended to use the following methods:

If you want to check for problematic indices in order to solve the invalid references yourself, use the following methods:

Parameters:
  • construction_table (pandas.DataFrame) –
  • use_lookup (bool) – Use a lookup variable for get_bonds(). The default is specified in settings['defaults']['use_lookup']
Returns:

A new instance of Zmat.

Return type:

Zmat