Closed mrossinek closed 1 year ago
Totals | |
---|---|
Change from base Build 6323000347: | 0.01% |
Covered Lines: | 8707 |
Relevant Lines: | 10038 |
In FermionicOp there is a note in index_order
method that pertains to simplify. Would it be better in conjunction with this to more have a note in simplify
so if you look at the subclass simplify
docs you have an idea of the other methods that can be called first to potentially allow simplify to further reduce things. At present, both it and VibrationalOp inherit the SparseLabelOp simplify docstring that was updated here - so it would mean adding something for them - which BosonicOp already seems to do as it has further details there pertinent to that sub-class.
I tried to find a solution which does not require duplicating the simplify
docstring into the subclasses in order to append to it.
If you feel this solution is not sufficient, we can do that though.
I certainly would not suggest duplicating the entire thing - of course the args bit one has too and a sentence describing it. This is pretty much what BosonicOp.simplify() has plus some extra specific notes for that operator - it does not inherit the parent class docstring unlike FermionicOp or VibrationalOp. It is a bit extra work to do this for simplify but it could save the user going around other methods in the class to see if they would help - like index_order for example may do. I'll leave it to you - I'll approve this since in improves what it states - anything further like I was suggesting can always be done later since its "just docs".
I actually had overlooked that BosonicOp.simplify
already has a custom docstring. I will take another look on how to improve things :+1:
Okay, I did end up duplicating them but this allows a proper linking to the index_order
method.
I did consider adding index_order
as an abstractmethod to SparseLabelOp
(because it is implemented by all of its subclasses anyways) but I was not confident that we really want to enforce this.
Since this is "just docs" lets leave it as a PR that really affects "just docs".
I also took the note regarding the difference between simplify
and chop
which we had in the BosonicOp
docstring and made sure we have this everywhere.
Summary
Closes #1260
Details and comments