class_docstr: Tests for the quantum gradients of various gates
  with variance measurements
docstr: Test exception raised if attempting to use the second order rule for
  computing the gradient analytically of an expectation value that
  contains an operation with more than two terms in the gradient recipe
docstr_tok: ["Test","exception","raised","if","attempting","to","use","the","second","order","rule","for","computing","the","gradient","analytically","of","an","expectation","value","that","contains","an","operation","with","more","than","two","terms","in","the","gradient","recipe"]
code: def test_error_unsupported_grad_recipe(self, _):
      """Test exception raised if attempting to use the second order rule for
      computing the gradient analytically of an expectation value that
      contains an operation with more than two terms in the gradient recipe
      """
  
      # pylint: disable=too-few-public-methods
      class DummyOp(qml.operation.CVOperation):
          """Dummy op"""
  
          num_wires = 1
          par_domain = "R"
          grad_method = "A"
          grad_recipe = ([[1, 1, 1], [1, 1, 1], [1, 1, 1]],)
  
      dev = qml.device("default.gaussian", wires=1)
  
      dev.operations.add(DummyOp)
  
      with qml.queuing.AnnotatedQueue() as q:
          DummyOp(1, wires=[0])
          qml.expval(qml.QuadX(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
  
      with pytest.raises(
          NotImplementedError,
          match=r"analytic gradient for order-2 operators is unsupported",
      ):
          param_shift_cv(tape, dev, force_order2=True)
  
imports: import unittest.mock
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.gradients import param_shift_cv
  from pennylane.gradients.gradient_transform import choose_trainable_params
  from pennylane.gradients.parameter_shift_cv import _grad_method_cv, _find_gradient_methods_cv, _transform_observable
label_desc: Use image node_id 5 for calling the TestVarianceQuantumGradients obj's underlying member method code with example usage: obj.test_error_unsupported_grad_recipe(_) without return types