def neighbors(self, qids: Iterable[ops.Qid] | None = None) -> set[_BaseGridQid]:
        """Returns qubits that are potential neighbors to this GridQid

        Args:
            qids: optional Iterable of qubits to constrain neighbors to.
        """
        neighbors = set()
        for q in [self + (0, 1), self + (1, 0), self + (-1, 0), self + (0, -1)]:
            if qids is None or q in qids:
                neighbors.add(q)
        return neighbors
Returns qubits that are potential neighbors to this GridQid

        Args:
            qids: optional Iterable of qubits to constrain neighbors to.
        
cirq-core/cirq/devices/grid_qubit.py