# Identifying a matrix with the fundamental quantum logic gates [closed]

I have the following matrix

$$\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & \frac{1}{\sqrt{2}} & \frac{-i}{\sqrt{2}} & 0\\ 0 & \frac{-i}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0\\ 0 & 0 & 0 & 1\\ \end{bmatrix}$$ I want to understand the operation by this matrix in terms of the familiar quantum logic gates. More precisely, how can one write the above matrix in terms of the quantum logic gates?

• Are you restricting to any particular set of quantum logic gates? This actually is a gate that is included in some sets. Have you tried squaring the matrix? Related (up to some phase gates): quantumcomputing.stackexchange.com/a/2468/1837 – DaftWullie Apr 17 '19 at 9:15
• Thanks, @DaftWullie. I am not restricting to any specific gate. SWAP involves the unwanted 1/2 factor. Can one get rid of that? – Tobias Fritzn Apr 17 '19 at 9:31
• 1/2 factor? My point is that, apart from some factors of $e^{i\pi/4}$, your matrix is square root of swap. You can fix that easily with phase gates. – DaftWullie Apr 17 '19 at 9:34
• My matrix resembles to XX gate given here: en.wikipedia.org/wiki/Quantum_logic_gate, apart from the two $e^{i(\phi - \pi/2)}$. But not sure how to get rid of this. – Tobias Fritzn Apr 17 '19 at 10:26
• I'm voting to close this question as off-topic because it's a homework-type question showing insufficient effort. Please check our policy on homework and exercise questions. However, since it has already received a good answer, I believe this thread is worth preserving. In any case, please avoid deleting questions when others have put in the effort to answer. Instead, try to edit and improve them. – Sanchayan Dutta May 9 '19 at 17:45

This gate, which I'll denote as $$U$$ is essentially the square root of not gate, whose decomposition has already been discussed elsewhere. Hence, we only need the conversion:

Specifically, if we perform the corresponding matrix multiplications, we have $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & i \\ \end{array} \right)\cdot\left(\left( \begin{array}{cc} 1 & 0 \\ 0 & e^{-\frac{i \pi }{4}} \\ \end{array} \right)\otimes \left( \begin{array}{cc} 1 & 0 \\ 0 & e^{-\frac{i \pi }{4}} \\ \end{array} \right)\right)\cdot\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & \frac{e^{\frac{i \pi }{4}}}{\sqrt{2}} & \frac{e^{-\frac{i \pi }{4}}}{\sqrt{2}} & 0 \\ 0 & \frac{e^{-\frac{i \pi }{4}}}{\sqrt{2}} & \frac{e^{\frac{i \pi }{4}}}{\sqrt{2}} & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} \right)=\\ \left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & \frac{1}{\sqrt{2}} & -\frac{i}{\sqrt{2}} & 0 \\ 0 & -\frac{i}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 \\ 0 & 0 & 0 & 1 \\ \end{array} \right)$$ as required.

• @DraftWullie, it looks slightly different from my matrix. – Tobias Fritzn Apr 17 '19 at 11:08
• @TobiasFritzn how? what's different? – DaftWullie Apr 17 '19 at 11:37
• Hi, it seems the OP deleted the question soon after receiving an elaborate answer from you. I've undeleted it now. In case such a thing happens again (you can see your recently deleted answers from here, from the link in the bottom-left), do consider flagging for moderation intervention. Thanks! – Sanchayan Dutta May 9 '19 at 17:01
• @TobiasFritzn It's exactly the same matrix as the one in your question. – Sanchayan Dutta May 9 '19 at 17:42