def find_index_root(sorted_topology, topology):
    """
    It finds the index of the root atom in the original topology
    that matches with the one from the topology that fulfills the Impact
    template rules.

    Parameters
    ----------
    sorted_topology : a peleffy.topology.Topology object
        The topology sorted to fulfill the Impact template format
    topology : a peleffy.topology.Topology object
        The original topology object

    Returns
    -------
    index_root : int
        The index of the root atom in the original topology
    """
    atom_name = sorted_topology.atoms[0].PDB_name

    for i, atom in enumerate(topology.atoms):
        if atom.PDB_name == atom_name:
            return i

    return None