def swap_along_path(self, path: tuple[ops.Qid]):
        """Adds SWAPs to move a logical qubit along a specified path."""
        for i in range(len(path) - 1):
            self.apply_swap(cast(QidPair, path[i : i + 2]))
Adds SWAPs to move a logical qubit along a specified path.
cirq-core/cirq/contrib/routing/greedy.py