# Transformation of 0 state to superposition of 0 and + state with only using single qubit gates

How to transform a qubit from state $$|0\rangle$$ to $$(|0\rangle+|+\rangle)/N$$ by only using an additional qubit, a controlled Hadamard gate, a Hadamard gate and a $$Y$$ or $$Z$$ gate? Sequence of the gates may be different.

• Are you allowed to make a measurement? May 10 at 12:42

I believe the following will work... How did I come up with this? I realised that the state you were after, $$|0\rangle+|+\rangle$$ is a +1 eigenstate of the Hadamard gate. There's a standard circuit for how you project onto the +1 eigenstate of an operator if you can implement the controlled-version of that operator. That's the first three gates in the circuit. At that point, you'd typically measure the top qubit, and if you get the 0 answer, the bottom qubit is in the state you want.

The rest of the circuit is dedicated to saying "if we got the 1 measurement result, how would we convert it into the result we wanted?". The answer is that you'd apply Pauli $$Y$$. However, if we're not allowed measurements, we do this with controlled-$$Y$$ controlled off the top qubit and targeting the bottom one. With the limited set of gates on offer, I used the last 4 gates of the circuit to implement controlled-$$iY$$. This is the same as controlled-$$Y$$ with an $$S$$ gate on the control qubit. But that $$S$$ doesn't make any difference to the output of the bottom qubit.

• Just to understand, the top circuit works only if the top qubit is measured to be 0 right? There is a measurement missing. May 10 at 16:15
• How do you build a C-iY with those gates? May 10 at 16:18
• The topmost circuit results in the top qubit being $|0\rangle + |-\rangle$ normalized and the bottom qubit being $|0\rangle + |+\rangle$ normalized with no entanglement between the two, so any measurement on the top qubit does not matter. Given the ability to use each gate more than once this functions independently of being able to pre-measure. May 11 at 4:24
• @Mauricio As another commenter said, you don't need to do any measurement for the big circuit. The whole point is to replace measurement followed by correction with a controlled-operation so that measurement is unnecessary (since it wasn't in the allowed sequence of gates). May 11 at 6:32
• @Mauricio Look at the sequence of the last 4 gates, c-H, Z, c-H, Z. If the control qubit is 0, the c-H do nothing, hence the action on your target is ZZ=I. If the control qubit is 1, the net sequence is $ZHZH=ZX=iY$. Hence, you have controlled-$iY$. May 11 at 6:33

As given, that is a rather unusual and misleading way to describe a quantum state since $$|0\rangle$$ and $$|+\rangle$$ are not orthogonal. As a consequence the coefficients of the two, when multiplied by their respective complex conjugates, won't sum to 1 and won't represent the probability of that result upon measurement in the relevant basis. However, provided $$N = \frac{1}{\sqrt{2 + \sqrt{2}}}$$, it can still represent an actual quantum state with norm 1, given as $$\frac{\sqrt{2 + \sqrt{2}}}{2}|0\rangle + \frac{1}{\sqrt{4 + 2\sqrt{2}}}|1\rangle$$ in the computational basis. It isn't possible to create this state using one of just those gates in any order. It would traditionally be created with a gate corresponding to a precisely angled rotation around the Bloch Sphere y-axis (Ry gate in Qiskit) which circles around real superpositions of the two computational basis states.

From the available gates in the problem description, this sounds more like the desire is to create the density matrix $$\frac{1}{2}(|0\rangle\langle0| + |+\rangle\langle+|)$$, representing an equal probability classical ensemble of the two states, when the additional qubit is traced out. But, in this case, all it would take is a Hadamard on the additional qubit followed by the additional qubit controlling a Hadamard on the main qubit, the $$Y$$ or $$Z$$ will not be necessary. Intuitively, this makes it so through entanglement that if one measures the other qubit on the computational basis and gets 0, it would be known the main qubit is the $$|0\rangle$$ state and if one gets 1 the main qubit is in the $$|+\rangle$$ state.