class_docstr: Test vector-valued returns for the JAX-JIT interface.
class_docstr_tok: ["Test","vector-valued","returns","for","the","JAX-JIT","interface","."]
docstr: Tests computing an expectation value that is independent of trainable
  parameters.
docstr_tok: ["Tests","computing","an","expectation","value","that","is","independent","of","trainable","parameters","."]
code: def test_independent_expval(self, execute_kwargs):
      """Tests computing an expectation value that is independent of trainable
      parameters."""
      dev = qml.device("default.qubit.legacy", wires=2)
      params = jax.numpy.array([0.1, 0.2, 0.3])
  
      def cost(a, cache):
          with qml.queuing.AnnotatedQueue() as q:
              qml.RY(a[0], wires=0)
              qml.RX(a[1], wires=0)
              qml.RY(a[2], wires=0)
              qml.expval(qml.PauliZ(1))
  
          tape = qml.tape.QuantumScript.from_queue(q)
  
          res = qml.execute([tape], dev, cache=cache, **execute_kwargs)
          return res[0]
  
      res = jax.jit(jax.grad(cost), static_argnums=1)(
          params, cache=None
      )
      assert res.shape == (3,)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients import param_shift
  from pennylane import execute
label_desc: Use image node_id 2 for calling the TestVectorValuedJIT obj's underlying member method code with example usage: obj.test_independent_expval(execute_kwargs) and returns: res