class_docstr: Tests for entropies in ClassicalShadow class
class_docstr_tok: ["Tests","for","entropies","in","ClassicalShadow","class"]
docstr: Test entropies on analytic results
docstr_tok: ["Test","entropies","on","analytic","results"]
code: def test_analytic_entropy(self, interface):
      """Test entropies on analytic results"""
      dev = qml.device("default.qubit", wires=2, shots=100000)
  
      @qml.qnode(dev, interface=interface)
      def circuit():
          qml.IsingXX(0.5, wires=[0, 1])
          return qml.classical_shadow(wires=range(2))
  
      param = 0.5
      bits, recipes = circuit()
      shadow = qml.ClassicalShadow(bits, recipes)
  
      # explicitly not use pytest parametrize to reuse the same measurements
      for alpha in [1, 2, 3]:
          for base in [2, np.exp(1)]:
              for reduced_wires in [[0], [1]]:
                  entropy = shadow.entropy(
                      wires=reduced_wires, base=base, alpha=alpha
                  )
  
                  expected_entropy = expected_entropy_ising_xx(
                      param, alpha
                  ) / np.log(base)
  
                  assert qml.math.allclose(
                      entropy, expected_entropy, atol=1e-1
                  )
  
file_path: pennylane/tests/shadow/test_shadow_entropies.py
imports: import pytest
  import pennylane
  import pennylane.numpy
  from pennylane.shadows import ClassicalShadow
  from pennylane.shadows.classical_shadow import _project_density_matrix_spectrum
label_desc: Use image node_id 3 for calling the TestShadowEntropies obj's underlying member method code with example usage: obj.test_analytic_entropy(interface) and returns: qml