2

I'm given with a Hamiltonian, $H=H_1+H_2$, where $H_1=\sigma_x\otimes\sigma_z$ and $H_2=\sigma_y\otimes\sigma_y$, and want to built a circuit which will implement $e^{-iHt},t=\pi/6$. We see that as $\sigma_x\otimes\sigma_z$ and $\sigma_y\otimes\sigma_y$ commutes, so $e^{-iHt}=e^{-i(\sigma_x\otimes\sigma_z)t}e^{-i(\sigma_y\otimes\sigma_y)t}.$

enter image description here enter image description here By referring to answer given here,the first circuit is of $e^{-i(\sigma_x\otimes\sigma_z)t}$ and the second implements $e^{-i(\sigma_y\otimes\sigma_y)t}$, where $Y=\frac {1}{\sqrt{2}} \begin{pmatrix} 1&1\\ i&-i\\ \end{pmatrix} $

Note that the bottom qubit corresponds to the first in the tensor product.

Question

As $H_1$ and $H_2$ commutes, $e^{-iH_1t}$ and $e^{-iH_2t}$ should also commute. But here, in quirk. Though probabilities are same after both cases, the final state isn't, which indicates $e^{-i(\sigma_x\otimes\sigma_z)t}$ and $e^{-i(\sigma_y\otimes\sigma_y)t}$ are not commuting. What's my mistake here?

Omkar
  • 341
  • 1
  • 9

2 Answers2

2

You reversed the order of $Y^\dagger$ and $Y$ compared to the answer you linked. Instead of using the "$Y^\dagger$" operation that sends the X axis to the Y axis to the Z axis to the X axis, you're doing the reverse. So you're operating on $X \otimes X$ instead of $Y \otimes Y$. (Incidentally, given the confusion w.r.t. the Y axis, it's hard to think of a worse name than Y for a custom operation.)

Personally I would recommend using self-inverse operations that swap one axis for another, like how the Hadamard swaps X for Z, instead of operations where it's possible to use them in the wrong order. In this case you could use $H_{YZ} = (Y + Z) / \sqrt{2} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -i \\ i & -1 \end{bmatrix}$.

Craig Gidney
  • 44,299
  • 1
  • 41
  • 116
2

I agree that $Y$ is not the best notation. Actually, in the paper that I was referring in the answer there was a gate $Y$ that was doing the desired job (it was also not a self-inverse gate). I didn't use the gate from the paper, but I kept the notation. Anyway, I like more Craig Gidney's suggestion to use $H_{YZ}$ gate. I will edit my answer to replace Y gate with $H_{YZ}$ (but I will call it just $H_y$ in order to have a short name in the circuits).

Now, about the question. I tried to do implementation of the circuits with Qiskit and find out that their outputs are the same. But, firstly, note that, my definition of $Y$ gate is different from the definition mentioned in the question. Here are my notations and corresponding Qiskit implementations of those gates:

\begin{align*} Y = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -i \\ 1 & i \end{pmatrix} = &u2(0, \pi/2) \qquad Y^{\dagger} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ i & -i \end{pmatrix} = u2(\pi/2, \pi) \\ &u2 = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & e^{i\varphi} \\ e^{i\lambda} & e^{i(\varphi + \lambda)} \end{pmatrix} \end{align*}

Here is the code:

from qiskit import *
import numpy as np

simulator = Aer.get_backend('statevector_simulator')

q = QuantumRegister(2, 'q')

circuit_xz = QuantumCircuit(q)
circuit_xz.h(q[0])
circuit_xz.cx(q[1], q[0])
circuit_xz.rz(np.pi / 3, q[0])
circuit_xz.cx(q[1], q[0])
circuit_xz.h(q[0])

circuit_yy = QuantumCircuit(q)
circuit_yy.u2(np.pi/2, np.pi, q[0])
circuit_yy.u2(np.pi/2, np.pi, q[1])
circuit_yy.cx(q[1], q[0])
circuit_yy.rz(np.pi / 3, q[0])
circuit_yy.cx(q[1], q[0])
circuit_yy.u2(0, np.pi/2, q[0])
circuit_yy.u2(0, np.pi/2, q[1])

circuit_xz_yy = circuit_xz + circuit_yy
circuit_yy_xz = circuit_yy + circuit_xz

result_1 = execute(circuit_xz_yy, simulator).result().get_statevector(circuit_xz_yy)
result_2 = execute(circuit_xz_yy, simulator).result().get_statevector(circuit_xz_yy)

print("The first result \n{}".format(result_1))
print("\n The second result \n{}".format(result_1))

And here is the output:

The first result 
[ 0.375+0.64951905j  0.375-0.21650635j  -0.125-0.21650635j  0.375-0.21650635j]

The second result 
[ 0.375+0.64951905j  0.375-0.21650635j  -0.125-0.21650635j  0.375-0.21650635j]
Davit Khachatryan
  • 4,461
  • 1
  • 11
  • 22