class_docstr: Tests conditional operations
docstr: Test that applying a conditional operation on the same wire
  that is measured works as expected.
docstr_tok: ["Test","that","applying","a","conditional","operation","on","the","same","wire","that","is","measured","works","as","expected","."]
code: def test_cond_on_measured_wire(self):
      """Test that applying a conditional operation on the same wire
      that is measured works as expected."""
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      @qml.defer_measurements
      def qnode():
          qml.Hadamard(0)
          m = qml.measure(0)
          qml.cond(m, qml.PauliX)(0)
          return qml.density_matrix(0)
  
      # Above circuit will cause wire 0 to go back to the |0> computational
      # basis state. We can inspect the reduced density matrix to confirm this
      # without inspecting the extra wires
      expected_dmat = np.array([[1, 0], [0, 0]])
      assert np.allclose(qnode(), expected_dmat)
  
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 14 for calling the TestConditionalOperations obj's underlying member method code with example usage: obj.test_cond_on_measured_wire() and returns: qml