c_if be used on a real quantum computer of IBM? And if it can, can it put a condition only on Qiskit gates like X, H, U1, U2, etc, or is there some way to make the conditioned operation to be a user defined operation, like a block of code, or a user defined gate? Is there other ways to do operations which are conditioned on the classical register measurements results, which will work on real quantum devices (or at least on a simulator)?
As far as I know,
c_if operation is not implementable on IBM's hardware currently. But it should be implementable on simulator.
For instance, if I tried to execute this "teleportation" circuit on the hardware:
I would get the following error:
Note that I was able to execute the same circuit on the IBM qasm_simulator.
However, thanks to principle of deferred measurement, we can push the measurement all the way back to the end of the circuit. That is, you can convert the above circuit into an equivalent circuit with measurement operations being executed at the very end of the circuit: