class_docstr: Tests for Fidelity function between two states (state vectors or density matrix).
docstr: Test that the two states must act on the same number of wires
code: def test_same_number_wires_dm(self):
      """Test that the two states must act on the same number of wires"""
      state0 = np.diag([0, 1, 0, 0])
      state1 = [[1, 0], [0, 0]]
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The two states must have the same number of wires",
      ):
          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 10 for calling the TestFidelityMath obj's underlying member method code with example usage: obj.test_same_number_wires_dm() without return types