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

Quadrature methods for circuit components and states #443

Closed elib20 closed 2 months ago

elib20 commented 3 months ago

Context: We would like convenience methods for evaluating the quadrature basis representation of circuit components and states.

Description of the Change:

Benefits:

Possible Drawbacks: None

Related GitHub Issues:

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.52%. Comparing base (92e42e3) to head (bc4c44c). Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
mrmustard/lab_dev/circuit_components.py 95.45% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #443 +/- ## =========================================== + Coverage 89.47% 89.52% +0.04% =========================================== Files 102 102 Lines 7365 7408 +43 =========================================== + Hits 6590 6632 +42 - Misses 775 776 +1 ``` | [Files with missing lines](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/443?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/443?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.26% <100.00%> (+0.13%)` | :arrow_up: | | [mrmustard/physics/fock.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/443?src=pr&el=tree&filepath=mrmustard%2Fphysics%2Ffock.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL3BoeXNpY3MvZm9jay5weQ==) | `92.94% <100.00%> (+0.38%)` | :arrow_up: | | [mrmustard/lab\_dev/circuit\_components.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/443?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuit_components.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdF9jb21wb25lbnRzLnB5) | `99.08% <95.45%> (-0.28%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/443?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/443?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [92e42e3...bc4c44c](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/443?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).
ziofil commented 2 months ago

Maybe it's late for this suggestions, but wouldn't it be sufficient to apply BtoQ on all wires and return the ansatz? Then the ansatz itself can be called independently.

ziofil commented 2 months ago

I approved it, but make sure those indices are in the right order