qat.quops.metrics.get_trace_distance

qat.quops.metrics.get_trace_distance(rho1, rho2)

Compute the trace distance between two density matrices.

\[ \begin{align}\begin{aligned}D (\rho_1, \rho_2) = \frac{1}{2} || \rho_1 - \rho_2 ||\\|| X || = \mathrm{Tr} \sqrt{ X^\dagger \cdot X}\end{aligned}\end{align} \]
Parameters
  • rho1 (matrix) – first matrix \(\rho_1\)

  • rho2 (matrix) – second matrix \(\rho_2\)

Returns

The trace distance \(D(\rho_1, \rho_2)\)

Return type

float