class_docstr: Tests for the ``adjoint_jacobian`` method
class_docstr_tok: ["Tests","for","the","``","adjoint_jacobian","``","method"]
docstr: Test that the gradient of the RX gate matches the known formula.
docstr_tok: ["Test","that","the","gradient","of","the","RX","gate","matches","the","known","formula","."]
code: def test_rx_gradient(self, tol, dev):
      """Test that the gradient of the RX gate matches the known formula."""
      a = 0.7418
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(a, wires=0)
          qml.expval(qml.PauliZ(0))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      # circuit jacobians
      dev_jacobian = dev.adjoint_jacobian(tape)
      expected_jacobian = -np.sin(a)
  
      assert isinstance(dev_jacobian, np.ndarray)
      assert dev_jacobian.shape == ()
      assert np.allclose(
          dev_jacobian, expected_jacobian, atol=tol, rtol=0
      )
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 10 for calling the TestAdjointJacobian obj's underlying member method code with example usage: obj.test_rx_gradient(tol, dev) without return types