class_docstr: Test commute controlled on tape, qfunc and QNode.
class_docstr_tok: ["Test","commute","controlled","on","tape",",","qfunc","and","QNode","."]
docstr: Test the transform on tape.
docstr_tok: ["Test","the","transform","on","tape","."]
code: def test_tape(self):
      """Test the transform on tape."""
      tapes, _ = commute_controlled(tape_circuit)
      assert len(tapes) == 1
      tape = tapes[0]
      assert len(tape.operations) == 7
  
      names_expected = [
          "CNOT",
          "Toffoli",
          "PauliX",
          "RX",
          "CRX",
          "SX",
          "PauliX",
      ]
      wires_expected = [
          Wires([0, 2]),
          Wires([0, 1, 2]),
          Wires(2),
          Wires(2),
          Wires([0, 1]),
          Wires(1),
          Wires(1),
      ]
      compare_operation_lists(
          tape.operations, names_expected, wires_expected
      )
  
imports: import pytest
  from utils import compare_operation_lists, check_matrix_equivalence
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.transforms.optimization import commute_controlled
label_desc: Use image node_id 1 for calling the TestTransformDispatch obj's underlying member method code with example usage: obj.test_tape() without return types