def zmatrix_atom_ordering(x2m):
    """ Build dictionary that acts as a mapping from the order of atoms in the
        x2z molecule object to the order of atoms in the reslutant Z-Matrix.

        :param x2m: molecule object
        :type x2m: x2z molecule object
        :rtype: dict[int: int]
    """
    return {geo_key: zma_key
            for zma_key, geo_key in enumerate(x2m.atom_ordering())}