class_docstr: Test that the transform integrates well with QNodes.
docstr: Test that a quantum function that contains one operation before and
  after a mid-circuit measurement yields the correct results and is
  transformed correctly.
docstr_tok: ["Test","that","a","quantum","function","that","contains","one","operation","before","and","after","a","mid-circuit","measurement","yields","the","correct","results","and","is","transformed","correctly","."]
code: def test_measure_between_ops(self):
      """Test that a quantum function that contains one operation before and
      after a mid-circuit measurement yields the correct results and is
      transformed correctly."""
      dev = qml.device("default.qubit", wires=3)
  
      def func1():
          qml.RY(0.123, wires=0)
          qml.PauliX(0)
          return qml.expval(qml.PauliZ(0))
  
      def func2():
          qml.RY(0.123, wires=0)
          qml.measure(1)
          qml.PauliX(0)
          return qml.expval(qml.PauliZ(0))
  
      tape_deferred_func = qml.defer_measurements(func2)
      qnode1 = qml.QNode(func1, dev)
      qnode2 = qml.QNode(tape_deferred_func, dev)
  
      res1 = qnode1()
      res2 = qnode2()
      assert res1 == res2
      assert isinstance(res1, type(res2))
      assert res1.shape == res2.shape
  
      assert len(qnode2.qtape.operations) == len(
          qnode1.qtape.operations
      )
      assert len(qnode1.qtape.measurements) == len(
          qnode2.qtape.measurements
      )
  
      # Check the operations
      for op1, op2 in zip(
          qnode1.qtape.operations, qnode2.qtape.operations
      ):
          assert isinstance(op1, type(op2))
          assert op1.data == op2.data
  
      # Check the measurements
      for op1, op2 in zip(
          qnode1.qtape.measurements, qnode2.qtape.measurements
      ):
          assert isinstance(op1, type(op2))
          assert op1.data == op2.data
  
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 11 for calling the TestQNode obj's underlying member method code with example usage: obj.test_measure_between_ops() and returns: qml, qml