def num_qubits(self) -> int | None:
        """Returns number of qubits in the domain if known, None if unknown."""
        if not self:
            return None
        any_gate = next(iter(self))
        return any_gate.num_qubits()
Returns number of qubits in the domain if known, None if unknown.
cirq-core/cirq/ops/linear_combinations.py