class_docstr: Tests for Fidelity function between two states (state vectors or density matrix).
docstr: Test broadcasting works for fidelity and density matrices when one input is unbatched
code: def test_broadcast_dm_dm_unbatched(self, check_state, func):
      """Test broadcasting works for fidelity and density matrices when one input is unbatched"""
      state0 = func(
          [
              [[0.5, -0.5], [-0.5, 0.5]],
              [[0.5, 0.5], [0.5, 0.5]],
              [[1, 0], [0, 0]],
              [[0, 0], [0, 1]],
          ]
      )
      state1 = func([[0.5, 0.5], [0.5, 0.5]])
  
      expected = [0, 1, 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 14 for calling the TestFidelityMath obj's underlying member method code with example usage: obj.test_broadcast_dm_dm_unbatched(check_state, func) without return types