class_docstr: Tests for the (reduced) density matrix for QNodes returning states.
docstr: Test that density matrix is correct with custom wire labels
docstr_tok: ["Test","that","density","matrix","is","correct","with","custom","wire","labels"]
code: def test_density_matrix_wire_labels(self, device, angle, tol):
      """Test that density matrix is correct with custom wire labels"""
      wires = ["a", 8]
      dev = qml.device(device, wires=wires)
  
      @qml.qnode(dev)
      def circuit(x):
          qml.PauliX(wires=wires[0])
          qml.IsingXX(x, wires=wires)
          return qml.state()
  
      dm0 = qml.qinfo.reduced_dm(circuit, wires=[wires[0]])(angle)
      dm1 = qml.qinfo.reduced_dm(circuit, wires=[wires[1]])(angle)
  
      exp0 = np.array(
          [[np.sin(angle / 2) ** 2, 0], [0, np.cos(angle / 2) ** 2]]
      )
      exp1 = np.array(
          [[np.cos(angle / 2) ** 2, 0], [0, np.sin(angle / 2) ** 2]]
      )
  
      assert np.allclose(exp0, dm0, atol=tol)
      assert np.allclose(exp1, dm1, atol=tol)
  
file_path: pennylane/tests/qinfo/test_reduced_dm.py
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 3 for calling the TestDensityMatrixQNode obj's underlying member method code with example usage: obj.test_density_matrix_wire_labels(device, angle, tol) and returns: qml