1

I'm running an algorithm on a real quantum device from IBM (ibmqx2), using the QASM and circuit composer, and it just gets the same error over and over again: Instruction not in basis gates: instruction: bfunc, qubits: [].

Here is the transpiled code:

qreg q[5];

creg c[4];


u3(2.0943951023931953, 1.5707963267948966, 1.5707963267948966) q[0];
u2(0, 3.141592653589793) q[1];
cx q[1], q[2];
cx q[0], q[1];
u2(0, 3.141592653589793) q[0];
cx q[2], q[4];
measure q[0] -> c[0];
if(c == 1) u1(3.141592653589793) q[2];
if(c == 1) u1(3.141592653589793) q[4];
measure q[1] -> c[1];
if(c == 1) u3(3.141592653589793, 0, 3.141592653589793) q[2];
if(c == 1) u3(3.141592653589793, 0, 3.141592653589793) q[4];
measure q[2] -> c[2];
measure q[4] -> c[0];

It's just a simple teleportation algorithm with an extra qubit. How can that be to not work properly? Does someone knows what may be happening?

Martin Vesely
  • 13,891
  • 4
  • 28
  • 65
doomsk
  • 11
  • 1
  • 1
  • I don't think so.. I'm not performing any post-measurement operation on qubits already measured, just using the result for controlled gates on other qubits. But thanks, they raised useful insights. – doomsk Apr 19 '20 at 11:23
  • I am sorry I confused you, I had two issues in my teleport implementation. The problem in your case is IF gate. It is not implemented on real quantum devices. You can use it only on simulator. Try to implement the circuit without IF, simply use controlled quantum gates instead of coditioning on state of classical register. See my own answer in the link. – Martin Vesely Apr 19 '20 at 11:26
  • @MartinVesely thanks! I've got the idea now and it worked on simulation. Unfortunately, due qubit-interaction constraints on real devices, I cannot perform this without the if or it should have two qubits with three connections in order to work properly. Thanks again. – doomsk Apr 19 '20 at 13:52

0 Answers0