XanaduAI / MrMustard

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

Physical #447

Closed arsalan-motamedi closed 1 month ago

arsalan-motamedi commented 2 months ago

Context: Physicality checks added.

Description of the Change: One can check physicality of a DM rho, or a Channel ch using rho.is_physical and/or ch.is_physical. Moreover, one can check ch.is_TP , ch.is_CP, and DM.is_positive.

Benefits: Clear.

Possible Drawbacks: None.

Related GitHub Issues: None.

codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 88.80%. Comparing base (4aeafee) to head (5c41971).

Files Patch % Lines
mrmustard/lab_dev/transformations/base.py 95.65% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #447 +/- ## =========================================== + Coverage 88.75% 88.80% +0.05% =========================================== Files 100 100 Lines 6982 7024 +42 =========================================== + Hits 6197 6238 +41 - Misses 785 786 +1 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/447?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/447?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%> (+0.20%)` | :arrow_up: | | [mrmustard/utils/settings.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/447?src=pr&el=tree&filepath=mrmustard%2Futils%2Fsettings.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL3V0aWxzL3NldHRpbmdzLnB5) | `100.00% <100.00%> (ø)` | | | [mrmustard/lab\_dev/transformations/base.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/447?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Ftransformations%2Fbase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvdHJhbnNmb3JtYXRpb25zL2Jhc2UucHk=) | `97.19% <95.65%> (-0.48%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/447?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/447?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [4aeafee...5c41971](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/447?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).