code: def test_riemannian_gradient_hamiltonian_input_1_check():
      """Test that a type error is raise for non-QNode circuits."""
  
      @qml.qnode(qml.device("default.qubit", wires=3))
      def circuit():
          qml.RY(0.5, wires=0)
          return qml.state()
  
      with pytest.raises(
          TypeError,
          match="circuit must return the expectation value of a Hamiltonian",
      ):
          RiemannianGradientOptimizer(circuit=circuit, stepsize=0.001)
  
file_path: pennylane/tests/optimize/test_riemannian_gradient_optimizer.py
imports: import pytest
  from scipy.sparse.linalg import expm
  import numpy
  import pennylane
  from pennylane.optimize import RiemannianGradientOptimizer
label_desc: Use image node_id 10 for calling a global function with example usage: test_riemannian_gradient_hamiltonian_input_1_check() and returns: qml