class_docstr: Tests for creating a density matrix from state vectors.
class_docstr_tok: ["Tests","for","creating","a","density","matrix","from","state","vectors","."]
docstr: Test entropy for different density matrices.
docstr_tok: ["Test","entropy","for","different","density","matrices","."]
code: def test_density_matrices_entropy(
      self, density_matrix, pure, wires, base, check_state, interface
  ):
      """Test entropy for different density matrices."""
      if interface:
          density_matrix = qml.math.asarray(
              density_matrix, like=interface
          )
  
      entropy = qml.math.vn_entropy(
          density_matrix, wires, base, check_state
      )
  
      if pure:
          expected_entropy = 0
      else:
          expected_entropy = np.log(2) / np.log(base)
  
      assert qml.math.allclose(entropy, expected_entropy)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestVonNeumannEntropy obj's underlying member method code with example usage: obj.test_density_matrices_entropy(density_matrix, pure, wires, base, check_state, interface) without return types