qiskit.quantum_info.DensityMatrix.purity¶ DensityMatrix.purity()[source]¶ Return the purity of the quantum state.