class_docstr: Test that using the QNode with Autograd integrates with the PennyLane stack
class_docstr_tok: ["Test","that","using","the","QNode","with","Autograd","integrates","with","the","PennyLane","stack"]
docstr: Test evaluation and Jacobian if there are no trainable parameters
docstr_tok: ["Test","evaluation","and","Jacobian","if","there","are","no","trainable","parameters"]
code: def test_no_trainable_parameters(
      self, interface, dev, diff_method, grad_on_execution, device_vjp
  ):
      """Test evaluation and Jacobian if there are no trainable parameters"""
  
      @qnode(
          dev,
          diff_method=diff_method,
          interface=interface,
          grad_on_execution=grad_on_execution,
          device_vjp=device_vjp,
      )
      def circuit(a, b):
          qml.RY(a, wires=0)
          qml.RX(b, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
  
      a = np.array(0.1, requires_grad=False)
      b = np.array(0.2, requires_grad=False)
  
      res = circuit(a, b)
  
      if diff_method == "finite-diff":
          assert circuit.qtape.trainable_params == []
  
      assert len(res) == 2
      assert isinstance(res, tuple)
  
      def cost(x, y):
          return autograd.numpy.hstack(circuit(x, y))
  
      with pytest.warns(
          UserWarning,
          match="Attempted to differentiate a function with no",
      ):
          assert not qml.jacobian(cost)(a, b)
  
      def cost2(a, b):
          return np.sum(circuit(a, b))
  
      with pytest.warns(
          UserWarning,
          match="Attempted to differentiate a function with no",
      ):
          grad = qml.grad(cost2)(a, b)
  
      assert grad == tuple()
  
imports: import autograd
  import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 8 for calling the TestQNode obj's underlying member method code with example usage: obj.test_no_trainable_parameters(interface, dev, diff_method, grad_on_execution, device_vjp) and returns: qml,  qml, autograd, np