class_docstr: Tests for the quantum gradients of various gates
  with expectation value output
docstr: Test the gradient of the rotation gate
docstr_tok: ["Test","the","gradient","of","the","rotation","gate"]
code: def test_rotation_gradient(self, gradient_recipes, mocker, tol):
      """Test the gradient of the rotation gate"""
      dev = qml.device("default.gaussian", wires=2, hbar=hbar)
  
      alpha = 0.5643
      theta = 0.23354
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.Displacement(alpha, 0.0, wires=[0])
          qml.Rotation(theta, wires=[0])
          qml.expval(qml.QuadX(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {2}
  
      spy2 = mocker.spy(
          qml.gradients.parameter_shift_cv, "second_order_param_shift"
      )
  
      tapes, fn = param_shift_cv(
          tape, dev, gradient_recipes=gradient_recipes
      )
      grad_A = fn(dev.batch_execute(tapes))
      spy2.assert_not_called()
  
      tapes, fn = param_shift_cv(
          tape,
          dev,
          gradient_recipes=gradient_recipes,
          force_order2=True,
      )
      grad_A2 = fn(dev.batch_execute(tapes))
      spy2.assert_called()
  
      expected = -hbar * alpha * np.sin(theta)
      assert np.allclose(grad_A, expected, atol=tol, rtol=0)
      assert np.allclose(grad_A2, 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 1 for calling the TestExpectationQuantumGradients obj's underlying member method code with example usage: obj.test_rotation_gradient(gradient_recipes, mocker, tol) without return types