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

Call none #439

Closed kaspernielsen96 closed 3 months ago

kaspernielsen96 commented 4 months ago

Context: Adding a method where one can call the ansatz with None for some arguments. This will return a an updated ansatz with on fewer variables (wires). Description of the Change: Adding a method to the DiffOpPolyExpAnsatz where one can evaluate only some of the wires, and thus returning a new updated ansatz. Benefits: Allows for reduction in the size of the ansatz. Can also be used with BtoQ to do a Homodyne measurement.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 91.42857% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.93%. Comparing base (84aba1e) to head (5b2dd9e).

Files Patch % Lines
mrmustard/physics/ansatze.py 91.42% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #439 +/- ## =========================================== + Coverage 88.92% 88.93% +0.01% =========================================== Files 101 101 Lines 7042 7076 +34 =========================================== + Hits 6262 6293 +31 - Misses 780 783 +3 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/439?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [mrmustard/physics/ansatze.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/439?src=pr&el=tree&filepath=mrmustard%2Fphysics%2Fansatze.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL3BoeXNpY3MvYW5zYXR6ZS5weQ==) | `95.96% <91.42%> (-0.38%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/439?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/439?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [84aba1e...5b2dd9e](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/439?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).