XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
751 stars 187 forks source link

Bloch Messiah decomposition from The Walrus #729

Open sduquemesa opened 2 years ago

sduquemesa commented 2 years ago

NOTE: This PR is using thewalrus/main. DO NOT MERGE until there is a new release of The Walrus (don't forget to change the requirement files accordingly).

Context: The current implementation of the Bloch-Messiah decomposition fails for degenerate symplectic matrices.

Description of the Change: The Walrus included a new implementation of the Bloch-Messiah decomposition that solves the issue. This PR swaps the SF implementation for the new improved implementation on TW.

Benefits: Bloch-Messiah works for degenerate symplectic matrices.

Possible Drawbacks: None.

Related GitHub Issues: Closes #728

codecov[bot] commented 2 years ago

Codecov Report

Merging #729 (720637e) into master (9a9a352) will decrease coverage by 59.45%. The diff coverage is 66.66%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #729 +/- ## =========================================== - Coverage 98.33% 38.88% -59.46% =========================================== Files 78 78 Lines 9603 9578 -25 =========================================== - Hits 9443 3724 -5719 - Misses 160 5854 +5694 ``` | [Impacted Files](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [strawberryfields/decompositions.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9kZWNvbXBvc2l0aW9ucy5weQ==) | `12.88% <66.66%> (-86.57%)` | :arrow_down: | | [strawberryfields/io/xir\_io.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9pby94aXJfaW8ucHk=) | `8.04% <0.00%> (-90.23%)` | :arrow_down: | | [strawberryfields/apps/subgraph.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9hcHBzL3N1YmdyYXBoLnB5) | `10.11% <0.00%> (-89.89%)` | :arrow_down: | | [strawberryfields/apps/clique.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9hcHBzL2NsaXF1ZS5weQ==) | `10.67% <0.00%> (-89.33%)` | :arrow_down: | | [strawberryfields/apps/qchem/dynamics.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9hcHBzL3FjaGVtL2R5bmFtaWNzLnB5) | `12.65% <0.00%> (-87.35%)` | :arrow_down: | | [strawberryfields/backends/tfbackend/ops.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9iYWNrZW5kcy90ZmJhY2tlbmQvb3BzLnB5) | `11.96% <0.00%> (-86.31%)` | :arrow_down: | | [...fields/backends/gaussianbackend/gaussiancircuit.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9iYWNrZW5kcy9nYXVzc2lhbmJhY2tlbmQvZ2F1c3NpYW5jaXJjdWl0LnB5) | `13.02% <0.00%> (-86.21%)` | :arrow_down: | | [strawberryfields/backends/tfbackend/states.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9iYWNrZW5kcy90ZmJhY2tlbmQvc3RhdGVzLnB5) | `13.33% <0.00%> (-85.65%)` | :arrow_down: | | [strawberryfields/tdm/utils.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy90ZG0vdXRpbHMucHk=) | `11.60% <0.00%> (-85.64%)` | :arrow_down: | | [strawberryfields/plot.py](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-c3RyYXdiZXJyeWZpZWxkcy9wbG90LnB5) | `13.15% <0.00%> (-85.09%)` | :arrow_down: | | ... and [49 more](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729?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://codecov.io/gh/XanaduAI/strawberryfields/pull/729?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [9a9a352...720637e](https://codecov.io/gh/XanaduAI/strawberryfields/pull/729?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).