class_docstr: Measurement process that computes the purity of the system prior to measurement.
  
  Please refer to :func:`purity` for detailed documentation.
  
  Args:
      wires (.Wires): The wires the measurement process applies to.
      id (str): custom label given to a measurement instance, can be useful for some
          applications where the instance has to be identified
code: def process_state(self, state: Sequence[complex], wire_order: Wires):
      wire_map = dict(zip(wire_order, list(range(len(wire_order)))))
      indices = [wire_map[w] for w in self.wires]
      state = qml.math.dm_from_state_vector(state)
      return qml.math.purity(
          state, indices=indices, c_dtype=state.dtype
      )
  
file_path: pennylane/pennylane/measurements/purity.py
imports: from typing import Sequence, Optional
  import pennylane
  from pennylane.wires import Wires
  from .measurements import StateMeasurement, Purity
label_desc: Use image node_id 5 for calling the PurityMP obj's underlying member method code with example usage: obj.process_state(state, wire_order) and returns: qml