-
Notifications
You must be signed in to change notification settings - Fork 621
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
Improve dnorm efficiency in unitary case #2416
Conversation
Note to reviewers:
|
Thanks for tackling this (I think) long-standing too. I haven't done a thorough check but on a first pass it looks like a great improvement. |
Thanks for reviewing! Sounds good, will make those changes ASAP. Quick disclaimer, I can't seem to install |
That's fine. The CI pipeline does test with cvxpy. |
Made another quick change. We know from Prop. 3.44 of (Watrous, 2018) that the diamond norm of CPTP channel is 1. So I added a quick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will let @hodgestar re-review and merge, but looks good to me.
Thank you.
Thanks for reviewing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for this. I made some suggestions largely to clarify things.
Could you also add a test to the dnorm tests in test_metrics
that explicitly tests the unitary case using rand_unitary
to generate A and B?
Please also check my suggestions -- I am definitely not infallible! |
Should have addressed all these, all very good suggestions! Thanks for reviewing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two tiny suggestions and then it looks good.
Hi @Ericgig and @hodgestar. As it's the first time I've contributed, I was curious what the process is to merge. Do you wait for a new release or is it merged to |
@owenagnel Thank you for an excellent contribution. Merged to master. |
Thanks both @hodgestar and @Ericgig for the very timely and helpful reviews! |
Preliminaries
The diamond norm [1] is a commonly used metric in quantum information theory for calculating the distance between two quantum channels. It has a number of useful properties making it the gold standard [2] in the field for several applications. In general, a complex semidefinite program is required to calculate the diamond norm. Although elegant, this approach is very inefficient. Unfortunately, no alternative method has been discovered for calculating the diamond norm in the general case of CPTP channels.
However, in the special case where we are trying to calculate the difference between two unitary channels, a very efficient implementation exists. This makes use of an unproved theorem on page 29 of [1]. I have proved this theorem and elaborated an efficient algorithm to calculate the diamond distance between two unitaries as part of my masters thesis.
The current qutip implementation makes use of the semi-definite program formulation in [3] and only uses a simplified calculation on 2 qubit unitary differences.
The implementation of this novel approach is very simple - the hardest step involves diagonalising a unitary. Although time complexity is still exponential in the number of qubits, this implementation is far more efficient than the more general implementation. The Choi representation of the quantum channel isn't used and there is no need to solve a complicated semi-definite program (meaning I can do away with the
cvxpy
dependency).Empirical testing
Results of empirical testing on my machine are reported below
Proposition
Given the popularity of the circuit model and unitary-based quantum computation, I believe a very efficient implementation of the diamond distance for unitaries would be incredibly valuable for the research community. Given how simple the change is (current tests already cover the test case), I think it would be a simple and worthwhile addition to qutip.
Citations
[1] D. Aharonov, A. Kitaev, and N. Nisan, “Quantum circuits with mixed states,” in Proceedings of the thirtieth annual ACM symposium on Theory of computing, pp. 20–30, 1998.
[2] A. Gilchrist, N. K. Langford, and M. A. Nielsen, “Distance measures to compare real and ideal quantum processes,” Physical Review A, vol. 71, no. 6, p. 062310, 2005
[3] J. Watrous, “Simpler semidefinite programs for completely bounded norms,” arXiv preprint arXiv:1207.5726, 2012.