def _generate_op_qubits(args: list[list[ops.Qid]], lineno: int) -> list[list[ops.Qid]]:
    """Generates the Cirq qubits for an operation from the OpenQASM qregs.

    OpenQASM gates can be applied on single qubits and qubit registers.
    We represent single qubits as registers of size 1.
    Based on the OpenQASM spec (https://arxiv.org/abs/1707.03429),
    single qubit arguments can be mixed with qubit registers.
    Given quantum registers of length reg_size and single qubits are both
    used as arguments, we generate reg_size GateOperations via iterating
    through each qubit of the registers 0 to n-1 and use the same one
    qubit from the "single-qubit registers" for each operation."""
    reg_sizes = np.unique([len(reg) for reg in args])
    if len(reg_sizes) > 2 or (len(reg_sizes) > 1 and reg_sizes[0] != 1):
        raise QasmException(
            f"Non matching quantum registers of length {reg_sizes} at line {lineno}"
        )
    op_qubits_gen = functools.reduce(
        cast(Callable[[list['cirq.Qid'], list['cirq.Qid']], list['cirq.Qid']], np.broadcast), args
    )
    op_qubits = [[q] if isinstance(q, ops.Qid) else q for q in op_qubits_gen]
    if any(len(set(q)) < len(q) for q in op_qubits):
        raise QasmException(f"Overlapping qubits in arguments at line {lineno}")
    return op_qubits
Generates the Cirq qubits for an operation from the OpenQASM qregs.

    OpenQASM gates can be applied on single qubits and qubit registers.
    We represent single qubits as registers of size 1.
    Based on the OpenQASM spec (https://arxiv.org/abs/1707.03429),
    single qubit arguments can be mixed with qubit registers.
    Given quantum registers of length reg_size and single qubits are both
    used as arguments, we generate reg_size GateOperations via iterating
    through each qubit of the registers 0 to n-1 and use the same one
    qubit from the "single-qubit registers" for each operation.
cirq-core/cirq/contrib/qasm_import/_parser.py