I currently have 2 unitary matrices that I want to approximate to a good precision with the fewer quantum gates possible.
In my case the two matrices are:
- The square root of NOT gate (up to a global phase) $$G = \frac{-1}{\sqrt{2}}\begin{pmatrix} i & 1 \\ 1 & i \end{pmatrix} = e^{-\frac{3}{4}\pi} \sqrt{X}$$
- $$W = \begin{pmatrix} 1&0&0&0\\ 0&\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0\\ 0&\frac{1}{\sqrt{2}}&\frac{-1}{\sqrt{2}}&0\\ 0&0&0&1 \\ \end{pmatrix}$$
My question is the following:
How can I approximate these specific matrices with the fewer quantum gates possible and a good precision?
What I want to have an can afford to have it:
- I can afford to use several days/weeks of CPU time and a lot of RAM.
- I can afford to spend 1 or 2 human days searching for mathematical tricks (in last resort, that is why I ask here first). This time does not include the time I would need to implement the hypothetical algorithms used for the first point.
- I want the decomposition to be nearly exact. I don't have a target precision at the moment, but the 2 gates above are used extensively by my circuit and I don't want errors to accumulate too much.
- I want the decomposition to use the fewest quantum gates possible. This point is secondary for the moment.
- A good method would let me choose the trade-off I want between the number of quantum gates and the precision of the approximation. If this is not possible, an accuracy of at least $10^{-6}$ (in terms of trace norm) is probably (as said before, I do not have estimates so I am not sure of this threshold) required.
- The gate set is: $$ \left\{ H, X, Y, Z, R_\phi, S, T, R_x, R_y, R_z, \text{CX}, \text{SWAP}, \text{iSWAP}, \sqrt{\text{SWAP}} \right\} $$ with $R_\phi, \text{SWAP}, \sqrt{\text{SWAP}}$ as described in Wikipédia, $R_A$ the rotation with respect to the axe $A$ ($A$ is either $X$, $Y$ or $Z$) and $$\text{iSWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & i & 0 \\ 0 & i & 0 & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix}$$.
The methods I know about:
- The Solovay-Kitaev algorithm. I have an implementation of this algorithm and already tested it on several unitary matrices. The algorithm generates sequences that are quite long and the trade-off [number of quantum gates] VS [precision of the approximation] is not enough parametrisable. Nevertheless, I will execute the algorithm on these gates and edit this question with the results I obtained.
- Two papers on 1-qubit gate approximation and n-qubit gate approximation. I also need to test these algorithms.
EDIT: edited the question to make "square root of not" more apparent.