class_docstr: Tests for the ``adjoint_jacobian`` method
class_docstr_tok: ["Tests","for","the","``","adjoint_jacobian","``","method"]
docstr: Test that error is raised for qml.Hamiltonian
docstr_tok: ["Test","that","error","is","raised","for","qml.Hamiltonian"]
code: def test_hamiltonian_error(self, dev):
      """Test that error is raised for qml.Hamiltonian"""
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.expval(
              qml.Hamiltonian(
                  [np.array(-0.05), np.array(0.17)],
                  [qml.PauliX(0), qml.PauliZ(0)],
              )
          )
  
      tape = qml.tape.QuantumScript.from_queue(q)
      with pytest.raises(
          qml.QuantumFunctionError,
          match="Adjoint differentiation method does not support Hamiltonian observables",
      ):
          dev.adjoint_jacobian(tape)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 4 for calling the TestAdjointJacobian obj's underlying member method code with example usage: obj.test_hamiltonian_error(dev) without return types