I have a 2 qubit circuit where I wish to measure the first qubit and the measurement outcome determines what operation to implement on qubit 2. The whole process can be simulated using the following operation
\begin{equation} |0\rangle\langle0|\otimes H+|1\rangle\langle1|\otimes HS \end{equation} where H is a Hadamard gate and S is the phase gate, i.e. if the result is 0 I will measure in X basis and if it is 1 I will measure in Y basis. As a unitary this is \begin{equation} \begin{pmatrix} \frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0&0\\ \frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}&0&0\\ 0&0&\frac{1}{\sqrt{2}}&\frac{i}{\sqrt{2}}\\ 0&0&\frac{1}{\sqrt{2}}&\frac{-i}{\sqrt{2}}\\ \end{pmatrix} \end{equation}
This can be implemented on IBM's simulator using c_if
but does anyone know how to implement this on the real IBM devices? I tried using transpile to see what gates it can be decomposed into. However this gave a very complicated matrix. Is there a simpler way to implement conditional operations on real IBM devices?
Thanks!