-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve docstring for unitary() & other text in unitary_protocol.py #7582
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
base: main
Are you sure you want to change the base?
Conversation
The behavior of the function `unitary()` changed with respect to NumPy array arguments. I found the docstring not clear enough during some recent debugging on another issue. I rewrote that part, then noticed inconsistencies in formatting and language elsewhehre, so ended up editing other parts of this file too.
|
Let us first converge on #7595 and then adjust the text here accordingly. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7582 +/- ##
=======================================
Coverage 99.38% 99.38%
=======================================
Files 1091 1091
Lines 97815 97815
=======================================
Hits 97214 97214
Misses 601 601 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pavoljuhas
left a comment
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.
Let us sync this with the current state of the code after #7595 - please see inline comments.
Otherwise LGTM.
| - If the value is a NumPy array, it is tested using `linalg.is_unitary()`. | ||
| If the result is `True`, the array is returned directly; if `is_unitary()` | ||
| returns `False`, a `ValueError` exception is raised. |
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.
| - If the value is a NumPy array, it is tested using `linalg.is_unitary()`. | |
| If the result is `True`, the array is returned directly; if `is_unitary()` | |
| returns `False`, a `ValueError` exception is raised. | |
| - If the value is a NumPy array, it is returned directly. |
| "\n" | ||
| "The value failed to satisfy any of the following criteria:\n" | ||
| "The given value failed to satisfy any of the following criteria:\n" | ||
| "- A NumPy array for which `linalg.is_unitary()` returned `True`.\n" |
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.
This is not checked anymore and thus not possible here.
| "- A NumPy array for which `linalg.is_unitary()` returned `True`.\n" |
The behavior of the function
unitary(…)changed with respect to NumPy array arguments. I found the docstring not clear enough during some recent debugging on another issue. I rewrote that part, then noticed inconsistencies in formatting and language elsewhehre, so ended up editing other parts of this file too.