class_docstr: These tests are useful as they test operators that might not have
  matrix forms defined, requiring decomposition.
class_docstr_tok: ["These","tests","are","useful","as","they","test","operators","that","might","not","have","matrix","forms","defined",",","requiring","decomposition","."]
docstr: Test a template used within a qfunc
docstr_tok: ["Test","a","template","used","within","a","qfunc"]
code: def test_qfunc(self):
      """Test a template used within a qfunc"""
  
      def circuit(weights, x):
          qml.StronglyEntanglingLayers(weights, wires=[0, 1])
          qml.RX(x, wires=0)
  
      weights = np.array([[[0.1, 0.2, 0.3], [0.1, 0.2, 0.3]]])
      x = 0.54
  
      with pytest.warns(
          UserWarning,
          match="the eigenvalues will be computed numerically",
      ):
          res = qml.eigvals(circuit)(weights, x)
  
      op = qml.StronglyEntanglingLayers(weights, wires=[0, 1])
  
      with qml.queuing.AnnotatedQueue() as q:
          op.decomposition()
          qml.RX(x, wires=0)
  
      tape = qml.tape.QuantumScript.from_queue(q)
      with pytest.warns(
          UserWarning,
          match="the eigenvalues will be computed numerically",
      ):
          expected = qml.eigvals(tape)
  
      assert np.allclose(res, expected)
  
imports: from functools import reduce
  import pytest
  import scipy
  from gate_data import CNOT, H, I, S, X, Y, Z
  import pennylane
  from pennylane import numpy
  from pennylane.transforms.op_transforms import OperationTransformError
label_desc: Use image node_id 2 for calling the TestTemplates obj's underlying member method code with example usage: obj.test_qfunc() without return types