# How to find eigenvalues and eigenvector for a quantum gate? [closed]

I need to know how can I find eigenvalues and eigenvectors for a quantum gate, for example $$X$$ gate.

• like you do for any other matrix?
– glS
Jan 20 '20 at 13:04

First you need eigenvalues; $$X=\begin{pmatrix} 0&1 \\ 1&0\end{pmatrix}$$ so you need to solve equation $$\begin{vmatrix}0-\lambda &1 \\ 1 &0-\lambda\end{vmatrix}=0$$ or $$\lambda^2-1=0$$ which gives eigenvalues $$\lambda_{1,2}=\pm 1$$ Since $$X$$ is Hermitian, eigenvalues are real. Now you can find eigenvectors; for example, for the first eigenvector $$|v\rangle=a|0\rangle+b|1\rangle$$ $$X\begin{pmatrix}a \\ b \end{pmatrix}=\lambda_1\begin{pmatrix}a \\ b \end{pmatrix}$$ $$\begin{cases} 0\cdot a +1\cdot b=a\\ 1\cdot a +0\cdot b=b \end{cases}$$

which gives $$a=b$$; after normalization, $$a=b=\frac{1}{\sqrt{2}}$$, and

$$|v\rangle=\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)=|+\rangle$$

I would like to add general case for single qubit gate. Let us assume that our gate is described by unitary matrix

$$U = \begin{pmatrix} u_{11} & u_{12} \\ u_{21} & u_{22} \end{pmatrix}$$

Eigenvalues are roots of so-called characteristic equation

$$|U-\lambda I|=0$$

In particular

$$\begin{vmatrix} u_{11} - \lambda & u_{12} \\ u_{21} & u_{22} -\lambda \end{vmatrix} = (u_{11}-\lambda)(u_{22}-\lambda) - u_{12}u_{21} = \lambda^2 - (u_{11}+u_{22})\lambda + u_{11}u_{22} - u_{12}u_{21} = 0$$

Solving this quadratic equation gives you eigenvalues.

Since matrix $$U$$ is unitary then $$|\lambda|=1$$. Additionally, if $$U$$ is Hermitian (i.e. $$u_{21} = u_{12}^\star$$) then $$\lambda \in \mathbb{R}$$ hence $$\lambda \in \{-1;1\}$$.

When you have eigenvalues, you can calculate eigenvectors by solving equation $$Ux =\lambda x$$. Vector $$x$$ should be normalized with its Euclidian norm, i.e. $$x := \frac{x}{|x|}$$. Obviously the normalized vector fulfil $$Ax=\lambda x$$ as well.

Appoach mentioned above is not difficult for single qubit gates. Howver, even in case of two qubit gates you have to deal with matrix 4x4 and thus characteristic equation is of fourth order. There are other methods how find eigenvalues based on matrix diagonalization.

But for practical purposes I would recommend using MatLab or its free version Octave. You can use function

 [V D] = eig(U);


where $$U$$ is matrix which eigenvectors and eigenvalues you are look for, $$V$$ is matrix containing all eigenvectors and $$D$$ is diagonal matrix having eigenvalues on its diagonal. Note that element $$d_{ii}$$ is connected to vector $$v_{i}$$.