1
$\begingroup$

I am in a study group learning about quantum computing using O'Reilly - Programming Quantum Computing. I'm a developer, not a physicist. :) I feel like my question is rudimentary but I can't seem to find an answer here or anywhere else.

I'm confused on the Swap test; why it works and why doesn't it affect the qubits being swapped. Not the physics behind why the measurements diverge or approach |1>, but rather why the condition qubit of the cswap operation is altered at all.

I understand the cswap operation swaps two qubits based on a condition qubit. You might say the condition qubit has an influence on the swapped qubits.

However, a Swap Test shows that the condition qubit itself will be changed based on how closely the target qubits are equal. How do the swapped qubits have any influence back on the condition qubit? And furthermore, during the swap test aren't we potentially swapping the qubits? Should we be swapping them back so that our test doesn't actually change the state of the target qubits?

$\endgroup$
1
  • 2
    $\begingroup$ This isn't an issue just for the swap test, but throughout the study of quantum algorithms. It's a mechanism called "phase kickback". With that specific term, you should find loads of material on this site! $\endgroup$
    – DaftWullie
    May 11 at 8:16
1
$\begingroup$

Deciding which qubit is a source and which is a target and changes depends on a basis. In a basis-independent sense, the qubits get entangled, and it affects both sides. In a swap test you apply Hadamard gate to the control qubit which can be interpreted as a change of basis, and subsequent CSWAP gate changes the control qubit

$\endgroup$
1
  • $\begingroup$ So, my hang-up may be from my traditional programming background. In "classic computers" an operation that has a condition, like an "if (someVar someCondition) then..." the evaluation of that condition should never alter someVar. But in quantum computing it seems that most any interaction with a qubit potentially has an effect. Is this generally correct? $\endgroup$ May 12 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.