# How to check if 2 quantum bits are orthogonal?

How would you check if 2 qubits are orthogonal with respect to each other?

I need to know this to solve this problem:

You are given $2$ quantum bits:\begin{align} |u_1\rangle &= \cos\left(\frac{x}{2}\right) |0\rangle + \sin\left(\frac{x}{2}\right)e^{in} |1\rangle \tag{1} \\[2.5px] |u_2\rangle &= \cos\left(\frac{y}{2}\right) |0\rangle + \sin\left(\frac{y}{2}\right)e^{im} |1\rangle \tag{2} \end{align}where $m-n = \pi$ and $x+y=\pi$.

• Welcome to quantum computing SE! When you say "You are given 2 quantum bits", do you mean that you've been shown 2 states (as you've written) and you want to do a calculation, or do you mean that you've got 2 physical qubits that you need to perform a measurement (or somesuch) on to (try to) see if they're orthogonal? – Mithrandir24601 Jun 6 '18 at 19:36
• Thanks for the reply. The original version of this particular problem says "Check if 2 qubits are orthogonal: |u1> = ....". – Archil Zhvania Jun 6 '18 at 19:39
• Hmm, OK, I'll assume it means 'do a maths calculation' then, thanks! – Mithrandir24601 Jun 6 '18 at 20:02
• No, I want to know what kind of math calculation I have to do. – Archil Zhvania Jun 6 '18 at 20:04

Keep in mind that $|0\rangle$ and $|1\rangle$ are orthonormal basis vectors of a two-dimensional complex vector space (over the field of complex numbers). To check whether $|u_1\rangle$ and $|u_2\rangle$ are orthogonal you'll have to check whether the standard inner product $\langle u_1|u_2\rangle$ is $0$. Here $\langle u_1|$ refers to the bra vector corresponding to the ket vector $|u_1\rangle$. In matrix notation that would simply mean that $\langle u_1|$ is the complex conjugate transpose a.k.a Hermitian conjugate of $|u_1\rangle$.

$|u_1\rangle = \cos(\frac{x}{2}) \begin{bmatrix} 1 \\ 0 \end{bmatrix} + (\sin(\frac{x}{2}))e^{in} \begin{bmatrix} 0 \\ 1 \end{bmatrix}$

and

$|u_2\rangle = \cos(\frac{y}{2}) \begin{bmatrix} 1 \\ 0 \end{bmatrix} + (\sin(\frac{y}{2}))e^{im} \begin{bmatrix} 0 \\ 1 \end{bmatrix}$

Now, you'll find $\langle u_1|$ to be:

$\cos(\frac{x}{2}) \begin{bmatrix} 1 & 0 \end{bmatrix} + (\sin(\frac{x}{2}))e^{-in} \begin{bmatrix} 0 & 1 \end{bmatrix}$

Now, simply carry out the multiplication of the matrices $\langle u_1|$ and $|u_2\rangle$. If it turns out to be $0$, they're orthogonal. Or else they're not orthogonal.

The answers given so far assume that classical descriptions of the two qubits' states are given (e.g. x and y are provided in the problem's statement). Interestingly, even if the two states are unknown to you, the overlap of the two qubits' states can be evaluated with a simple quantum circuit, provided you have access to pairs of qubits in these states. The circuit is known as a SWAP test, and can be found in Fig. 1 of this reference 1, where apparently it was first proposed.

1 Buhrman et al., "Quantum fingerprinting". https://arxiv.org/abs/quant-ph/0102001

Instead of doing matrix calculation you can also map those qubits to the Bloch sphere. A Bloch sphere is a unit 2-sphere, with antipodal points corresponding to a pair of mutually orthogonal state vectors.

So if you can show that the 2 points are antipodal on a Bloch sphere, then you have proven that they are orthogonal.

The nice thing is that your qubits are already expressed in a way that can easily be mapped on the bloch sphere (x, y, n and m correspond to the angles on the Bloch sphere).

So giving the angles it is easy to determine if they are antipodal as in that case the corresponding angles must differ with $\pi + n.2\pi$ where n is a positive or negative natural number (note that in case $\theta =0 + n\pi$ is a special case as in that case we should ignore angle $\psi$).

In the question it is already stated that the angles m and n differ with $\pi$ so we only need to look at the angles x and y and so we can conclude that only under the following condition will the above 2 qubits be orthogonal

• $y-x = { \pi + n (2 \pi)}$ where $n$ is a positive or negative natural number [1]

As $x+y= \pi$ (see question) and [1] : then only the following x and y combinations will give orthogonal qubits.

• $2y = \pi + \pi + n (2 \pi)$ which can be simplified as $y = n\pi$ where n is a positive or negative natural number and in that case $x=\pi - n\pi$ (e.g. when $y=0$ en $x=\pi$ we get 2 orthogonal qubits).

In order to check if two qubits are orthogonal, you should check that the inner product between them equals zero. This can be written like $\langle u_1|u_2\rangle=0$.

Knowing that $\langle 0|0\rangle=1$, $\langle 0|1\rangle=0$, $\langle 1|0\rangle=0$ and $\langle 1|1\rangle=1$ it should be easy to solve the problem by yourself.

• Thanks for the reply. I will appreciate if you show me how you got this part: "⟨0|0⟩=1, ⟨0|1⟩=0, ⟨1|0⟩=0 and ⟨1|1⟩=1". I tried multiplying the vector (cos(x/2), sin(x/2)*e^(in)) by the vector (cos(y/2), sin(y/2)*e^(im)). Was it the correct way to go? – Archil Zhvania Jun 6 '18 at 19:36
• As $|0\rangle = \begin{pmatrix}1 \\ 0 \end{pmatrix}$ and $|1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$, then you can check the relationships by the standard inner product $\langle x|y\rangle=\sum_i x_i^* y_i$, where $*$ means complex conjugate. – Josu Etxezarreta Martinez Jun 6 '18 at 19:41