Shortcuts

qiskit.quantum_info.purity

purity(state, validate=True)[Quellcode]

Calculate the purity of a quantum state.

The purity of a density matrix \(\rho\) is

\[\text{Purity}(\rho) = Tr[\rho^2]\]
Parameter
  • state (Statevector or DensityMatrix) – a quantum state.

  • validate (bool) – check if input state is valid [Default: True]

Rückgabe

the purity \(Tr[\rho^2]\).

Rückgabetyp

float

Verursacht

QiskitError – if the input isn’t a valid quantum state.

Zu sehen ist lang: German
Sprachen
English
Japanese
German
Korean