class_docstr: Tests for the density matrix function
class_docstr_tok: ["Tests","for","the","density","matrix","function"]
docstr: Test that the correct density matrix for an example with a mixed
  state when using custom wires
docstr_tok: ["Test","that","the","correct","density","matrix","for","an","example","with","a","mixed","state","when","using","custom","wires"]
code: def test_custom_wire_labels_all_wires(self, wires, dev_name):
      """Test that the correct density matrix for an example with a mixed
      state when using custom wires"""
      dev = qml.device(dev_name, wires=wires)
  
      @qml.qnode(dev)
      def func():
          qml.Hadamard(wires[0])
          qml.CNOT(wires=[wires[0], wires[1]])
          return qml.density_matrix(wires=[wires[0], wires[1]])
  
      density = func()
  
      assert np.allclose(
          np.array(
              [
                  [0.5 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j, 0.5 + 0.0j],
                  [0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j],
                  [0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j],
                  [0.5 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j, 0.5 + 0.0j],
              ]
          ),
          density,
      )
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices import DefaultQubitLegacy
  from pennylane.measurements import State, Shots, density_matrix, expval, state
label_desc: Use image node_id 18 for calling the TestDensityMatrix obj's underlying member method code with example usage: obj.test_custom_wire_labels_all_wires(wires, dev_name) and returns: qml