class_docstr: Unit tests on ``qml.transforms.split_non_commuting()``
class_docstr_tok: ["Unit","tests","on","``","qml.transforms.split_non_commuting","(",")","``"]
docstr: Testing that commuting MPs initialized using wires or observables are not split
docstr_tok: ["Testing","that","commuting","MPs","initialized","using","wires","or","observables","are","not","split"]
code: def test_wire_commuting_group_no_split(self, mocker, meas_type):
      """Testing that commuting MPs initialized using wires or observables are not split"""
      with qml.queuing.AnnotatedQueue() as q:
          qml.PauliZ(0)
          qml.Hadamard(0)
          qml.CNOT((0, 1))
          meas_type(wires=[0])
          meas_type(wires=[1])
          meas_type(wires=[0, 1])
          meas_type(op=qml.PauliZ(0))
          meas_type(op=qml.PauliZ(0) @ qml.PauliZ(2))
  
      # test transform on tape
      tape = qml.tape.QuantumScript.from_queue(q)
      split, fn = split_non_commuting(tape)
  
      spy = mocker.spy(qml.math, "concatenate")
  
      assert len(split) == 1
      assert all(isinstance(t, qml.tape.QuantumScript) for t in split)
      assert fn([0.5]) == 0.5
  
      # test transform on qscript
      qs = qml.tape.QuantumScript(tape.operations, tape.measurements)
      split, fn = split_non_commuting(qs)
  
      assert len(split) == 1
      assert all(
          isinstance(i_qs, qml.tape.QuantumScript) for i_qs in split
      )
      assert fn([0.5]) == 0.5
  
      spy.assert_not_called()
  
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 2 for calling the TestUnittestSplitNonCommuting obj's underlying member method code with example usage: obj.test_wire_commuting_group_no_split(mocker, meas_type) without return types