I'm trying to write a 1-bit teleportation error correction code and there is one part in it where I need to add a gate that's dependent on a measurement from earlier in the circuit. The measurement is stored on a single classical bit, and I'm trying to use
c_if to apply the gate based on the measurement result of that bit.
Intuitively I would think this could be written as:
qc.h(q).c_if(c, 1) but that only returns an error while
qc.h(q).c_if(c, 1) gives no error (though it doesn't give the result I'm looking for). Is there a way to link c_if to a single classical bit instead of the classical register?
This question is similar and the answer seems to imply that it isn't possible to use c_if this way.
If c_if can't do this, would something like what they mentioned in their question:
if(c==1) qc.h(q) work in qiskit? For my purposes the operation needs to be integrated into the circuit, so if it does work would the gate be applied automatically?