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 :class:`pandas.DataFrame` with the columns
        ``['b', 'a', 'd']``. Look into
        :meth:`~chemcoord.Cartesian.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 :meth:`~Cartesian.get_zmat`
        the check for pathological linearity is not performed!
        So if a ``construction_table`` is either manually created,
        or obtained from :meth:`~Cartesian.get_construction_table`
        under the option ``perform_checks = False``, it is recommended to use
        the following methods:

            * :meth:`~Cartesian.correct_dihedral`
            * :meth:`~Cartesian.correct_absolute_refs`

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

            * :meth:`~Cartesian.check_dihedral`
            * :meth:`~Cartesian.check_absolute_refs`

        Args:
            construction_table (pandas.DataFrame):
            use_lookup (bool): Use a lookup variable for
                :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                specified in ``settings['defaults']['use_lookup']``

        Returns:
            Zmat: A new instance of :class:`~Zmat`.

def get_zmat(self, 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 :class:`pandas.DataFrame` with the columns
        ``['b', 'a', 'd']``. Look into
        :meth:`~chemcoord.Cartesian.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 :meth:`~Cartesian.get_zmat`
        the check for pathological linearity is not performed!
        So if a ``construction_table`` is either manually created,
        or obtained from :meth:`~Cartesian.get_construction_table`
        under the option ``perform_checks = False``, it is recommended to use
        the following methods:

            * :meth:`~Cartesian.correct_dihedral`
            * :meth:`~Cartesian.correct_absolute_refs`

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

            * :meth:`~Cartesian.check_dihedral`
            * :meth:`~Cartesian.check_absolute_refs`

        Args:
            construction_table (pandas.DataFrame):
            use_lookup (bool): Use a lookup variable for
                :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                specified in ``settings['defaults']['use_lookup']``

        Returns:
            Zmat: A new instance of :class:`~Zmat`.
        """
        if use_lookup is None:
            use_lookup = settings['defaults']['use_lookup']

        self.get_bonds(use_lookup=use_lookup)
        self._give_val_sorted_bond_dict(use_lookup=use_lookup)
        use_lookup = True
        # During function execution the connectivity situation won't change
        # So use_look=True will be used
        if construction_table is None:
            c_table = self.get_construction_table(use_lookup=use_lookup)
            c_table = self.correct_dihedral(c_table, use_lookup=use_lookup)
            c_table = self.correct_absolute_refs(c_table)
        else:
            c_table = construction_table
        return self._build_zmat(c_table)