# Feed-forward+reset circuit logic differes with Qiskit PennyLane plugin

**URL:** <https://discuss.pennylane.ai/t/feed-forward-reset-circuit-logic-differes-with-qiskit-pennylane-plugin/4310>\
**Category:** PennyLane Help\
**Created:** [March 19, 2024, 11:47am UTC](https://discuss.pennylane.ai/t/feed-forward-reset-circuit-logic-differes-with-qiskit-pennylane-plugin/4310 "2024-03-19T11:47:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Balewski](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/jan_balewski/32/2220_2.png) [@Jan\_Balewski](https://discuss.pennylane.ai/u/Jan_Balewski)\
**Post date:** [March 19, 2024, 11:47am UTC](https://discuss.pennylane.ai/t/feed-forward-reset-circuit-logic-differes-with-qiskit-pennylane-plugin/4310/1 "2024-03-19T11:47:45Z")

</div>

It seems the logic of a circuit with a feed-forward & reset() instruction is not preserved when `Qiskit PennyLane plugin` is used. This is a non-reversible minimal circuit I wish to run

```auto
dev= <default.qubit device (wires=2, shots=1000) 
0: ──RX(1.41)──┤↗│ │0⟩──X─┤ <Z>
                ╚════════╝

```

But when I switch to qiskit.aer I get a reversible circuit below:

```auto
dev= Qiskit PennyLane plugin
Plugin version: 0.34.0
0: ──RX(1.41)─╭●─╭X─╭X─┤ <Z>
1: ───────────╰X─╰●─╰●─┤

```

The final state of q0 in the original circuit is only on the top or bottom of the Bloch sphere with probabilities p and 1-p  
The final state of Qiskit version, assuming I traced out the 2nd qubit, is at some position on a Bloch sphere set by the qml.RX(ang,0) - so those 2 states are different.  
Below is the reproducer

```auto
import pennylane as qml
from pennylane import numpy as np
num_qubit=2 ; shots=1000; iqt=0

if 1: # use Qiskit.aer 
    from qiskit.providers.aer import AerSimulator
    from qiskit.providers.fake_provider import FakeHanoi
    fake_hanoi_backend = FakeHanoi()
    aer_simulator = AerSimulator.from_backend(fake_hanoi_backend)
    dev = qml.device('qiskit.aer', wires=num_qubit, backend=aer_simulator, shots=shots)
else: # native backend
    dev = qml.device('default.qubit', wires=num_qubit,shots=shots)

print('dev=',dev)
@qml.qnode(dev)
def circuit(x):
    ang=np.arccos(x) ; qml.RX(ang,0)
    m = qml.measure(0,reset=True)
    qml.cond(m, qml.PauliX)(iqt)
    return qml.expval(qml.PauliZ(iqt) )

x=0.16
print(qml.draw(circuit, decimals=2)(x), '\n')

```

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [March 20, 2024, 9:38pm UTC](https://discuss.pennylane.ai/t/feed-forward-reset-circuit-logic-differes-with-qiskit-pennylane-plugin/4310/2 "2024-03-20T21:38:04Z")

</div>

Hey @Jan_Balewski,

Mid-circuit measurements (MCMs) are natively supported on default qubit and default mixed at the moment. When using any of the pennylane-qiskit devices, I’m not sure what the behaviour should be. My guess is that MCMs will be decomposed into quantum controls rather than classical controls 🤔. I’ll have to do some digging and get back to you 🙂
