class_docstr: Unit tests for transpile function
class_docstr_tok: ["Unit","tests","for","transpile","function"]
docstr: Test an error is raised if a device is provided as a keyword argument to a qnode transform.
docstr_tok: ["Test","an","error","is","raised","if","a","device","is","provided","as","a","keyword","argument","to","a","qnode","transform","."]
code: def test_qnode_transform_raises_if_device_kwarg(self):
      """Test an error is raised if a device is provided as a keyword argument to a qnode transform."""
  
      dev = qml.device("default.qubit", wires=[0, 1, 2, 3])
  
      @qml.qnode(dev)
      def circuit():
          return qml.state()
  
      with pytest.raises(ValueError, match=r"Cannot provide a "):
          qml.transforms.transpile(
              circuit,
              coupling_map=[(0, 1), (1, 3), (3, 2), (2, 0)],
              device=dev,
          )
  
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 18 for calling the TestTranspile obj's underlying member method code with example usage: obj.test_qnode_transform_raises_if_device_kwarg() and returns: qml