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?


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

1 Answer 1


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.

  • $\begingroup$ 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! $\endgroup$ Mar 27, 2021 at 15:47
  • $\begingroup$ I mean, one-bit inverse QFT saves (n-1) qubits:-) $\endgroup$ Mar 27, 2021 at 16:10
  • 1
    $\begingroup$ 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 $\endgroup$
    – luciano
    Mar 27, 2021 at 21:15
  • $\begingroup$ 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? $\endgroup$ Mar 30, 2021 at 1:49
  • $\begingroup$ that sounds like a new question :) $\endgroup$
    – luciano
    Mar 30, 2021 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.