class_docstr: Test that broadcasting works as expected for the entropy functions
class_docstr_tok: ["Test","that","broadcasting","works","as","expected","for","the","entropy","functions"]
docstr: Test broadcasting for max entropy and density matrices
docstr_tok: ["Test","broadcasting","for","max","entropy","and","density","matrices"]
code: def test_max_entropy_broadcast_dm(
      self, wires, check_state, interface
  ):
      """Test broadcasting for max entropy and density matrices"""
      density_matrix = [
          [
              [1 / 2, 0, 0, 1 / 2],
              [0, 0, 0, 0],
              [0, 0, 0, 0],
              [1 / 2, 0, 0, 1 / 2],
          ],
          [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
      ]
      expected = [np.log(2), 0]
  
      if interface:
          density_matrix = qml.math.asarray(
              density_matrix, like=interface
          )
  
      entropy = qml.math.max_entropy(
          density_matrix, wires, check_state=check_state
      )
      assert qml.math.allclose(entropy, expected)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 6 for calling the TestEntropyBroadcasting obj's underlying member method code with example usage: obj.test_max_entropy_broadcast_dm(wires, check_state, interface) without return types