def evolveQFTState(qc, reg_a, reg_b, n, pie):
    """
    Evolves the state |F(ψ(reg_a))> to |F(ψ(reg_a-reg_b))> using the quantum 
    Fourier transform conditioned on the qubits of the reg_b.
    Apply repeated phase rotations with parameters being pi divided by 
    increasing powers of two.
    """
    l = len(reg_b)
    for i in range(0, n + 1):
        if n - i > l - 1:
            pass
        else:
            qc.cu1(-1 * pie / float(2 ** i), reg_b[n - i], reg_a[n])
