class_docstr: Tests for the quantum gradients of various gates
  with variance measurements
docstr: Test exception raised if attempting to use a second
  order observable to compute the variance derivative analytically
docstr_tok: ["Test","exception","raised","if","attempting","to","use","a","second","order","observable","to","compute","the","variance","derivative","analytically"]
code: def test_error_analytic_second_order(self):
      """Test exception raised if attempting to use a second
      order observable to compute the variance derivative analytically
      """
      dev = qml.device("default.gaussian", wires=1)
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.Displacement(1.0, 0, wires=0)
          qml.var(qml.NumberOperator(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {0}
  
      with pytest.raises(
          ValueError,
          match=r"cannot be used with the parameter\(s\) \[0\]",
      ):
          param_shift_cv(tape, dev, fallback_fn=None)
  
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 4 for calling the TestVarianceQuantumGradients obj's underlying member method code with example usage: obj.test_error_analytic_second_order() without return types