In fact, many physical realizations of quantum computers can not perform arbitrary unitary operations, but can only perform the **standard set** of universal gates which consists of the **Hadamard, phase, controlled-NOT, and $\pi/8$ gates**.

## References

[1] Nielsen MA, Chuang I. Quantum computation and quantum information.

## Error evaluation

We use a simple formula to evaluate the error of the approximation of U using V,

$E(U,V)=\max_{|\psi\rangle}||(U-V)|\psi\rangle||$

here $ |\psi\rangle$ is a normalized vector. Its definition is interesting, obviously, the input state $|\psi\rangle$ does affect the result of error value.

## The standard set

As we said, the standard contains 4 quantum gates, **Hadamard, phase, controlled-NOT, and $\pi/8$ gates** can approximate arbitrary rotation gate.

### T had HTH gates

$T$ and $HTH$ gates can approximate arbitrary rotation gate, firstly, let’s take a look at their matrix forms, the Exercise 4.14 in QCQI is about the transformation of those two gates,

$T=\exp(i\pi/8) \left[\begin{array}{ll}{e^{-i\pi/8}} & {0} \\ {0} & {e^{i\pi/8}}\end{array}\right]=e^{i\pi/8}R_z(\pi/4),$

if we ignore the global phase $\exp(i\pi/8)$, $ T$ gate is actually a rotation gate aroung $z$ axis $R_z(\pi/4)$. Let us see the $HTH$ gate,

$$HTH=\frac{1}{2}\left[\begin{array}{ll}{1+e^{i\pi/4}} & {1-e^{i\pi/4}} \\ {1-e^{i\pi/4}} & {1+e^{i\pi/4}}\end{array}\right]=e^{i\pi/8}R_x(\pi/4),$$

in this example, the first thing that we can see is that the $ H$ gates can switch the roration axis from $X$ to $latex Z$, or from $Z$ to $ X$, which is also mentioned in Exercise 4.13 in QCQI.

### Rz and Rx gates

A important combination is $R_z(\pi/4)R_x(\pi/4)$,

$$\exp \left(-i \frac{\pi}{8} Z\right) \exp \left(-i \frac{\pi}{8} X\right) =\left[\cos \frac{\pi}{8} I-i \sin \frac{\pi}{8} Z\right]\left[\cos \frac{\pi}{8} I-i \sin \frac{\pi}{8} X\right] $$

$$=\cos ^{2} \frac{\pi}{8} I-i\left[\cos \frac{\pi}{8}(X+Z)+\sin \frac{\pi}{8} Y\right] \sin \frac{\pi}{8}$$

The detailed derivation is, note that the construction of $Y$ gate,

This is a rotation of Bloch sphere along $\vec{n}=(\cos\frac{\pi}{8}, \sin\frac{\pi}{8}, \cos\frac{\pi}{8})$, $\vec{n}$ is not a unit vector, its normalized vector $\hat{n}$, and the rotation angle is $latex \theta$, such that $\cos(\theta/2)=\cos^2(\pi/8)$. In fact, it is not so easy to understand this, but we can now use this conclusion, in one sentence, $ THTH$ gate is a rotation by $2\arccos(\cos^2\frac{\pi}{8})$ about axis $\vec{n}=(\cos\frac{\pi}{8}, \sin\frac{\pi}{8}, \cos\frac{\pi}{8})$.

Here we discuss how should we deal with the above rotation opeartor,

$\exp \left(-i \frac{\pi}{8} Z\right) \exp \left(-i \frac{\pi}{8} X\right)=\exp \left[-i \frac{\pi}{8} (Z+X)\right] $

$ =\cos(\pi/8)I-i\sin(\pi/8)(Z+X)$

Why? In math principle, it looks resonable, however, Pauli operators do not commute with each other, hence we cannot write is as $\cos(\pi/8)I-i\sin(\pi/8)(Z+X)$, instead, we need to decompose these two gates independently and product them, like we did in previous paragraphs.

### Repeat T and HTH

We define $R_{\hat{n}}(\theta)$ as $ THTH$ gate, where $latex \theta$ satisfies $ \cos(\theta/2)=\cos^2(\pi/8)$, and $R_{\hat{n}}(\alpha)$ is the target unitary operator we want to approximate about $ \hat{n}$ axis.

The main idea is repeating the $R_{\hat{n}}(\theta)$ for finite time. As we said before, $\theta$ is an irrational number, that’s why we can we can approximate and $ \alpha$ with $k$ times, the approximating rotation angle is $l(\theta_k-\theta_j)$, where

$$ \theta_k=k\theta\mod 2\pi$$,

it is same to $\theta_j$, and $l$ is an integer. we can prove that by using pigeonhole principle, $|\theta_k-\theta_j|$ can approximate to an small number $\delta>2\pi/N$, where $j,k \in \{1,2,\dots,N\}$. Because $|\theta_k-\theta_j|$ is small enough, so that we can obtain a sequence fills up $[0,2\pi]$ by timing an integer $l$.