Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distace_measures.trace_distance uses the wrong matrix norm #242

Open
marcusps opened this issue Oct 31, 2024 · 0 comments · May be fixed by #243
Open

distace_measures.trace_distance uses the wrong matrix norm #242

marcusps opened this issue Oct 31, 2024 · 0 comments · May be fixed by #243

Comments

@marcusps
Copy link
Contributor

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 added a commit to marcusps/forest-benchmarking that referenced this issue Oct 31, 2024
Fix rigetti#242 by replacing call to `numpy.linalg.norm(x,1)` with `numpy.linalg.norm(x,'nuc')`
@marcusps marcusps linked a pull request Oct 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant