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

Add spectrum function to Fourier module #1378

Merged
merged 83 commits into from
Jun 11, 2021
Merged

Add spectrum function to Fourier module #1378

merged 83 commits into from
Jun 11, 2021

Conversation

mariaschuld
Copy link
Contributor

@mariaschuld mariaschuld commented May 31, 2021

Context:

Recently, PL got a new Fourier module that can be used to investigate the Fourier representation of quantum circuits. Due to unforeseen difficulties we did not merge the function that would analytically derive the Fourier spectrum from a circuit. This is a new attempt with a much simplified scope.

Description of the Change:

Adds spectrum qnode transform.

Benefits:

The new design lets users mark the gates that are considered as input-encoding gates via their id attribute. It will not try to track parameters, but simply see if the marked gates define generators, and thus support the assumptions of how to compute the Fourier spectrum directly.

@mariaschuld mariaschuld marked this pull request as draft May 31, 2021 18:09
@mariaschuld
Copy link
Contributor Author

@glassnotes this is still WIP, but maybe you want to check if the idea is sound?

@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Merging #1378 (f023d07) into master (d26a0ed) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1378   +/-   ##
=======================================
  Coverage   98.20%   98.20%           
=======================================
  Files         158      159    +1     
  Lines       11780    11832   +52     
=======================================
+ Hits        11568    11620   +52     
  Misses        212      212           
Impacted Files Coverage Δ
pennylane/fourier/__init__.py 100.00% <100.00%> (ø)
pennylane/fourier/spectrum.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 d26a0ed...f023d07. Read the comment docs.

@mariaschuld mariaschuld marked this pull request as ready for review June 2, 2021 07:17
doc/code/qml_fourier.rst Outdated Show resolved Hide resolved
doc/code/qml_fourier.rst Outdated Show resolved Hide resolved
doc/code/qml_fourier.rst Show resolved Hide resolved
pennylane/fourier/spectrum.py Outdated Show resolved Hide resolved
pennylane/fourier/spectrum.py Outdated Show resolved Hide resolved
tests/fourier/test_spectrum.py Outdated Show resolved Hide resolved
mariaschuld and others added 2 commits June 2, 2021 16:22
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
mariaschuld and others added 5 commits June 9, 2021 17:47
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Copy link
Member

@co9olguy co9olguy left a comment

Choose a reason for hiding this comment

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

Nice work!

Left a few suggestions and comments, all small, that I think would be good to consider before merging.

tests/fourier/test_spectrum.py Show resolved Hide resolved
tests/fourier/test_spectrum.py Outdated Show resolved Hide resolved
doc/code/qml_fourier.rst Outdated Show resolved Hide resolved
doc/code/qml_fourier.rst Show resolved Hide resolved
doc/code/qml_fourier.rst Show resolved Hide resolved
pennylane/fourier/spectrum.py Outdated Show resolved Hide resolved
pennylane/fourier/spectrum.py Show resolved Hide resolved
pennylane/fourier/spectrum.py Outdated Show resolved Hide resolved
pennylane/fourier/spectrum.py Show resolved Hide resolved
pennylane/fourier/spectrum.py Show resolved Hide resolved
mariaschuld and others added 10 commits June 10, 2021 13:05
Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>
Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>
Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>
Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>
Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>
@mariaschuld
Copy link
Contributor Author

Thanks @co9olguy, I hope I can convince you to not add too many more changes :)

@co9olguy co9olguy merged commit ec2a631 into master Jun 11, 2021
@co9olguy co9olguy deleted the spectrum_function branch June 11, 2021 15:28
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.

4 participants