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

Logic to validate `circuit.path` #374

Closed SamFerracin closed 7 months ago

SamFerracin commented 7 months ago

Context: This PR adds logic to validate circuit.path. The path is now automatically (and efficiently) validated when a user sets it, making sure that simulations are not interrupted by path-related errors.

codecov[bot] commented 7 months ago

Codecov Report

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

Project coverage is 86.95%. Comparing base (a575f0c) to head (51ffc8f). Report is 1 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #374 +/- ## =========================================== + Coverage 86.93% 86.95% +0.01% =========================================== Files 79 79 Lines 5831 5878 +47 =========================================== + Hits 5069 5111 +42 - Misses 762 767 +5 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/374?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/circuits.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/374?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuits.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdHMucHk=) | `95.45% <100.00%> (-2.51%)` | :arrow_down: | | [mrmustard/lab\_dev/simulator.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/374?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fsimulator.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvc2ltdWxhdG9yLnB5) | `87.50% <ø> (-12.50%)` | :arrow_down: | | [mrmustard/lab\_dev/states/base.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/374?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.66% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/374?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/374?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [d31b70f...51ffc8f](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/374?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).