amazon-braket / amazon-braket-algorithm-library

Apache License 2.0
91 stars 33 forks source link

quantum principal component analysis notebook added #118

Closed mlaguna10 closed 1 year ago

mlaguna10 commented 1 year ago

Issue #, if available:

Description of changes: I'm adding a new notebook under the advance_algorithms folder called 'Quantum Principal Component Analysis'. This notebook is not inteded to scale for a real case of PCA but to show (and teach) how PCA can be implemented for a specific case using quantum computing. I'm adding this PR on this repository following the suggestion made by @licedric (https://github.com/amazon-braket/amazon-braket-examples/pull/402).

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

kshyatt-aws commented 1 year ago

Thanks for the PR! I'm not sure if it's just that ReviewNB can't render your LaTeX properly, or whether there are syntax issues in the notebook itself. I had a few copyediting concerns but overall I think this is well on the way there.

mlaguna10 commented 1 year ago

Hi Katharine! Thanks for your time and effort.

All your feedback was included in the notebook under the new commit (https://github.com/aws-samples/amazon-braket-algorithm-library/pull/118/commits/0161ace169bbe1a5aaf2abb0b131c254ce938e6f).

Apparently it's just that ReviewNB can't render the LaTeX properly, I saw the LaTex correctly on the notebook on Amazon Braket and also on my laptop using VSCode.

Have a great day!

mlaguna10 commented 1 year ago

Feedback included. I agree with you about removing the DM1 use since there is not noise in this scenario. About the subroutines or loops inside the circuit I think it's not that easy because there are not exactly the same each pair of instructions because there are always some differential gates between some pair of instructions.

mlaguna10 commented 1 year ago

I forgot to update the conclusions final part to remove the DM1 use. Done.

mbeach-aws commented 1 year ago

@mlaguna10 Overall, it's looking really good, thanks for this contribution! I left a few minor comments

mlaguna10 commented 1 year ago

All the new feedback was included. Let me know what you think! :)

AbeCoull commented 1 year ago

Tests are failing as the returned results are mocked out.

For example, the grover results are mocked here. These are used by the test setup mock here.

Let me know if there are any questions around this process!

mlaguna10 commented 1 year ago

Integ tests for the quantum pca and the results were added in the last commit. Thanks Abe!

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (main@70542a7). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #118 +/- ## ======================================== Coverage ? 100.00% ======================================== Files ? 26 Lines ? 1028 Branches ? 181 ======================================== Hits ? 1028 Misses ? 0 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.