forest-benchmarking icon indicating copy to clipboard operation
forest-benchmarking copied to clipboard

distace_measures.trace_distance uses the wrong matrix norm

Open marcusps opened this issue 1 year ago • 0 comments

The trace distance is given by $T(\rho, \sigma) = (1/2)|\rho-\sigma|_1$ where $|\cdot|_1$ is the Schatten 1-norm (as correctly indicated in the docs).

In the implementation, however, a call is made to numpy.linalg.norm(rho - sigma, 1), which uses the matrix norm induced by the vector 1-norm (i.e., the maximum absolute column sum).

Instead the implementation should call numpy.linalg.norm(rho - sigma, 'nuc') to compute the nuclear norm (synonymous with the Schatten 1-norm).

marcusps avatar Oct 31 '24 16:10 marcusps