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

from/to quadrature functions #373

Closed sylviemonet closed 6 months ago

sylviemonet commented 7 months ago

Context: Add the ABC triples to do the representation transform on a single out_ket wire: from_quad and to_quad.

Description of the Change: Two new ABC triples function. It can be used in states, unitaries, and channels directly.

The higher-level functions must recognize which wire will transform and pick the correct triples for different wires. For example, to transform a single-mode mixed state into quadrature, two of these triples will be called, one is for the out_ket wire of the state, and another one is the conjugate of this triple to transform the out_bra wire of the state.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

codecov[bot] commented 7 months ago

Codecov Report

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

Project coverage is 87.64%. Comparing base (2a093c9) to head (9d0a5eb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #373 +/- ## =========================================== + Coverage 87.49% 87.64% +0.14% =========================================== Files 81 81 Lines 6087 6160 +73 =========================================== + Hits 5326 5399 +73 Misses 761 761 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?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/circuit\_components\_utils.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuit_components_utils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdF9jb21wb25lbnRzX3V0aWxzLnB5) | `100.00% <100.00%> (ø)` | | | [mrmustard/lab\_dev/states/base.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?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=) | `95.82% <100.00%> (+0.28%)` | :arrow_up: | | [mrmustard/physics/ansatze.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?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.13% <100.00%> (ø)` | | | [mrmustard/physics/gaussian\_integrals.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?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) | `100.00% <100.00%> (ø)` | | | [mrmustard/physics/triples.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?src=pr&el=tree&filepath=mrmustard%2Fphysics%2Ftriples.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL3BoeXNpY3MvdHJpcGxlcy5weQ==) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?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/373?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [2a093c9...9d0a5eb](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/373?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).
SamFerracin commented 7 months ago

@sylviemonet let's work on the docs together when you're back :)