class_docstr: Tests for entropies in ClassicalShadow class
class_docstr_tok: ["Tests","for","entropies","in","ClassicalShadow","class"]
docstr: Test for state with constant eigenvalues of reduced state that all entropies are the same
docstr_tok: ["Test","for","state","with","constant","eigenvalues","of","reduced","state","that","all","entropies","are","the","same"]
code: def test_constant_distribution(self, n_wires, base):
      """Test for state with constant eigenvalues of reduced state that all entropies are the same"""
  
      bits, recipes = max_entangled_circuit(wires=n_wires)()
      shadow = ClassicalShadow(bits, recipes)
  
      entropies = [
          shadow.entropy(wires=[0], alpha=alpha, base=base)
          for alpha in [1, 2, 3]
      ]
      assert np.allclose(entropies, entropies[0], atol=1e-2)
      expected = np.log(2) / np.log(base)
      assert np.allclose(entropies, expected, atol=2e-2)
  
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 1 for calling the TestShadowEntropies obj's underlying member method code with example usage: obj.test_constant_distribution(n_wires, base) without return types