class_docstr: Tests for Fidelity function between two states (state vectors or density matrix).
docstr: Test broadcasting works for fidelity and density matrices
code: def test_broadcast_dm_dm(self, check_state, func):
      """Test broadcasting works for fidelity and density matrices"""
      state0 = func(
          [
              [[1, 0], [0, 0]],
              [[0, 0], [0, 1]],
              [[1, 0], [0, 0]],
              [[0, 0], [0, 1]],
          ]
      )
      state1 = func(
          [
              [[0.5, 0], [0, 0.5]],
              [[0.5, 0], [0, 0.5]],
              [[0.5, 0.5], [0.5, 0.5]],
              [[0.5, 0.5], [0.5, 0.5]],
          ]
      )
      expected = [0.5, 0.5, 0.5, 0.5]
  
      fidelity = qml.math.fidelity(state0, state1, check_state)
      assert qml.math.allclose(fidelity, expected)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 13 for calling the TestFidelityMath obj's underlying member method code with example usage: obj.test_broadcast_dm_dm(check_state, func) without return types