TransWikia.com

Qiskit's c_if and conditioned operations on a real quantum computer

Quantum Computing Asked by AL_P on April 28, 2021

Can Qiskit’s 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)?

One Answer

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:

enter image description here

I would get the following error:

enter image description here

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:

enter image description here

Answered by KAJ226 on April 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP