-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add validation for Kraus operators #2271
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
Comments
One first suggestion is that we should add a testing method that checks this. My opinion is just as we don't enforce unitary returns a unitary (because checking it each time would be costly), I think we just need to make it easier for people to test that their channel is OK. |
We have routines in |
+1 for using predicate and I like the |
@peterse are you still planning to work on this? |
oops, sorry for taking so long. I'm struggling to find time to contribute so I'm going to unassign myself for now |
Keeping this before-1.0 as new validation will tighten the API. cc @95-martin-orion |
Adds a helper that tests that channel kraus operator is cptp (\sum_i A_i^\dagger A_i = I) and that has_kraus is true. Uses this on channels. Adds a helper for testing that mixture's probabilities sum to 1. Uses this on mixtures. Fixes #2271
As requested in quantumlib#4194. Can be used for quantumlib#2271. This predicate is meant to be invoked when constructing a channel to verify that the provided Kraus operators actually describe a valid quantum channel. Recommendations for cleaner `is_cptp` behavior or additional test cases are welcome.
Adds a helper that tests that channel kraus operator is cptp (\sum_i A_i^\dagger A_i = I) and that has_kraus is true. Uses this on channels. Adds a helper for testing that mixture's probabilities sum to 1. Uses this on mixtures. Fixes quantumlib#2271
As requested in quantumlib#4194. Can be used for quantumlib#2271. This predicate is meant to be invoked when constructing a channel to verify that the provided Kraus operators actually describe a valid quantum channel. Recommendations for cleaner `is_cptp` behavior or additional test cases are welcome.
Adds a helper that tests that channel kraus operator is cptp (\sum_i A_i^\dagger A_i = I) and that has_kraus is true. Uses this on channels. Adds a helper for testing that mixture's probabilities sum to 1. Uses this on mixtures. Fixes quantumlib#2271
Many of the methods involving noise/channels mention that the matrices making up a mixture or channel must satisfy \sum_{k=0}^{r-1} A_i^\dagger A_i = I. This is never enforced, which allows the user to simulate unphysical systems and get invalid density matrices (see example below).
Validation is easy enough (
assert np.sum([m.T @ m for m in object._channel_()
) but I'm not sure where to put this @Strilanc ? Ideally this will be called exactly once, before a call tosimulate
.Code Example:
which prints
The text was updated successfully, but these errors were encountered: