-
Notifications
You must be signed in to change notification settings - Fork 377
Improve Amplitude Estimation Algos and Tests #788
Conversation
this is consistent with the naming in amplitude estimation also remove self._m since never used
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.
- Naming changes:
- log_max_evals to m seems like going from a meaningful naming to non-descript
- ci_method to confint_method seems like it adds little for a user to help them
both the above break compatibility for what does not seem substantial value.
-
Ordering of parameter changes - seems the intent is to have all the Amplitude Estimation algos have same order of a/q_factory and i_objective but original AE is still not there
-
Variable naming exception 'ae' to be removed that was added to list - use 'qae' in the unit test
Thanks for the review!
I renamed it to
As discussed, I'm leaving this since we have breaking changes through reordering the input arguments to a consistent order.
Thanks! They all have the same order now.
Changed to Also I changed the tests that checked the number of gates by a check for the unitary the circuit produces. Comparing the circuits directly didn't work, since this doesn't capture things such as |
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.
Approved, but please address renaming comment for the QPE-based AE.
@@ -36,26 +35,36 @@ | |||
|
|||
|
|||
class AmplitudeEstimation(AmplitudeEstimationAlgorithm): |
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.
Can we rename this to be QPEAmplitudeEstimation, and say in the comment on line 38 that this is "The original, Quantum Phase Estimation-based Amplitude Estimation Algorithm."? I think it may be strange to have one algorithm called AmplitudeEstimation but then a base class called AmplitudeEstimationAlgorithm. It would be better to be descriptive. If so, we should also rename the file qpe_ae.py, yes?
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.
The alternative might be to rename the base class, which would be less disruptive - otherwise notebooks, test cases and any users code would need to alter too. I do not know how much, or if at all, externally that base class type might be used at present outside of the package. I suspect it could be renamed without the same impact as the algorithm derived from it.
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.
AmplitudeEstimation
is used quite a bit in notebooks (and our codes), I also prefer to keep it. As discussed on Slack I'll update the the docstring though.
Thanks Julien, I agree that the docstring should suffice. |
…ests Improve Amplitude Estimation Algos and Tests
Summary
Add more detailed tests, fix tiny bugs, improve comments and docstrings.
Details and comments
0
in the evaluation schedule.