class_docstr: Pattern matching circuit optimization tests.
class_docstr_tok: ["Pattern","matching","circuit","optimization","tests","."]
docstr: Test that we cannot give a quantum function as pattern.
docstr_tok: ["Test","that","we","can","not","give","a","quantum","function","as","pattern","."]
code: def test_wrong_pattern_type(self):
      """Test that we cannot give a quantum function as pattern."""
  
      def circuit():
          qml.Toffoli(wires=[3, 4, 0])
          qml.CNOT(wires=[1, 4])
          qml.CNOT(wires=[2, 1])
          qml.Hadamard(wires=3)
          qml.PauliZ(wires=1)
          qml.CNOT(wires=[2, 3])
          qml.Toffoli(wires=[2, 3, 0])
          qml.CNOT(wires=[1, 4])
          return qml.expval(qml.PauliX(wires=0))
  
      def template():
          qml.CNOT(wires=[1, 2])
          qml.CNOT(wires=[0, 1])
          qml.CNOT(wires=[1, 2])
          qml.CNOT(wires=[0, 1])
          qml.CNOT(wires=[0, 2])
  
      dev = qml.device("default.qubit", wires=10)
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The pattern is not a valid quantum tape.",
      ):
          optimized_qfunc = pattern_matching_optimization(
              circuit, pattern_tapes=[template]
          )
          optimized_qnode = qml.QNode(optimized_qfunc, dev)
          optimized_qnode()
  
imports: import pytest
  import pennylane
  import pennylane.numpy
  from pennylane.transforms.commutation_dag import commutation_dag
  from pennylane.transforms.optimization.pattern_matching import pattern_matching, pattern_matching_optimization, ForwardMatch, BackwardMatch, _update_qubits
label_desc: Use image node_id 14 for calling the TestPatternMatchingOptimization obj's underlying member method code with example usage: obj.test_wrong_pattern_type() and returns: qml