# Implementing a controlled sum operation

I want to implement a controlled operation that involves the following: we have the following qubits: $$|x_0\rangle,|x_1\rangle,|0\rangle,|1\rangle,|z_0\rangle,|z_1\rangle$$. I want to add the first four qubits as $$|x_0x_1\rangle$$ and $$|01\rangle$$ where each $$x_i\in\{0,1\}$$ conditioned on the $$|z_1\rangle$$ being $$0$$. If the control is $$1$$ then do not perform the adder mod operation. So the circuit for this that I constructed is given in the figure:

Is this circuit correct?

Edit: Just to elaborate what this circuit does. It takes $$3$$ non-negative integer inputs $$x=|x_0x_1\rangle$$, $$1=|01\rangle$$, $$z=|z_0z_1\rangle$$ and adds the first two integers that are stored in the register $$|x_0x_1\rangle$$ and $$|10\rangle$$. The third integer $$|z\rangle$$ gives a remainder of $$2$$ when divided by $$4$$, but this can be thought of as the least significant bit being equal to $$0$$. Is the problem statement and circuit construction matching?

• What does $z_0$ do? May 16 '19 at 19:08
• $z_0$ is not required for this computation but it will he used for further operation. at this moment it does not play a part May 16 '19 at 19:11
• @Upstart I'm curious what the larger project you are working on is. Mar 23 '20 at 18:14

The second from the top wire should probably be marked $$|x_1 \rangle$$ instead of $$|x_0 \rangle$$ (right now you have two $$|x_0 \rangle$$s). Other than that, the circuit looks correct for the described task.
• yes that is $|x_1\rangle$ May 16 '19 at 20:08