While researching to implement Shor's algorithm, I came across the following curcuit diagram (diagram 1).
And while researching for how to implement the U operator, I came across the following circuit diagram (diagram 2).
The circuit in diagram 2 gives 'mod' outputs for $7^x\mod 15$ as follows: $$\ |1\rangle \text{ gives } |7\rangle$$ $$\ |7\rangle \text{ gives } |4\rangle$$ $$\ |4\rangle \text{ gives } |13\rangle$$ $$\ |13\rangle \text{ gives } |1\rangle$$ and it repeats after $4$ times with the period being $4$.
So here're my questions:
- is the circuit in the diagram 2, the 'U' operator from diagram 1?
- if yes, does that circuit need to be repeated those many times for every $Ua^k$ operator?
- if yes, how to modify this circuit so it can be controlled by the superpositioned qubits from the circuit of diagram 1?
Thanks in advance.

