Quantum Mechanics forbids you from taking an unknown quantum state and making a perfect copy of it. Period. End of story. Don’t even think about it. Fuggedaboutit. Please. Just. Stop.
the no-cloning theorem states that it is impossible to create an independent and identical copy of an arbitrary unknown quantum state
source: Wikipedia
However, we are allowed to discover just enough about an unknown quantum state to make a reasonably-decent imperfect copy. The circuit above actually consolidates two distinct methods for doing this, both of which use the canonical SWAP Test to determine how close we get to recreating the original unknown state.
It is worth acknowledging that the circuit is intentionally not optimized. Rather, it is intended to showcase the methods with maximum clarity.
Entanglement
Neither method uses entanglement to recreate the unknown state, because entanglement does not create independent states.
Arbitrary Unknown State
One of my favorite ways to create arbitrary quantum states is to alternate Hadamard gates with rotations around the z…