class_docstr: Tests for the trace distance function between two states (state vectors or density matrix).
class_docstr_tok: ["Tests","for","the","trace","distance","function","between","two","states","(","state","vectors","or","density","matrix",")","."]
docstr: Test trace distance between different quantum states in batches.
docstr_tok: ["Test","trace","distance","between","different","quantum","states","in","batches","."]
code: def test_broadcast_trace_distance(
      self, states, check_state, td, func
  ):
      """Test trace distance between different quantum states in batches."""
      state0, state1 = states
      state0 = func(state0)
      state1 = func(state1)
  
      assert qml.math.allclose(
          td, qml.math.trace_distance(state0, state1, check_state)
      )
      assert qml.math.allclose(
          td, qml.math.trace_distance(state1, state0, check_state)
      )
  
file_path: pennylane/tests/math/test_trace_distance_math.py
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestTraceDistanceMath obj's underlying member method code with example usage: obj.test_broadcast_trace_distance(states, check_state, td, func) without return types