# 12 From Quantum Physics to a Quantum Computer

In the previous chapter, we have learned about the fundamentals of quantum physics. We now relate this to quantum computers.

So far we have seen solutions of the time-independent Schrödinger equation \(\psi_k(x)= \sqrt{2} \sin((k+1) \pi x)\) and \(E_k=\frac{(k+1)^2\pi^2}{2}\). Note that we still assume \(\hbar = 1\) and \(m=1\).

We can now combine physics and quantum computer science by setting

\[ \begin{aligned} \ket{0} &:= \psi_0\\ \ket{1} &:= \psi_1\\ \dots \end{aligned} \]

For one qubit, we just look at \(\psi_0\) and \(\psi_1\) and ignore all other wave functions. Note that this can lead to errors, since those other wave functions still exists and interact with our system, even though they might have a very small probability.

To fully construct our one qubit quantum computer, we need to be able to perform three basic operations:

- We need to initialize our qubit with \(\ket{0}\). This is also called cooling.
- We need to be able to apply a unitary on the qubit.
- We need to be able to measure the qubit.

We look into how to construct a unitary on our particle. The cooling and measuring operations are out of scope od this chapter. We know that the time evolution of our quantum computer is \(\ket{0} \mapsto e^{-i \frac{\pi^2}{2}t} \ket{0}\) and \(\ket{1} \mapsto e^{-i 2\pi^2 t} \ket{1}\).

This can be seen as a unitary \(U_t\), which is depending on \(t\) written as the matrix:

\[ U_t=\begin{pmatrix} e^{-i \frac{\pi^2}{2}t} & 0\\ 0 & e^{-i 2\pi^2 t}\end{pmatrix} \]

Using \(t= \frac{6}{\pi}\), we get the unitary \[ U_{\frac{6}{\pi}}=\begin{pmatrix} -1 & 0\\ 0 & 1 \end{pmatrix} \] which is equal to the unitary \(-Z\). This means that the unitary \(-Z\) is applied every \(\frac{6}{\pi}\) steps “automatically”. The factor \(-1\) does not make a physical difference as it is a global phase factor, so the \(-Z\) is physically equal to the \(Z\) gate.

But how do we get new unitaries which are not \(Z\)? Since \(U_t\) is dependent on the evolution of \(\psi\), which is dependent of \(H\), which is dependent of the potential \(V(x)\), we can change the potential \(V(x)\) to get a different \(U_t\).

The problem is that when changing the potential \(V(x)\), we need to solve the differential equation again. Luckily, there is a trick for that which avoids thinking about wave functions to much: If we have wave functions \(\ket{k}\) with \(k\in\{1,\dots,N\}\) and \(\|\ket{k}\| = 1\) and also \(\braket{k|l}=0\) for \(k\neq l\) so \(\ket{k}\) and \(\ket{l}\) are orthogonal to each other, we can rewrite \(H\) as a linear operator on the wave functions written as \(\operatorname{span}\{\ket{k}: k = 1\dots N\}\), therefore we can write \(H\) as a matrix: \[ H = \begin{pmatrix} E_1 & 0 & 0\\ 0 & E_2 & 0\\ 0 & 0 & \ddots \end{pmatrix} = \begin{pmatrix} \frac{\pi^2}{2} & 0 & 0\\ 0 & 2 \pi^2 & 0\\ 0 & 0 & \ddots \end{pmatrix} \]

For this representation of \(H\), we immediately get \(H \ket{0} = \frac{\pi^2}{2}\), \(H \ket{1} = 2 \pi^2\) and so on, so nothing has changed except that \(H\) is represented more nicely.

We can now use a helpful theorem to get a solution for the differential equation.

We use this theorem for our one qubit computer. The goal is to change the potential by some \(\delta V\) and from this get a different \(U_t\).

We try this by changing the potential to \(\delta V = \frac{9\pi^2}{16} (\frac{1}{2}-x)\cdot 1000\) for \(x \in [0,1]\) and \(\delta V = 0\) for \(x \notin [0,1]\).

We rewrite \(\delta V\) as a matrix. To do so, we try to find a matrix in the base \(\ket{0}, \ket{1}\). If \(\delta V\ket{0}=a\ket{0}+b\ket{1}\) and \(\delta V\ket{1}=c\ket{0}+d\ket{1}\), then \[ \delta V = \begin{pmatrix} a & c \\ b & d\end{pmatrix} \] Since \(\ket{0}\) and \(\ket{1}\) are orthonormal, we know that \(\braket{0|\delta V|0} = \braket{0|a|0} + \braket{0|b|1} = a + 0 = a\). We get \(b,c\) and \(d\) similar and from this the following matrix: \[ \delta V = \begin{pmatrix} \braket{0|\delta V|0} & \braket{0|\delta V|1}\\ \braket{1|\delta V|0} & \braket{1|\delta V|1} \end{pmatrix} \]

We calculate each of the entries of the matrix separately:

\[ \begin{aligned} \braket{0|\delta V|0} =& \int^1_0 \sqrt{2} \sin(\pi x) \cdot \delta V(x) \cdot \sqrt{2} \sin(\pi x) dx = 0\\ \braket{1|\delta V|1} =& \int^1_0 \sqrt{2} \sin(2\pi x) \cdot \delta V(x) \cdot \sqrt{2} \sin(2\pi x) dx = 0\\ \braket{1|\delta V|0} =& \int^1_0 \sqrt{2} \sin(2\pi x) \cdot \delta V(x) \cdot \sqrt{2} \sin(\pi x) dx = 1000 \\ \braket{0|\delta V|1} =& \int^1_0 \sqrt{2} \sin(\pi x) \cdot \delta V(x) \cdot \sqrt{2} \sin(2\pi x) dx = 1000 \\ \end{aligned} \]

From this we get \(\delta V\) written as a matrix with readable numbers: \[ \delta V = \begin{pmatrix} 0 & 1000 \\ 1000 & 0 \end{pmatrix} \]

We can now add this matrix to the Hamiltonian \(H\) to get the Hamiltonian \(H'\) which is the Hamiltonian under the changed potential by calculating \[ H' = H + \delta V = \begin{pmatrix} \frac{\pi^2}{2} & 1000 \\ 1000 & 2\pi^2 \end{pmatrix} \]

We now need to solve Schrodinger equation with this new \(H'\).

If we would solve the Schrodinger equation with \(\delta V\) as a Hamiltonian using Theorem 12.1, we would get the unitary \(U_t' = e^{-i \delta V t}\). After \(t=\frac{\pi}{2000}\) this would be the unitary \(\begin{pmatrix} 0 & -i \\ -i & 0\end{pmatrix} = -i X\), essentially an \(X\) gate.

If we now apply \(H' = H + \delta V\) as a Hamiltonian, we would get \(U_t' = e^{-i H' t}\) and this is \[ U_t' = \begin{pmatrix} e^{-i \frac{\pi^2}{2} t} & e^{-i 1000 t}\\ e^{-i 1000 t} & e^{-i 2\pi^2 t}\end{pmatrix} \] so approximately the unitary \(\begin{pmatrix} 0 & -i \\ -i & 0\end{pmatrix} = -i X\) up to about \(2\%\) error.