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

New multirep PR initiated #496

Open arsalan-motamedi opened 1 month ago

arsalan-motamedi commented 1 month ago

Context: We need a way to handle representations, without needing to worry about them when taking contractions.

Description of the Change: The main change is adding _index_representation as an attribute to CircuitComponent, which keeps track of representation on each index.

Benefits: We don't need to worry about BtoQ and BtoPS changing the result of contractions.

Possible Drawbacks: All contractions are computed in Bargmann still. We may want to enforce contacting in a specific representation.

Related GitHub Issues: None.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 93.90244% with 15 lines in your changes missing coverage. Please review.

Project coverage is 89.88%. Comparing base (8c705c0) to head (fdfbe02).

Files with missing lines Patch % Lines
mrmustard/lab_dev/circuit_components.py 88.23% 14 Missing :warning:
...mustard/lab_dev/circuit_components_utils/b_to_q.py 98.24% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #496 +/- ## =========================================== + Coverage 89.77% 89.88% +0.11% =========================================== Files 104 104 Lines 7639 7871 +232 =========================================== + Hits 6858 7075 +217 - Misses 781 796 +15 ``` | [Files with missing lines](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [...ustard/lab\_dev/circuit\_components\_utils/b\_to\_ps.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuit_components_utils%2Fb_to_ps.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdF9jb21wb25lbnRzX3V0aWxzL2JfdG9fcHMucHk=) | `100.00% <100.00%> (ø)` | | | [mrmustard/lab\_dev/states/base.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?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.56% <100.00%> (+0.05%)` | :arrow_up: | | [mrmustard/lab\_dev/transformations/dgate.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Ftransformations%2Fdgate.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvdHJhbnNmb3JtYXRpb25zL2RnYXRlLnB5) | `100.00% <ø> (ø)` | | | [mrmustard/lab\_dev/wires.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fwires.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvd2lyZXMucHk=) | `99.28% <100.00%> (+0.01%)` | :arrow_up: | | [...mustard/lab\_dev/circuit\_components\_utils/b\_to\_q.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuit_components_utils%2Fb_to_q.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdF9jb21wb25lbnRzX3V0aWxzL2JfdG9fcS5weQ==) | `98.57% <98.24%> (-1.43%)` | :arrow_down: | | [mrmustard/lab\_dev/circuit\_components.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?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) | `96.14% <88.23%> (-2.96%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?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/496?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [8c705c0...fdfbe02](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/496?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).