Skip to content
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

Implement SpectralNormError #5154

Merged
merged 60 commits into from
Mar 5, 2024
Merged

Conversation

AmintorDusko
Copy link
Contributor

@AmintorDusko AmintorDusko commented Feb 5, 2024

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    test directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the doc/releases/changelog-dev.md file, summarizing the
    change, and including a link back to the PR.

  • The PennyLane source code conforms to
    PEP8 standards.
    We check all of our code against Pylint.
    To lint modified files, simply pip install pylint, and then
    run pylint pennylane/path/to/file.py.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.63%. Comparing base (f9bdb32) to head (f4e6d49).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5154      +/-   ##
==========================================
- Coverage   99.65%   99.63%   -0.02%     
==========================================
  Files         399      400       +1     
  Lines       36901    36781     -120     
==========================================
- Hits        36774    36648     -126     
- Misses        127      133       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AmintorDusko
Copy link
Contributor Author

[sc-55156]

@AmintorDusko
Copy link
Contributor Author

[sc-55156]

@AmintorDusko AmintorDusko marked this pull request as ready for review February 15, 2024 18:39
Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AmintorDusko, looks good already. Left minor comments and questions.

pennylane/math/multi_dispatch.py Outdated Show resolved Hide resolved
pennylane/math/multi_dispatch.py Outdated Show resolved Hide resolved
pennylane/math/multi_dispatch.py Show resolved Hide resolved
pennylane/resource/error.py Outdated Show resolved Hide resolved
pennylane/resource/error.py Outdated Show resolved Hide resolved
pennylane/resource/error.py Outdated Show resolved Hide resolved
tests/resource/test_error.py Show resolved Hide resolved
tests/resource/test_error.py Outdated Show resolved Hide resolved
AmintorDusko and others added 7 commits February 16, 2024 08:56
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Copy link
Contributor

@Jaybsoni Jaybsoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments left to be addressed, then it's ready to go! Great work 💯

Copy link
Contributor

@DSGuala DSGuala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Will play around a little bit more with the functionality and leave a final review.

pennylane/resource/error.py Outdated Show resolved Hide resolved
pennylane/resource/error.py Outdated Show resolved Hide resolved
pennylane/resource/__init__.py Outdated Show resolved Hide resolved
@soranjh soranjh self-requested a review February 29, 2024 22:47
@DSGuala DSGuala requested review from DSGuala and Jaybsoni March 4, 2024 16:17
@trbromley trbromley self-requested a review March 4, 2024 16:17
Copy link
Contributor

@DSGuala DSGuala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go from my end. My main feedback is that it will be good to have some more examples in the main resource.__init__ page. It took me some time to set up a custom ErrorOperation with SpectralNormError. But we can address this as we add more features, no need to include it in this PR.

Copy link
Contributor

@Jaybsoni Jaybsoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

pennylane/resource/error.py Outdated Show resolved Hide resolved
pennylane/resource/error.py Outdated Show resolved Hide resolved
pennylane/resource/error.py Outdated Show resolved Hide resolved
soranjh and others added 5 commits March 5, 2024 10:47
@AmintorDusko AmintorDusko merged commit 317e039 into master Mar 5, 2024
40 checks passed
@AmintorDusko AmintorDusko deleted the implement/SpectralNormError branch March 5, 2024 21:39
@AmintorDusko
Copy link
Contributor Author

Thank you, @soranjh, @Jaybsoni, @DSGuala and @trbromley!

>>> s1 = SpectralNormError(0.01)
>>> s2 = SpectralNormError(0.02)
>>> s1.combine(s2)
<SpectralNormError(0.03)>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can update this one in a follow up PR to remove the angle brackets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants