class_docstr: Test composite application of dunder methods associated with the MeasurementValue class
class_docstr_tok: ["Test","composite","application","of","dunder","methods","associated","with","the","MeasurementValue","class"]
docstr: Test the composition of dunder methods.
code: def test_composition_between_measurement_values(
      self, unary_name, binary1_name, binary2_name
  ):
      """Test the composition of dunder methods."""
      m0 = MeasurementValue([mp1], lambda v: v)
      m1 = MeasurementValue([mp2], lambda v: v)
  
      # 1. Apply a unary dunder method
      unary = getattr(m0, unary_name)
      m0 = unary()
      assert isinstance(m0, MeasurementValue)
  
      # 2. Apply first binary dunder method
      binary_dunder1 = getattr(m0, binary1_name)
      sum_of_measurements = binary_dunder1(m1)
      assert isinstance(sum_of_measurements, MeasurementValue)
  
      # 3. Apply a unary dunder method on the new MV
      unary = getattr(sum_of_measurements, unary_name)
      m0 = unary()
      assert isinstance(m0, MeasurementValue)
  
      # 4. Apply second binary dunder method
      binary_dunder2 = getattr(m0, binary2_name)
  
      m2 = MeasurementValue([mp1], lambda v: v)
      boolean_of_measurements = binary_dunder2(m2)
  
      assert isinstance(boolean_of_measurements, MeasurementValue)
  
imports: from itertools import product
  import pytest
  import pennylane
  import pennylane.numpy
  from pennylane.measurements import MidMeasureMP, MeasurementValue
  from pennylane.wires import Wires
label_desc: Use image node_id 1 for calling the TestMeasurementCompositeValueManipulation obj's underlying member method code with example usage: obj.test_composition_between_measurement_values(unary_name, binary1_name, binary2_name) without return types