# Can a Controlled-Swap gate control itself in a Quantum Computer?

Let there be a system of three qubits, $$a,b,c,d$$ where $$d$$ is an ancilla qubit. We can add more ancilla if required. The operation I want to implement is as follows:

"If $$a$$ and $$b$$ are both in the '$$1$$' state, then swap qubits $$b$$ and $$c$$."

Obviously this is not a unitary transformation but it might be possible with the use of ancilla qubits. I got a similar self-controlling circuit to work with Toffoli gates, but the double-control SWAP gate eludes me. My advisor thinks it might be impossible, but neither of us has proven that.

Basically, does anyone have any idea how this operation might be implemented in a quantum circuit using one or more ancilla?

• Why is this not a unitary gate?? -- Also, why would you call this a "double-control swap"? Wouldn't the latter swap c and d, given a=b=1? Sep 20, 2019 at 15:09
• I call it a double control because it requires two different control qubits a and b. Also, the trick is that it swaps b and c, not c and d. This is a sort of self-control. As to why that isn't unitary, we'll imagine it with just the first three qubits and no ancilla. Then 000 is mapped to 000, 001 to 001, 010 to 010, 011 to 011, 100 to 100, 101 to 101, 111 to 111 but 110 is mapped to 101. It's no longer bijective. Sep 20, 2019 at 16:11
• You're right. Then you can't do it coherently (that is, as a linear map on the Hilbert space). Sep 20, 2019 at 16:49

For example, you can add a fourth qubit which is initially always in the $$|0\rangle$$ state, and modify the gate to also apply $$X$$ to the fourth qubit when $$a=b=1$$. This avoids the problem of having both $$|101\rangle$$ and $$|110\rangle$$ going to the same output.