How Does the Transformation $|x \rangle | 0 \rangle \rightarrow | x \rangle | Hx \rangle$ Avoid Violating the No-Cloning Theorem?

This question relates to Nielsen & Chuang, Exercise 10.26, which says

Suppose $$H$$ is a parity check matrix. Explain how to compute the transformation $$|x \rangle | 0 \rangle \rightarrow | x \rangle | Hx \rangle$$ using a circuit composed entirely of controlled-NOTs.

It is still not clear to me how does this transformation work, but I have come across this answer that somewhat answers this question.

However, my main question is this:

In this transformation it looks like that we are copying $$|x\rangle$$. Of course, it is not copying in the strict sense but it has $$x$$ in the second register after the transformation. Can someone please explain why doesn't this result pose any threat to the no-cloning theorem?

In this context, $$x$$ represents a bit string, so the transformation denotes copying over a particular basis vector in the computational basis (i.e. $$|00..00\rangle, |00..01\rangle, ...|11...11\rangle$$). No-cloning theorem prohibits copying an arbitrary quantum state, but here we are talking about copying a state that is restricted to be a classical bit string. $$|x\rangle|0\rangle \rightarrow |x\rangle|x\rangle$$ is just like copying data from one classical hard drive to another.

However if $$|x\rangle$$ were an arbitrary quantum state, then this would indeed violate no-cloning theorem! Consider applying the circuit Nielsen and Chuang asked for to a superposition of two basis states. The circuit would transform

$$(|x\rangle+|y\rangle)|0\rangle \rightarrow |x\rangle|Hx\rangle+|y\rangle|Hy\rangle$$

However a hypothetical circuit violating no-cloning theorem would apply the transformation

$$(|x\rangle+|y\rangle)|0\rangle \rightarrow (|x\rangle+|y\rangle)H(|x\rangle+|y\rangle) = (|x\rangle+|y\rangle)(|Hx\rangle+|Hy\rangle)$$

Notice that whereas the possible circuit turned superposition into entanglement, the illegal circuit copies information without creating any entanglement.

Just to add, you can always copy basis states. What the no-cloning theorem forbids is copying of arbitrary superposition.

What is more, the circuit is created of CNOT gates only. Such gates work as fan-out. For computational basis states they prepare true copy (this is not forbidden as mentioned above) and for arbitrary state they produce states which are entangled, i.e. they are not independent. Hence, in both cases, no-cloning theorem is fulfilled.

You can find more on the theorem in this thread.

• You have to be careful though. If $H$ is an invertible matrix, then the first two sentences aren't quite correct. Copying $H|x\rangle$ is just as 'illegal' as copying $|x\rangle$. But 100% agreed that no-cloning doesn't forbit copying basis states, so I think that's the essence of the resolution. Apr 11 at 18:37
• @user34722: thanks, you are right. As any quantum gate is unitary, it is invertible and in the end we would be able to copy the state. I have just removed those sentences. Apr 12 at 6:15