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 real_gaussian_integral function #371

Merged
merged 37 commits into from
Apr 15, 2024
Merged

Conversation

sylviemonet
Copy link
Contributor

@sylviemonet sylviemonet commented Mar 22, 2024

Context: Add the code for real_gaussian_integral to help the from_quadrature() function.

Description of the Change: The mathematical formula corresponds to the one on the overleaf Appendix.

TODO list:

  • Add a test for this? (No idea how to test this.)
  • Move the complex gaussian integral into this file as well?

Benefits: We can deal with the basis change with a real integral.

Possible Drawbacks: We may need a for loop outside to loop on the integral with different values of b. (Need to be discussed!)

Related GitHub Issues:

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.01%. Comparing base (fbb6479) to head (c095dfe).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #371      +/-   ##
===========================================
- Coverage    87.25%   87.01%   -0.24%     
===========================================
  Files           79       80       +1     
  Lines         5956     5978      +22     
===========================================
+ Hits          5197     5202       +5     
- Misses         759      776      +17     
Files Coverage Δ
mrmustard/physics/bargmann.py 100.00% <ø> (ø)
mrmustard/physics/gaussian_integrals.py 100.00% <100.00%> (ø)
mrmustard/physics/representations.py 99.44% <100.00%> (ø)

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@SamFerracin
Copy link
Contributor

Nice!

  • Why don't you leave it in bargmann.py, alongside the complex gaussian integral? I think it makes sense there
  • Tests: I would just do as in test_complex_gaussian_integral, where you pass a triple and check that the result is the one you expect (but you may have to hardcode A3, b3, c3, instead of getting them from another triple

@sylviemonet sylviemonet requested a review from ziofil March 28, 2024 05:43
mrmustard/physics/utils.py Outdated Show resolved Hide resolved
mrmustard/physics/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@ziofil ziofil left a comment

Choose a reason for hiding this comment

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

great!

mrmustard/physics/gaussian_integrals.py Outdated Show resolved Hide resolved
mrmustard/physics/gaussian_integrals.py Outdated Show resolved Hide resolved
mrmustard/physics/gaussian_integrals.py Outdated Show resolved Hide resolved
mrmustard/physics/gaussian_integrals.py Outdated Show resolved Hide resolved
@ziofil ziofil closed this Apr 12, 2024
@ziofil ziofil deleted the real_gaussian_integral branch April 12, 2024 20:04
@ziofil ziofil restored the real_gaussian_integral branch April 12, 2024 20:04
@ziofil ziofil reopened this Apr 12, 2024
Copy link
Contributor

@SamFerracin SamFerracin 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 :)

Just make sure that you can see the gaussian integrals in the docs (I can help with that)

mrmustard/physics/gaussian_integrals.py Show resolved Hide resolved
mrmustard/physics/gaussian_integrals.py Outdated Show resolved Hide resolved
@sylviemonet sylviemonet merged commit 1b374f8 into develop Apr 15, 2024
7 of 8 checks passed
@sylviemonet sylviemonet deleted the real_gaussian_integral branch April 15, 2024 20:30
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.

3 participants