9

I would like to simulate a quantum algorithm where one of the steps is "Square root of Swap gate" between 2 qubits.

How can I implement this step using the IBM composer?

Sanchayan Dutta
  • 18,015
  • 8
  • 50
  • 112
JanVdA
  • 1,158
  • 1
  • 8
  • 17

3 Answers3

12

Here is a SQRT(SWAP) construction which only requires CNOTs in one direction, Hadamards, S gates ($Z^{\frac{1}{2}}$), S dagger gates ($Z^{-\frac{1}{2}}$), T gates ($Z^{\frac{1}{4}}$) and T dagger gates ($Z^{-\frac{1}{4}}$):

enter image description here

You should be able to encode it directly into the composer.

Craig Gidney
  • 47,099
  • 1
  • 44
  • 119
5

What you want to do is a rotation on the subspace spanned by $|01\rangle$ and $|10\rangle$ which rotates it by $\sqrt{X}$. To this end, you can first do a CNOT, which maps this subspace to $\{|01\rangle,|11\rangle\}$. Now you need to do the $\sqrt{X}$ rotation on the first qubit, conditioned on the second qubit being one. Implementing controlled-$U$ gates using CNOTs is a standard construction, which can be found in a range of places, see e.g. https://arxiv.org/abs/quant-ph/9503016. Depending how you do this step, you might have to fix the "global" phase of the 1st qubit (given the 2nd is $|1\rangle$). Finally, you need to undo the CNOT.

Norbert Schuch
  • 8,740
  • 2
  • 19
  • 31
0

Every 2-qubit gate has a "Paulinomial decomposition" which means it can be written as a polynomial of Pauli matrices.

For the gate you want:

$ \sqrt{ \mbox{SWAP} } = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \frac{1}{{2}} (1+i) & \frac{1}{{2}} (1-i) & 0 \\ 0 & \frac{1}{{2}} (1-i) & \frac{1}{{2}} (1+i) & 0 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix} = \frac{1-i}{4}\left(X_1X_2+Y_1Y_2+Z_1Z_2\right) +\frac{3+i}{2}I, $

where $X_i$ is an $X$ gate applied to the $i^\textrm{th}$ qubit.