TransWikia.com

Mistake in using dirac notation when applying $X$ gate to vector

Quantum Computing Asked by jmacuna on January 17, 2021

The X gate is given by $big(begin{smallmatrix}
0 & 1
1 & 0
end{smallmatrix}big)$
in the computational basis. In the Hadamard basis, the gate is $X_H = big(begin{smallmatrix}
1 & 0
0 & -1
end{smallmatrix}big) = |+ rangle langle +| – |-rangle langle-|$
. When I apply the gate to the Hadamard basis vectors, the vectors should flip, and they do when I use matrix notation but not when I’m using dirac notation. I know I’m making a mistake somewhere.

$X_H |+rangle = (|+ rangle langle +| – |-rangle langle-|)|+rangle = |+ rangle langle +|+rangle – |-rangle langle-|+rangle = |+rangle(1) – |-rangle(0) = |+rangle$ and
$X_H |-rangle = (|+ rangle langle +| – |-rangle langle-|)|-rangle = |+ rangle langle +|-rangle – |-rangle langle-|-rangle = |+rangle (0) -|-rangle(1) = -|-rangle$

Meanwhile, in matrix notation,

$X_H|+rangle = big(begin{smallmatrix}
1 & 0
0 & -1
end{smallmatrix}big) frac{1}{sqrt{2}}big( begin{smallmatrix}
1
1
end{smallmatrix}big) = frac{1}{sqrt{2}}big( begin{smallmatrix}
1
-1
end{smallmatrix}big) = |-rangle
$

$X_H|-rangle = big(begin{smallmatrix}
1 & 0
0 & -1
end{smallmatrix}big) frac{1}{sqrt{2}}big( begin{smallmatrix}
1
-1
end{smallmatrix}big) = frac{1}{sqrt{2}}big( begin{smallmatrix}
1
1
end{smallmatrix}big) = |+rangle
$

One Answer

The basis states should not flip, as these two basis states are the eigenstates of the $X$ gate. The $X$ gate flips the computational basis states, the $Z = begin{bmatrix} 1 & 0 0 & -1 end{bmatrix}$ gate flips the Hadamard basis states.

Expressing everything in the computational basis

In the computational basis, we have $X = begin{bmatrix}0 & 1 1 & 0end{bmatrix}$. Thus the states (expressed in the computational basis) $|+rangle = begin{bmatrix}1 1end{bmatrix}$ and $|-rangle = begin{bmatrix}1 -1end{bmatrix}$ are the $+1$ and $-1$ eigenstates respectively, as you can readily check.

Expressing everything in the Hadamard basis

If you express everything in the Hadamard basis, the $X$ gate becomes $X_{H} = begin{bmatrix}1 & 0 0 & -1end{bmatrix}$.

But, the $|+rangle$ and $|-rangle$ states should now also be expressed in this basis. That is, $|+rangle_{H} = begin{bmatrix}1 0end{bmatrix}$ and $|-rangle_{H} = begin{bmatrix}0 1end{bmatrix}$. It's now obvious that these states are indeed the $+1$ and $-1$ eigenstates of $X$, expressed in whatever basis.

To summarize your notation

So you dirac notation is correct, and in your matrix notation you expressed the $X$ operator in the Hadamard basis, but the states in the computational basis.

But wait, then what are these states if not the $|+rangle$ and $|-rangle$ states?

So what are the states $begin{bmatrix}1 1end{bmatrix}_{H}$ and $begin{bmatrix}1 -1end{bmatrix}_{H}$, i.e. these states in the Hadamard basis? As you showed with your matrix notation, they are those states that are flipped under operation of the $X$ gate - they are the computational basis states/eigenstates of the $Z$ operator!

Of course, you can write this out mathematically as well:

$$ begin{bmatrix}1 1end{bmatrix}_{H} = begin{bmatrix}1 0end{bmatrix}_{H} + begin{bmatrix}0 1end{bmatrix}_{H} = begin{bmatrix}1 1end{bmatrix} + begin{bmatrix}1 -1end{bmatrix} = begin{bmatrix}1 0end{bmatrix} $$ As you can see, I've been very sloppy with the normalization factor - the above equation is a factor of $2$ off.

Correct answer by JSdJ on January 17, 2021

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