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

Generalize Rotosolve to arbitray-frequency QNodes #2081

Merged
merged 23 commits into from
Jan 12, 2022
Merged

Conversation

dwierichs
Copy link
Contributor

This implements the generalization of Rotosolve to arbitrary frequencies, further extending its use cases.
The last generalization #1489 allowed for arbitrary integer-valued frequencies, now any frequency spectra can be tackled.

RotosolveOptimizer makes use of qml.fourier.reconstruct to obtain analytical reconstructions of univariate restrictions of the QNode of interest, and then minimizes this analytical reconstruction, using numerical methods in general and an analytic expression for the minimum for single-frequency functions.

This implements #2058.

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@dwierichs
Copy link
Contributor Author

[sc-9758]

@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Merging #2081 (928ce2d) into master (c9211f8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2081   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files         226      226           
  Lines       17380    17388    +8     
=======================================
+ Hits        17239    17247    +8     
  Misses        141      141           
Impacted Files Coverage Δ
pennylane/fourier/reconstruct.py 100.00% <100.00%> (ø)
pennylane/math/multi_dispatch.py 100.00% <100.00%> (ø)
pennylane/optimize/rotosolve.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9211f8...928ce2d. Read the comment docs.

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Thanks @dwierichs, this is a great PR to finish the work we started last year on Fourier analysis of variational circuits!

Very nice documentation and logic. I think this is very near merge-ready, the only reason I request changes is

  • consider adding a default optimization method to reduce complexity for end-users
  • so that we can be clear regarding breaking changes in the changelog 🙂

doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md Show resolved Hide resolved
doc/releases/changelog-dev.md Show resolved Hide resolved
doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
pennylane/optimize/rotosolve.py Outdated Show resolved Hide resolved
pennylane/optimize/rotosolve.py Outdated Show resolved Hide resolved
pennylane/optimize/rotosolve.py Show resolved Hide resolved
tests/optimize/test_optimize.py Show resolved Hide resolved
tests/optimize/test_rotosolve.py Show resolved Hide resolved
Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Great work @dwierichs 🙌

doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md Show resolved Hide resolved
@dwierichs dwierichs merged commit e7635a3 into master Jan 12, 2022
@dwierichs dwierichs deleted the gen-rotosolve-2 branch January 12, 2022 08:52
@josh146 josh146 mentioned this pull request Feb 4, 2022
11 tasks
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.

Implement Rotosolve for non-equidistant frequencies in the cost function
2 participants