XanaduAI / MrMustard

A differentiable bridge between phase space and Fock space
https://mrmustard.readthedocs.io/
Apache License 2.0
78 stars 27 forks source link

QuadratureEigenstate Fixes #452

Closed apchytr closed 3 months ago

apchytr commented 3 months ago

Context: QuadratureEigenstate __repr__ currently fails due to an L2 norm calculation. Solution is to override the L2_norm. Additionally, set manual shape on QuadratureEigenstate for visualization purposes.

Description of the Change: L2_norm on QuadratureEigenstate returns np.inf, manual_shape is set to (50,), some additional cleanup.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.86%. Comparing base (dfa5297) to head (5e155d9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #452 +/- ## =========================================== + Coverage 88.85% 88.86% +0.01% =========================================== Files 100 100 Lines 6999 7007 +8 =========================================== + Hits 6219 6227 +8 Misses 780 780 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [mrmustard/lab\_dev/states/base.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fstates%2Fbase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvc3RhdGVzL2Jhc2UucHk=) | `96.19% <100.00%> (ø)` | | | [mrmustard/lab\_dev/states/quadrature\_eigenstate.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fstates%2Fquadrature_eigenstate.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvc3RhdGVzL3F1YWRyYXR1cmVfZWlnZW5zdGF0ZS5weQ==) | `100.00% <100.00%> (ø)` | | | [mrmustard/physics/gaussian\_integrals.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?src=pr&el=tree&filepath=mrmustard%2Fphysics%2Fgaussian_integrals.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL3BoeXNpY3MvZ2F1c3NpYW5faW50ZWdyYWxzLnB5) | `98.48% <100.00%> (+0.03%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [dfa5297...5e155d9](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/452?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI).