class_docstr: Tests for the ``adjoint_jacobian`` method
class_docstr_tok: ["Tests","for","the","``","adjoint_jacobian","``","method"]
docstr: Tests that the automatic gradients of Pauli rotations are correct.
docstr_tok: ["Tests","that","the","automatic","gradients","of","Pauli","rotations","are","correct","."]
code: def test_pauli_rotation_gradient(self, G, theta, tol, dev):
      """Tests that the automatic gradients of Pauli rotations are correct."""
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.StatePrep(
              np.array([1.0, -1.0], requires_grad=False) / np.sqrt(2),
              wires=0,
          )
          G(theta, wires=[0])
          qml.expval(qml.PauliZ(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      tape.trainable_params = {1}
  
      calculated_val = dev.adjoint_jacobian(tape)
  
      # compare to finite differences
      tapes, fn = qml.gradients.finite_diff(tape)
      numeric_val = fn(qml.execute(tapes, dev, None))
  
      assert isinstance(calculated_val, np.ndarray)
      assert calculated_val.shape == ()
      assert np.allclose(calculated_val, numeric_val, atol=tol, rtol=0)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 7 for calling the TestAdjointJacobian obj's underlying member method code with example usage: obj.test_pauli_rotation_gradient(G, theta, tol, dev) without return types