TransWikia.com

Why 2 $H$ gates in series create a probability of 100% for one value of the qubit and 0% of the second value of the qubit?

Quantum Computing Asked on December 22, 2020

Why 2 $H$ gates in series create a probability of 100% for one value of the qubit and 0% of the second value of the qubit since an $H$ gate acts like a superposition generator?

3 Answers

The reason for this is because the inverse of Hadamard gate is itself. That is, giving that

$$ H = dfrac{1}{sqrt{2}} begin{pmatrix} 1& 1 1 & -1 end{pmatrix}$$

then

$$ H^{-1} = dfrac{1}{sqrt{2}} begin{pmatrix} 1& 1 1 & -1 end{pmatrix} $$

so therefore, $$HH|psirangle = H H^{-1} |psi rangle = I |psi rangle = |psirangle textrm{where $I$ is the Identity operator.}$$

Now when $|psi rangle = |0 rangle$, which is the starting state of your quantum circuit, then applying two consecutive Hadamard gates is the same as doing nothing... hence the qubit stayed at the state $|0rangle$. Thus giving you a 100% probability is it the state $|0rangle$.


To see this in the geometric sense, applying two consecutive Hadamard gates to the qubit in the state $|0rangle$ is like doing the following rotations:

enter image description here

The first Hadamard gate rotate the qubit in the red trajectory to the state $|+rangle = dfrac{|0 rangle + |1 rangle}{sqrt{2}} $. Then the second Hadamard gate rotate the qubit in the blue trajectory, back to the state $|0rangle$ again.

Answered by KAJ226 on December 22, 2020

Simply speaking, $H^2 = HH = I$ which is identity (you can verify this by direct matrix multiplication). As a result, such operator does not change anything in a quantum state.

Answered by Martin Vesely on December 22, 2020

The answers above noting that $H^2=I$ neatly capture this. If you want an alternative way of seeing this, you can look at what $H$ does to each of the computational basis states if applied twice. (Since any state will be a superposition of the basis states, understanding how the operator acts on each basis state will tell you what it does to a general state.)

  • When $H$ is applied to $|0 rangle equiv begin{bmatrix}1end{bmatrix}$, matrix multiplication means you can read off the first column of $H$ to see what the coefficients of $|0 rangle$ are in the standard basis after applying $H$ to it. Specifically, $H$ takes $|0 rangle$ to $frac{1}{sqrt{2}}(|0rangle + |1rangle)$.
  • When $H$ is applied to $|1 rangle equiv begin{bmatrix}01end{bmatrix}$, matrix multiplication means you can read off the second column of $H$ to see what the coefficients of $|1 rangle$ are in the standard basis after applying $H$ to it. Specifically, $H$ takes $|1 rangle$ to $frac{1}{sqrt{2}}(|0rangle - |1rangle)$.

To apply $H$ to each of the computational basis states a second time, we can just re-use the results from above: $$HH |0 rangle = Hfrac{1}{sqrt{2}}(|0rangle + |1rangle) = frac{1}{2}((|0rangle + |1rangle)+(|0rangle - |1rangle)) =frac{1}{2}(2|0rangle)=|0rangle,$$ $$HH |1 rangle = Hfrac{1}{sqrt{2}}(|0rangle - |1rangle) = frac{1}{2}((|0rangle + |1rangle)-(|0rangle - |1rangle)) =frac{1}{2}(2|1rangle)=|1rangle.$$ Since applying $H$ twice to both computational basis states results in no change, applying $H$ to any state results in no change, i.e., $H^2=I$.

Answered by nosuchthingasmagic on December 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP