-
Notifications
You must be signed in to change notification settings - Fork 575
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
Rename get_matrix
/get_eigvals
to matrix
/eigvals
and remove properties with same name
#2498
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #2498 +/- ##
==========================================
- Coverage 99.48% 99.47% -0.01%
==========================================
Files 243 243
Lines 19432 19413 -19
==========================================
- Hits 19331 19312 -19
Misses 101 101
Continue to review full report at Codecov.
|
doc/development/adding_operators.rst
Outdated
[ 1 -1] | ||
|
||
|
||
|
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 am not sure why these sections show as "added", when only the >>> op.eigvals()
line was changed...
I'm not quite sure what codecov is complaining about, since I only renamed and deleted code... |
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.
A very nice, straightforward PR to review! Only comment is regarding the decomposition, which should also be mentioned in the changelog
* The properties `eigval` and `matrix` from the `Operator` class were replaced with the | ||
methods `eigval()` and `matrix(wire_order=None)`. | ||
[(#2498)](https://github.com/PennyLaneAI/pennylane/pull/2498) |
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.
👍
Codecov seems to complain about having less code, not more uncovered code...will overwrite |
Context:
To make the transition from
op.matrix
toop.matrix()
smoother, we used the temporary nameget_matrix
for the latter for 2 release cycles. The same is true forop.eigvals
. This PR removes the property and introduces the final name.Description of the Change:
As a tangential extra, I also removed the warning that
decomposition
now is a method, which has been in the code base for a lot of releases now.Benefits:
Finalises implementations of the operator refactor. Using methods gives us a lot more flexibility (i.e. to have
matrix()
takewire_order
as an argument, and makes explicit that heavy computations may be executed.Possible Drawbacks:
User code relying on the properties breaks now.