class_docstr: Unit tests for compile function.
class_docstr_tok: ["Unit","tests","for","compile","function","."]
docstr: Test that we can interchange tape and qfunc transforms.
docstr_tok: ["Test","that","we","can","interchange","tape","and","qfunc","transforms","."]
code: def test_compile_mixed_tape_qfunc_transform(self):
      """Test that we can interchange tape and qfunc transforms."""
  
      wires = [0, 1, 2]
      qfunc = build_qfunc(wires)
  
      pipeline = [
          partial(commute_controlled, direction="right"),
          cancel_inverses,
          merge_rotations,
      ]
  
      transformed_qfunc = compile(qfunc, pipeline)
      transformed_qnode = qml.QNode(transformed_qfunc, dev_3wires)
      transformed_qnode(0.3, 0.4, 0.5)
  
      names_expected = ["Hadamard", "CNOT", "RX", "CY", "PauliY"]
      wires_expected = [
          Wires(wires[0]),
          Wires([wires[2], wires[1]]),
          Wires(wires[0]),
          Wires([wires[1], wires[2]]),
          Wires(wires[2]),
      ]
  
      compare_operation_lists(
          transformed_qnode.qtape.operations,
          names_expected,
          wires_expected,
      )
  
imports: from functools import partial
  import pytest
  from test_optimization.utils import compare_operation_lists
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.transforms.compile import compile
  from pennylane.transforms import unitary_to_rot
  from pennylane.transforms.optimization import cancel_inverses, commute_controlled, merge_rotations, single_qubit_fusion
  from pennylane.transforms.optimization.optimization_utils import _fuse_global_phases
label_desc: Use image node_id 3 for calling the TestCompile obj's underlying member method code with example usage: obj.test_compile_mixed_tape_qfunc_transform() without return types