code: def density_matrix(wires) -> "DensityMatrixMP":
      r"""Quantum density matrix in the computational basis.
  
      This function accepts no observables and instead instructs the QNode to return its density
      matrix or reduced density matrix. The ``wires`` argument gives the possibility
      to trace out a part of the system. It can result in obtaining a mixed state, which can be
      only represented by the reduced density matrix.
  
      Args:
          wires (Sequence[int] or int): the wires of the subsystem
  
      Returns:
          DensityMatrixMP: Measurement process instance
  
      **Example:**
  
      .. code-block:: python3
  
          dev = qml.device("default.qubit", wires=2)
  
          @qml.qnode(dev)
          def circuit():
              qml.PauliY(wires=0)
              qml.Hadamard(wires=1)
              return qml.density_matrix([0])
  
      Executing this QNode:
  
      >>> circuit()
      array([[0.+0.j 0.+0.j]
          [0.+0.j 1.+0.j]])
  
      The returned matrix is the reduced density matrix, where system 1 is traced out.
  
      .. note::
  
          Calculating the derivative of :func:`~pennylane.density_matrix` is currently only supported when
          using the classical backpropagation differentiation method (``diff_method="backprop"``)
          with a compatible device.
      """
      wires = Wires(wires)
      return DensityMatrixMP(wires=wires)
  
file_path: pennylane/pennylane/measurements/state.py
imports: from typing import Sequence, Optional
  import pennylane
  from pennylane.wires import Wires, WireError
  from .measurements import State, StateMeasurement
label_desc: Use image node_id 2 for calling a global function with example usage: density_matrix(wires) and returns: DensityMatrixMP