# Please help interpret the IBM Quantum error code: “Instruction bfunc is not supported [7001]”

I have already run the circuit on the IBM Quantum simulators successfully. But, when I ran the same circuit on the real quantum device ibmq_16_melbourne, I got the error. The IBM website does have the 7001 code definition, but it is not specific enough to indicate what the bfunc means.

Could you please help interpret the code? More important, how can I avoid that to have a successful run?

Thanks.

• If it possible, then put your code here so we can see what you did and maybe someone can further assist you. – KAJ226 Mar 27 at 4:16

## 1 Answer

A bfunc is a Boolean Function, as defined in the QObj Specification (page 20) and the error 7001 refers to Instruction {} is not supported.

In other words, the backend ibmq_16_melbourne does not support boolean functions.

Your circuit has, most likely, a classical conditional, something like if (c==0) h q[0]; in QASM or a circuit.h(qreg_q[0]).c_if(creg_c, 0) in Qiskit. Conditional are not currently (March 2021) supported by any of the IBM quantum hardware. Although, they supported in many simulators.

• Precisely. Thanks, sir. I used that in our QASM files. Any plans to implement that this year? I use the one-bit trick inverse QFT described in the OpenQASM spec to do the 2n+3 Shor's Algorithm. It must have conditional statements. Imagine it saves n qubits! – Emscripten Fan Mar 27 at 15:47
• I mean, one-bit inverse QFT saves (n-1) qubits:-) – Emscripten Fan Mar 27 at 16:10
• What you describe sounds to me like dynamic circuits. My understanding from the roadmap is that is planned for 2022 ibm.com/blogs/research/2021/02/quantum-development-roadmap – luciano Mar 27 at 21:15
• You said the conditional statements are supported in many simulators. I tested them and they accepted the syntax indeed. But, are you aware of any problems of using them? I can run a toy circuit (factoring 21) with full Quantum Fourier Transform (meaning no conditional statements) successfully on them, but not one-bit QFT. But, I can run both on simulators from other companies successfully. The one-bit QFT on ibmq_qasm_simulator does not produce the correct results. Do you have a good example of using one-bit QFT? – Emscripten Fan Mar 30 at 1:49
• that sounds like a new question :) – luciano Mar 30 at 8:35