class_docstr: Tests for the qubit reuse/reset functionality of `qml.measure`.
docstr: Test that a CNOT is applied from the wire that stores the measurement
  to the measured wire after the measurement.
docstr_tok: ["Test","that","a","CNOT","is","applied","from","the","wire","that","stores","the","measurement","to","the","measured","wire","after","the","measurement","."]
code: def test_correct_cnot_for_reset(self):
      """Test that a CNOT is applied from the wire that stores the measurement
      to the measured wire after the measurement."""
      dev = qml.device("default.qubit", wires=3)
  
      @qml.qnode(dev)
      def qnode1(x):
          qml.Hadamard(0)
          qml.CRX(x, [0, 1])
          return qml.expval(qml.PauliZ(1))
  
      @qml.qnode(dev)
      @qml.defer_measurements
      def qnode2(x):
          qml.Hadamard(0)
          m0 = qml.measure(0, reset=True)
          qml.cond(m0, qml.RX)(x, 1)
          return qml.expval(qml.PauliZ(1))
  
      assert np.allclose(qnode1(0.123), qnode2(0.123))
  
      expected_circuit = [
          qml.Hadamard(0),
          qml.CNOT([0, 2]),
          qml.CNOT([2, 0]),
          qml.ops.Controlled(qml.RX(0.123, 1), 2),
          qml.expval(qml.PauliZ(1)),
      ]
  
      assert len(qnode2.qtape.circuit) == len(expected_circuit)
      assert all(
          qml.equal(actual, expected)
          for actual, expected in zip(
              qnode2.qtape.circuit, expected_circuit
          )
      )
  
imports: import math
  import pytest
  import pennylane
  from pennylane.measurements import MidMeasureMP, MeasurementValue
  import pennylane.numpy
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 2 for calling the TestQubitReuseAndReset obj's underlying member method code with example usage: obj.test_correct_cnot_for_reset() and returns: qml, qml