XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
99 stars 54 forks source link

Revert "Instabilities of displacement operator (#351)" #356

Closed sduquemesa closed 1 year ago

sduquemesa commented 1 year ago

This reverts commit 9d8fe40ace7495b707894ef760c2592197a9e27b.

Context: PR #351 implemented the displacement operation using Laguerre Polynomials instead of the previously used recursion relations.

Description of the Change: This PR reverts The Walrus to use the recursion relations for the displacement operator instead of the Laguerre Polynomials, the reason being that the new change breaks operations in Strawberry Fields as evidenced in SF PR #725.

Benefits: Given the strong coupling between Strawberry Fields and The Walrus, this PR will ensure a consistent state of development between the libraries and avoids breaking changes that will eventually propagate to the users.

Possible Drawbacks: The displacement gate on The Walrus and Strawberry Fields will be unstable for large values of the arguments/cutoff.

Related GitHub Issues: SF PR #725

codecov[bot] commented 1 year ago

Codecov Report

Merging #356 (3bd16c5) into master (7bc7d97) will not change coverage. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #356 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 25 26 +1 Lines 1853 1887 +34 ========================================= + Hits 1853 1887 +34 ``` | [Impacted Files](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [thewalrus/\_hafnian.py](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL19oYWZuaWFuLnB5) | `100.00% <ø> (ø)` | | | [thewalrus/loop\_hafnian\_batch.py](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2xvb3BfaGFmbmlhbl9iYXRjaC5weQ==) | `100.00% <ø> (ø)` | | | [thewalrus/loop\_hafnian\_batch\_gamma.py](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2xvb3BfaGFmbmlhbl9iYXRjaF9nYW1tYS5weQ==) | `100.00% <ø> (ø)` | | | [thewalrus/samples.py](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL3NhbXBsZXMucHk=) | `100.00% <ø> (ø)` | | | [thewalrus/fock\_gradients.py](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL2ZvY2tfZ3JhZGllbnRzLnB5) | `100.00% <100.00%> (ø)` | | | [thewalrus/\_\_init\_\_.py](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-dGhld2FscnVzL19faW5pdF9fLnB5) | `100.00% <0.00%> (ø)` | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?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/thewalrus/pull/356?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [5d46212...3bd16c5](https://codecov.io/gh/XanaduAI/thewalrus/pull/356?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).