def is_adjacent(self, other: cirq.Qid) -> bool:
        """Determines if two qubits are adjacent qubits."""
        return (
            isinstance(other, GridQubit)
            and abs(self._row - other._row) + abs(self._col - other._col) == 1
        )
Determines if two qubits are adjacent qubits.
cirq-core/cirq/devices/grid_qubit.py