class_docstr: Unit tests for transpile function
class_docstr_tok: ["Unit","tests","for","transpile","function"]
docstr: test that error is raised when measurement is expectation of a Hamiltonian
docstr_tok: ["test","that","error","is","raised","when","measurement","is","expectation","of","a","Hamiltonian"]
code: def test_transpile_raise_not_implemented_hamiltonain_mmt(self):
      """test that error is raised when measurement is expectation of a Hamiltonian"""
      dev = qml.device("default.qubit", wires=[0, 1, 2, 3])
      coeffs = [1]
      obs = [qml.PauliZ(0) @ qml.PauliZ(1)]
      H = qml.Hamiltonian(coeffs, obs)
  
      def circuit():
          qml.CNOT(wires=[0, 1])
          qml.CNOT(wires=[0, 3])
          return qml.expval(H)
  
      # build circuit
      transpiled_qfunc = transpile(
          circuit, coupling_map=[(0, 1), (1, 2), (2, 3)]
      )
      transpiled_qnode = qml.QNode(transpiled_qfunc, dev)
      err_msg = "Measuring expectation values of tensor products or Hamiltonians is not yet supported"
      with pytest.raises(NotImplementedError, match=err_msg):
          transpiled_qnode()
  
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 2 for calling the TestTranspile obj's underlying member method code with example usage: obj.test_transpile_raise_not_implemented_hamiltonain_mmt() and returns: qml