class_docstr: Test the shadow_expval measurement process forward pass
class_docstr_tok: ["Test","the","shadow_expval","measurement","process","forward","pass"]
docstr: Test that the expval estimation is correct for a uniform
  superposition of qubits
docstr_tok: ["Test","that","the","expval","estimation","is","correct","for","a","uniform","superposition","of","qubits"]
code: def test_hadamard_expval(
      self, k=1, obs=obs_hadamard, expected=expected_hadamard
  ):
      """Test that the expval estimation is correct for a uniform
      superposition of qubits"""
      circuit = hadamard_circuit(3, shots=100000)
      actual = circuit(obs, k=k)
  
      assert actual.shape == (len(obs_hadamard),)
      assert actual.dtype == np.float64
      assert qml.math.allclose(actual, expected, atol=1e-1)
  
imports: import copy
  import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, Shots
  from pennylane.measurements.classical_shadow import ShadowExpvalMP
label_desc: Use image node_id 1 for calling the TestExpvalForward obj's underlying member method code with example usage: obj.test_hadamard_expval(k, obs, expected) without return types