def regtuple_to_numeric(items, qregs):
sizes = [qr.size for qr in qregs.values()]<EOL>reg_idx = np.cumsum([<NUM_LIT:0>]+sizes)<EOL>regint = {}<EOL>for ind, qreg in enumerate(qregs.values()):<EOL><INDENT>regint[qreg] = ind<EOL><DEDENT>out = np.zeros(len(items), dtype=np.int32)<EOL>for idx, val in enumerate(items):<EOL><INDENT>out[idx] = reg_idx[regint[val[<NUM_LIT:0>]]]+val[<NUM_LIT:1>]<EOL><DEDENT>return out<EOL>
Takes (QuantumRegister, int) tuples and converts
    them into an integer array.

    Args:
        items (list): List of tuples of (QuantumRegister, int)
                      to convert.
        qregs (dict): List of )QuantumRegister, int) tuples.
    Returns:
        ndarray: Array of integers.