-
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
Suggested improvements for average gate fidelity and process fidelity #1703
Comments
@fhopfmueller Thank you for looking into these various issues! PRs would be very much appreciated. Perhaps lets do separate PRs for the tests, then I would like to release 4.7 in the not too distance future, so one option is to target dev.major / 5 directly (in which case the tests are already fixed). |
Hi @hodgestar , sounds good! I submitted the first PR for the tests. |
Closing this since the last PR has been merged. Thanks for your advice and help, @Ericgig @hodgestar ! |
Hello,
I have some suggestions for improvements in some functions in
metrics.py
. I'd be happy to put together a PR.The current implementation of
average_gate_fidelity
is based on the Kraus representation of the input quantum channel. If the input is a superoperator, it is first converted to its Kraus representation (involving diagonalization) before computing the average gate fidelity, which sacrifices performance and accuracy. There is a direct formula starting from a superoperator, see, e.g., https://qiskit.org/documentation/stubs/qiskit.quantum_info.average_gate_fidelity.html relating the average gate fidelity to the process fidelity, and https://qiskit.org/documentation/stubs/qiskit.quantum_info.process_fidelity.html#qiskit.quantum_info.process_fidelity to compute that from a superoperator. I think it would be better to use that direct formula if the input is not already in Kraus form!There is also a function
process_fidelity
in Qutip, but I'm having a hard time understanding what it's intended for. It doesn't seem to be the process fidelity explained in the Qiskit docs above. The arguments of Qutip'sprocess_fidelity
are calledU1
andU2
suggesting they are expected to be unitary, but this is not checked. It is computed as(U1 * U2).tr()
, which is not between 0 and 1, and doesn't give 1 as I'd expect ifU1==U2
. Does someone know the intended use of that function? If not, I'd implement the process fidelity as described in the Qiskit docs here, with several version depending on whether the input is Kraus, a superoperator, and maybe a chi matrix.Lastly, there is an issue with the tests - the lines
actually skip all the tests in the file if cvxpy is not available, not just the ones in the
Test_dnorm
class. The test output, ifcvxpy
is not installed, isThat issue seems to be addressed on the dev.major branch. Would it make sense to take the test file from there and use it in the master branch also?
Thanks!
The text was updated successfully, but these errors were encountered: