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
754 stars 191 forks source link

Add KL divergence to cost module #391

Closed ixfoduap closed 4 years ago

ixfoduap commented 4 years ago

As part of the train module of the apps layer, the cost module of the SF apps layer contains methods for evaluating and computing gradients of cost functions.

This PR adds a class to the cost module dedicated to the Kullback-Liebler cost function, for which gradients can be calculated efficiently using classical methods.

codecov[bot] commented 4 years ago

Codecov Report

Merging #391 into master will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #391   +/-   ##
=======================================
  Coverage   97.83%   97.83%           
=======================================
  Files          58       58           
  Lines        6752     6752           
=======================================
  Hits         6606     6606           
  Misses        146      146           

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 9670bae...9670bae. Read the comment docs.