trace_distance

forest.benchmarking.distance_measures.trace_distance(rho: numpy.ndarray, sigma: numpy.ndarray) → float

Computes the trace distance between two states rho and sigma:

\[T(\rho, \sigma) = (1/2)||\rho-\sigma||_1\]

where \(||X||_1\) denotes the 1 norm of X.

Parameters:
  • rho – Is a dim by dim positive matrix with unit trace.
  • sigma – Is a dim by dim positive matrix with unit trace.
Returns:

Trace distance which is a scalar.