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

Hyper efficient and more accurate diamond norm implementation #12341

Open
owenagnel opened this issue May 4, 2024 · 2 comments · May be fixed by #12343
Open

Hyper efficient and more accurate diamond norm implementation #12341

owenagnel opened this issue May 4, 2024 · 2 comments · May be fixed by #12343
Labels
mod: quantum info Related to the Quantum Info module (States & Operators) type: feature request New feature or request

Comments

@owenagnel
Copy link

owenagnel commented May 4, 2024

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. Qiskit currently implements the diamond norm using the semi-definite program formulation in [3]. Although elegant, this approach to calculating the diamond norm 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 implementation 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 Qiskit's current more general implementation. First, I do not use the Choi representation of the quantum channel, whose size increases faster than the unitary matrix representation. Second, there is no need to solve a complicated semi-definite program (meaning I can do away with the cvxpy dependency).

This method has the additional advantage of being more accurate than current implementation. I have tested the implementation for several cases where an analytical formula of the diamond norm exists. On average I have found the qiskit implementation has an average absolute error of 5.9168E-07 compared to 2.7645E-10.

Empirical testing

Results of empirical testing on my machine are reported below

1 qubit 2 qubit 3 qubit 4 qubit
qiskit implementation 8.14 ms 54.5 ms 5.22 s 3min 21s
hyper-efficient implementation 534 µs 696 µs 924 µs 1.11 ms

Proposition

Given the popularity of the circuit model and unitary-based quantum computation, I believe this implementation of the diamond distance for unitaries would be incredibly valuable for the research community. Given the minimal amount of effort required for such an implementation (40 lines of code), I think it would be a simple and worthwhile addition to qiskit.

I would love feedback and comments on how best to approach this implementation in qiskit (as I am unfamiliar with how the library is structured).

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.

@owenagnel owenagnel added the type: feature request New feature or request label May 4, 2024
@owenagnel owenagnel changed the title Hyper efficient and accurate more diamond norm Hyper efficient and more accurate diamond norm implementation May 4, 2024
@kevinsung kevinsung added the mod: quantum info Related to the Quantum Info module (States & Operators) label May 5, 2024
@kevinsung
Copy link
Contributor

Sounds really interesting! Could you link us to your masters thesis so we can see the algorithm and proof?

As for the implementation, perhaps you can add a function called diamond_distance_unitary to measures.py, which accepts the two unitaries and outputs the distance.

@owenagnel owenagnel linked a pull request May 5, 2024 that will close this issue
@owenagnel
Copy link
Author

Hi Kevin! Thanks, have opened a PR (work in progress) for this feature addition. I'm actually still working on the thesis, should be able to send a nice proof in a couple days. The PR can is linked here #12343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: quantum info Related to the Quantum Info module (States & Operators) type: feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants