class_docstr: Unit tests for transpile function
class_docstr_tok: ["Unit","tests","for","transpile","function"]
docstr: test that transpile raises an error for an operation with AnyWires that acts on more than 2 qubits
docstr_tok: ["test","that","transpile","raises","an","error","for","an","operation","with","AnyWires","that","acts","on","more","than","2","qubits"]
code: def test_more_than_2_qubits_raises_anywires(self):
      """test that transpile raises an error for an operation with AnyWires that acts on more than 2 qubits"""
      dev = qml.device("default.qubit", wires=[0, 1, 2])
  
      def circuit(param):
          qml.MultiRZ(param, wires=[0, 1, 2])
          return qml.probs(wires=[0, 1])
  
      param = 0.3
  
      transpiled_qfunc = transpile(
          circuit, coupling_map=[(0, 1), (1, 2)]
      )
      transpiled_qnode = qml.QNode(transpiled_qfunc, dev)
      with pytest.raises(
          NotImplementedError,
          match="transpile transform only supports gates acting on 1 or 2 qubits",
      ):
          transpiled_qnode(param)
  
imports: from math import isclose
  import pytest
  from pennylane import numpy
  import pennylane
  from pennylane.transforms.transpile import transpile
label_desc: Use image node_id 7 for calling the TestTranspile obj's underlying member method code with example usage: obj.test_more_than_2_qubits_raises_anywires() and returns: qml