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 that the two states must act on the same number of wires
docstr_tok: ["Test","that","the","two","states","must","act","on","the","same","number","of","wires"]
code: def test_same_number_wires(self, states):
      """Test that the two states must act on the same number of wires"""
      state0, state1 = states
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The two states must have the same number of wires",
      ):
          qml.math.trace_distance(state0, state1, check_state=True)
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The two states must have the same number of wires",
      ):
          qml.math.trace_distance(state1, state0, check_state=True)
  
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 7 for calling the TestTraceDistanceMath obj's underlying member method code with example usage: obj.test_same_number_wires(states) without return types