class_docstr: Test the shadow_expval measurement process backward pass
class_docstr_tok: ["Test","the","shadow_expval","measurement","process","backward","pass"]
docstr: Test that the gradient of the expval estimation is correct for
  the jax interface
docstr_tok: ["Test","that","the","gradient","of","the","expval","estimation","is","correct","for","the","jax","interface"]
code: def test_backward_jax(self, obs=obs_strongly_entangled):
      """Test that the gradient of the expval estimation is correct for
      the jax interface"""
      import jax
      from jax import numpy as jnp
  
      shadow_circuit = strongly_entangling_circuit(
          3, shots=20000, interface="jax"
      )
      exact_circuit = strongly_entangling_circuit_exact(3, "jax")
  
      # make rotations close to pi / 2 to ensure gradients are not too small
      x = jnp.array(
          np.random.uniform(
              0.8,
              2,
              size=qml.StronglyEntanglingLayers.shape(
                  n_layers=2, n_wires=3
              ),
          )
      )
  
      actual = jax.jacrev(shadow_circuit)(x, obs, k=1)
      expected = jax.jacrev(exact_circuit)(x, obs)
  
      assert qml.math.allclose(actual, expected, atol=1e-1)
  
imports: import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import Shots
label_desc: Use image node_id 2 for calling the TestExpvalBackward obj's underlying member method code with example usage: obj.test_backward_jax(obs) without return types