class_docstr: Test Conditionals that rely on expressions of mid-circuit measurements.
docstr: Test that the quantum conditional operations match the output of
  controlled rotations. And additionally that summing measurements works as expected.
docstr_tok: ["Test","that","the","quantum","conditional","operations","match","the","output","of","controlled","rotations",".","And","additionally","that","summing","measurements","works","as","expected","."]
code: def test_conditional_rotations(self, r, op):
      """Test that the quantum conditional operations match the output of
      controlled rotations. And additionally that summing measurements works as expected.
      """
      dev = qml.device("default.qubit", wires=5)
  
      @qml.qnode(dev)
      def normal_circuit(rads):
          qml.RX(2.4, wires=0)
          qml.RY(1.3, wires=1)
          qml.ctrl(op, control=(0, 1), control_values=[True, True])(
              rads, wires=2
          )
          return qml.probs(wires=2)
  
      @qml.qnode(dev)
      @qml.defer_measurements
      def quantum_control_circuit(rads):
          qml.RX(2.4, wires=0)
          qml.RY(1.3, wires=1)
          m_0 = qml.measure(0)
          m_1 = qml.measure(1)
          qml.cond(m_0 + m_1 == 2, op)(rads, wires=2)
          return qml.probs(wires=2)
  
      normal_probs = normal_circuit(r)
      cond_probs = quantum_control_circuit(r)
  
      assert np.allclose(normal_probs, cond_probs)
  
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 1 for calling the TestExpressionConditionals obj's underlying member method code with example usage: obj.test_conditional_rotations(r, op) and returns: qml, qml