class_docstr: Tests for the quantum gradients of various gates
  with variance measurements
docstr: Test variance of a second order CV expectation value
docstr_tok: ["Test","variance","of","a","second","order","CV","expectation","value"]
code: def test_second_order_cv(self, tol):
      """Test variance of a second order CV expectation value"""
      dev = qml.device("default.gaussian", wires=1)
  
      n = 0.12
      a = 0.765
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.ThermalState(n, wires=0)
          qml.Displacement(a, 0, wires=0)
          qml.var(qml.NumberOperator(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {0, 1}
  
      res = qml.execute([tape], dev, None)
      expected = n**2 + n + np.abs(a) ** 2 * (1 + 2 * n)
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      # circuit jacobians
      tapes, fn = qml.gradients.finite_diff(tape)
      grad_F = fn(dev.batch_execute(tapes))
  
      expected = np.array(
          [[2 * a**2 + 2 * n + 1, 2 * a * (2 * n + 1)]]
      )
      assert np.allclose(grad_F, expected, atol=tol, rtol=0)
  
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 2 for calling the TestVarianceQuantumGradients obj's underlying member method code with example usage: obj.test_second_order_cv(tol) without return types