# How to simulate a $CNOT$ only using a single qubit?

I am looking to do a $$CNOT$$ on itself, i.e., if the qubit is in $$|0\rangle$$ it stays in $$|0\rangle$$ and if it is in $$|1\rangle$$ it becomes $$|0\rangle$$. We are allowed to use $$H$$, $$X$$, $$Z$$, and $$CNOT$$ gates.

• $\left \{ |0\rangle \to |0\rangle, |1\rangle \to |0\rangle \right \}$ operation cannot be a unitary for a single qubit. You will need extra qubits or environment. The operation you want to do is standard a lowering operator $\sigma_- = |0\rangle \langle 1|$. Sep 23 at 0:17

Quantum operations have to be reversible and the operation you described is not reversible. Both 0 and 1 map to 0, so it is a many-to-one function and thus if you are just given 0 you have no methodology of deriving what input caused that.

However, you can do it using classical logic if your simulator or quantum computer supports using boolean functions.

measure q -> c;
if(c==1) x q;


Here you measure the qubit and store the value into a classical bit and if the value is a 1 then you flip the qubit to a zero.

Some simulators also support an instruction called "reset" that basically does this in a single step.

reset q;