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

Added Oversampling Feature #84

Merged
merged 22 commits into from
Feb 13, 2025
Merged

Added Oversampling Feature #84

merged 22 commits into from
Feb 13, 2025

Conversation

stroblme
Copy link
Member

@stroblme stroblme commented Feb 11, 2025

This PR introduces oversampling for the frequency and time domain.
It also allows applying fftshift to get a properly ordered spectrogram.
With this implementation we move away from the pennylane reference (as the api is too limited).
However, we still have a test in place, to ensure that nothing is faulty with our implementation.
As the method now returns coefficients and frequencies, it was renamed to get_spectrum.
With the new oversampling feature, it can happen, that the spectrum has an even length, which would result in a slightly shifted spectrum afterwards. To mitigate this a trim argument was introduced that removes the Nyquist frequency.
This PR also introduces a get_psd method to calculate the power spectral density of a set of given coefficients.

  • add test to check against pennylane implementation
  • add test to verify oversampling (time domain)
  • add test to verify oversampling (frequency domain)
  • add test to check that frequencies match coefficients length
  • add documentation and notebook

Breaking Changes

  • renamed sample_coefficients to get_spectrum

Melvin Strobl added 6 commits February 11, 2025 11:06
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
doc
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
@stroblme stroblme marked this pull request as ready for review February 11, 2025 15:37
@stroblme stroblme requested a review from majafranz February 11, 2025 15:38
Melvin Strobl added 13 commits February 12, 2025 14:10
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
@stroblme
Copy link
Member Author

stroblme commented Feb 13, 2025

d537b8d tests failed because of some import errors with pennylane lightning

Copy link
Collaborator

@majafranz majafranz left a comment

Choose a reason for hiding this comment

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

Really good work! LGTM.

Melvin Strobl added 2 commits February 13, 2025 17:11
Signed-off-by: Melvin Strobl <lc3267@kit.edu>
@stroblme stroblme merged commit 41ca1eb into main Feb 13, 2025
4 checks passed
@stroblme stroblme deleted the coefficients-calculation branch February 13, 2025 16:12
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.

2 participants