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
745 stars 187 forks source link

Generaldyne sampling in gaussian #614

Closed elib20 closed 3 years ago

elib20 commented 3 years ago

Context: Generaldyne sampling in the gaussian backend

Description of the Change: Fixes the formula used for sampling generaldyne outcomes in the gaussian backend.

The covariance matrix of the sampling distribution needed also to depend on the covariance of the state onto which the target state was begin measured.

Updated the test in test_heterodyne to account for this.

Benefits: Correct heterodyne sampling (homodyne unaffected).

Possible Drawbacks: None.

Related GitHub Issues:

codecov[bot] commented 3 years ago

Codecov Report

Merging #614 (ec18986) into master (a142b74) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #614   +/-   ##
=======================================
  Coverage   98.55%   98.55%           
=======================================
  Files          77       77           
  Lines        8857     8857           
=======================================
  Hits         8729     8729           
  Misses        128      128           
Impacted Files Coverage Δ
...fields/backends/gaussianbackend/gaussiancircuit.py 99.23% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a142b74...ec18986. Read the comment docs.