def _check_qids_dimension(qids):
    """A utility to check that we only have Qubits."""
    for qid in qids:
        if qid.dimension != 2:
            raise ValueError(f"Only qubits are supported, but {qid} has dimension {qid.dimension}")
A utility to check that we only have Qubits.
cirq-core/cirq/ops/projector.py