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

measure_homodyne returns complex (tfbackend) #317

Closed ziofil closed 4 years ago

ziofil commented 4 years ago

Fixes the issue where the sympy.lambdify function failed to multiply a complex value by a float eager tensor. Solved by having measure_homodyne cast to tf.complex64 (in the tfbackend)

co9olguy commented 4 years ago

Seems to be 2 failing tests :thinking:

josh146 commented 4 years ago

Note: @smite and I had a conversation about this in #softwaredev, and it looks like this isn't the cause of the issue --- instead, a quickfix is required within the parameter evaluation code. I'll try and have a PR addressing that up by tonight.

codecov[bot] commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (tf2@29620b2). Click here to learn what that means. The diff coverage is 0%.

@@          Coverage Diff           @@
##             tf2     #317   +/-   ##
======================================
  Coverage       ?   77.66%           
======================================
  Files          ?       46           
  Lines          ?     5826           
  Branches       ?        0           
======================================
  Hits           ?     4525           
  Misses         ?     1301           
  Partials       ?        0
Impacted Files Coverage Δ
strawberryfields/backends/tfbackend/circuit.py 9.55% <0%> (ø)

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 29620b2...2b24a6d. Read the comment docs.

josh146 commented 4 years ago

Closing this for now, as this is superceded by #320