def whichqubit(QuantumCircuit, i):
    """This function determines at which qubit we have to apply the 1-qubit-gate, basically reading which qubit is written at the ith row, second column in the QuantumCircuit.
    
    Input
    -----
        QuantumCircuit: np.array
                        The quantum circuit in the form of a numpy array
        i:              int
                        The row in quantum Circuit, where the second entry is written in the form q0, which is the wanted qubit
    Output
    -----
        wq:             int
                        number of the wanted qubit as an integer
    """
    wq = ""
    for c in QuantumCircuit[i][1]: #reading the integer in the entry of the form q0
        if c.isdigit():
            wq = wq + c
    return int(wq)