class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Test permutation of wire subsets on QNodes.
docstr_tok: ["Test","permutation","of","wire","subsets","on","QNodes","."]
code: def test_subset_permutations_qnode(
      self,
      mocker,
      num_wires,
      permutation_order,
      wire_subset,
      expected_wires,
  ):
      """Test permutation of wire subsets on QNodes."""
  
      dev = qml.device("default.qubit", wires=num_wires)
  
      @qml.qnode(dev, interface="autograd")
      def subset_perm():
          qml.Permute(permutation_order, wires=wire_subset)
          return qml.expval(qml.PauliZ(0))
  
      spy = mocker.spy(subset_perm.device, "execute")
      subset_perm()
  
      tape = spy.call_args[0][0][0]
  
      # Check that the Permute operation was expanded to SWAPs when the QNode
      # is evaluated, and that the wires are the same
      assert all(op.name == "SWAP" for op in tape.operations)
      assert [
          op.wires.labels for op in tape.operations
      ] == expected_wires
  
imports: import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 9 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_subset_permutations_qnode(mocker, num_wires, permutation_order, wire_subset, expected_wires) and returns: qml