class_docstr: Tests for Fidelity function between two states (state vectors or density matrix).
docstr: Test that a message is raised when the density matrix does not have the right trace.
code: def test_density_matrix_wrong_trace(self, state0, state1):
      """Test that a message is raised when the density matrix does not have the right trace."""
      with pytest.raises(
          ValueError,
          match="The trace of the density matrix should be one",
      ):
          qml.math.fidelity(state0, state1, check_state=True)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 6 for calling the TestFidelityMath obj's underlying member method code with example usage: obj.test_density_matrix_wrong_trace(state0, state1) without return types