class_docstr: Integration tests for classical shadows class
docstr: Test that a bell state can be faithfully reconstructed
code: def test_reconstruct_bell_state(self):
      """Test that a bell state can be faithfully reconstructed"""
      wires = range(2)
  
      dev = qml.device("default.qubit", wires=wires, shots=10000)
  
      @qml.qnode(dev)
      def qnode(n_wires):
          qml.Hadamard(0)
          qml.CNOT(wires=[0, 1])
          return qml.classical_shadow(wires=range(n_wires))
  
      # should prepare the bell state
      bits, recipes = qnode(2)
      shadow = ClassicalShadow(bits, recipes)
      global_snapshots = shadow.global_snapshots()
  
      state = np.sum(global_snapshots, axis=0) / shadow.snapshots
      bell_state = np.array(
          [
              [0.5, 0, 0, 0.5],
              [0, 0, 0, 0],
              [0, 0, 0, 0],
              [0.5, 0, 0, 0.5],
          ]
      )
      assert qml.math.allclose(state, bell_state, atol=1e-1)
  
      # reduced state should yield maximally mixed state
      local_snapshots = shadow.local_snapshots(wires=[0])
      assert qml.math.allclose(
          np.mean(local_snapshots, axis=0)[0],
          0.5 * np.eye(2),
          atol=1e-1,
      )
  
      # alternative computation
      bits, recipes = qnode(1)
      shadow = ClassicalShadow(bits, recipes)
      global_snapshots = shadow.global_snapshots()
      local_snapshots = shadow.local_snapshots(wires=[0])
  
      state = np.sum(global_snapshots, axis=0) / shadow.snapshots
      assert qml.math.allclose(state, 0.5 * np.eye(2), atol=1e-1)
      assert np.all(local_snapshots[:, 0] == global_snapshots)
  
imports: import pytest
  import numpy
  import pennylane
  import pennylane.numpy
  from pennylane.shadows import ClassicalShadow, median_of_means, pauli_expval
label_desc: Use image node_id 3 for calling the TestIntegrationShadows obj's underlying member method code with example usage: obj.test_reconstruct_bell_state() and returns: qml