class_docstr: Unit tests on ``qml.transforms.split_non_commuting()``
class_docstr_tok: ["Unit","tests","on","``","qml.transforms.split_non_commuting","(",")","``"]
docstr: Test that the output is of the correct order
docstr_tok: ["Test","that","the","output","is","of","the","correct","order"]
code: def test_non_commuting_group_right_reorder(
      self, meas_type, obs_list, group_coeffs
  ):
      """Test that the output is of the correct order"""
      # create a queue with several measurements of same type but with differnent non-commuting
      # observables
      with qml.queuing.AnnotatedQueue() as q:
          qml.PauliZ(0)
          qml.Hadamard(0)
          qml.CNOT((0, 1))
          for obs in obs_list:
              meas_type(op=obs)
  
      tape = qml.tape.QuantumScript.from_queue(q)
      _, fn = split_non_commuting(tape)
      assert all(
          np.array(fn(group_coeffs))
          == np.arange(len(tape.measurements))
      )
  
      qs = qml.tape.QuantumScript(tape.operations, tape.measurements)
      _, fn = split_non_commuting(qs)
      assert all(
          np.array(fn(group_coeffs))
          == np.arange(len(tape.measurements))
      )
  
imports: import itertools
  import pytest
  import numpy
  import pennylane
  import pennylane.numpy
  from pennylane.transforms import split_non_commuting
label_desc: Use image node_id 4 for calling the TestUnittestSplitNonCommuting obj's underlying member method code with example usage: obj.test_non_commuting_group_right_reorder(meas_type, obs_list, group_coeffs) without return types