2
$\begingroup$

I am reading this page of Qiskit's textbook. I noticed that it extends coin games to quantum computers by defining an $X$ gate to be a classical coin flip. However, I do not understand this. For example, a coin flip in the classical world can start in $\psi = \{ \left | 0 \right >, \left | 1 \right > \}$, and end in $\psi^\prime = \{ \left | 0 \right >, \left | 1 \right > \}$.

However, in the quantum case, we can still start with $\psi = \{ \left | 0 \right >, \left | 1 \right > \}$, but $X\psi$ only flips the state of the coin. For example, if $\psi = \left | 0 \right >$, then $\psi^\prime = \left | 1 \right >$.

The $X$ operator is not random, unless the coin is already in superposition ($\left | + \right >$, in specific). Is there a reason that this is allowed? Why can we assume that the coin will already be $\left | + \right >$?

$\endgroup$
3
  • $\begingroup$ It sounds like the author of that page mistakenly wrote "flip the coin" (which implies a random result) when they should have written "turn over the coin." $\endgroup$ Sep 28, 2022 at 13:05
  • $\begingroup$ I think that is due to the common description of the $X$ gate as a bit-flip gate. That's why I suggested the term "coin toss" for the random result generator in that case which is the $H$ gate. But I am not an english expert though. $\endgroup$
    – Ohad
    Sep 28, 2022 at 13:44
  • $\begingroup$ I see, this was only a semantics issue in that case. Thank you all. $\endgroup$
    – Loic Stoic
    Sep 28, 2022 at 15:43

2 Answers 2

2
$\begingroup$

$X$ gate is like a coin flip (= take a coin laying on a table. flip it from heads to tails or vice versa. no air time). $H$ gate is like a coin toss (= take a coin laying on a table and throw it up in the air).

$X|0\rangle = |1\rangle$ and $X|1\rangle = |0\rangle$. It works also for superposition input states - the $X$ gate flips their amplitudes: Let $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$, then $X|\psi\rangle = \beta|0\rangle + \alpha|1\rangle$. We are not assuming anything about the initial state $|\psi\rangle$, the $X$ gate (and any other unitary gate) treats every input state in the same way - in the case of the $X$ gate is flipping the state’s amplitudes.

The $H$ gate can be thought like a coin tossing - $H|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}$ and $H|1\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}}$ - I.e a quantum state which is in one of the computational basis state (= heads or tails) transforms to a quantum state with 50% chance to measure $|0\rangle$ and 50% chance to measue $|1\rangle$ (= a coin in the air). If the initial quantum state, before applying the $H$ gate, was a some superpostion state, let it be $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ - Then:

$$H|\psi\rangle = \alpha \left(\frac{|0\rangle + |1\rangle}{\sqrt{2}}\right) + \beta \left(\frac{|0\rangle - |1\rangle}{\sqrt{2}}\right) = \left(\frac{\alpha + \beta}{\sqrt{2}} \right)|0\rangle + \left(\frac{\alpha - \beta}{\sqrt{2}} \right)|1\rangle$$

And if one insists to find classical metaphores, then it can be thought of as an attempt to toss a coin while already in tha air. Again, quantum unitary gates don't care about the input states - their functionality is defined by their matrix operators, and they treat every input state in the same manner.

$\endgroup$
1
$\begingroup$

I think the whole point of the experiment is just to show that your opponent (the quantum computer) can win the problem with probability 1.

That is, applying the Hadamard gate to the computational basis state $|0>$ the coin flipping of the human player becomes irrelevant.

$\endgroup$
2
  • $\begingroup$ Hi, thank you for your answer. I understand that much, however I think that the idea of using an X gate when the state is not already Hadamarded doesn’t work. I don’t get why this does this not matter. What if we instead had a game where the non-quantum player (the human) went first— we wouldn’t be able to implement a coin flip with just X in that case. $\endgroup$
    – Loic Stoic
    Sep 28, 2022 at 4:36
  • $\begingroup$ You could play the opposite game: start with the state |+>, and use a Z to do the coin flip. The game is only an example, and I have the feeling you are complicating your life! Either that, or I am missing something in your question :D $\endgroup$ Sep 28, 2022 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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