class_docstr: Tests for the qfunc_transform decorator differentiability
class_docstr_tok: ["Tests","for","the","qfunc_transform","decorator","differentiability"]
docstr: Analytic expectation value of the above circuit qfunc
docstr_tok: ["Analytic","expectation","value","of","the","above","circuit","qfunc"]
code: def expval(x, a, b):
      """Analytic expectation value of the above circuit qfunc"""
      return np.cos(np.sum(b) * np.sqrt(x)) * np.cos(a * x)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 4 for calling the TestQFuncTransformGradients obj's underlying member method code with example usage: obj.expval(x, a, b) and returns: unknown