Closed thisac closed 3 years ago
Merging #596 (1e7d629) into master (6b7b5c5) will increase coverage by
0.01%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #596 +/- ##
==========================================
+ Coverage 98.44% 98.45% +0.01%
==========================================
Files 76 76
Lines 8752 8758 +6
==========================================
+ Hits 8616 8623 +7
+ Misses 136 135 -1
Impacted Files | Coverage Δ | |
---|---|---|
strawberryfields/io.py | 96.90% <100.00%> (+0.04%) |
:arrow_up: |
strawberryfields/parameters.py | 100.00% <100.00%> (+0.89%) |
:arrow_up: |
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 6b7b5c5...1e7d629. Read the comment docs.
Context: There are a few issues when attempting to convert an SF circuit with feed-forwarding to Blackbird. If any parameter is found to be symbolic, it's cast as a string rather than keeping it as a
blackbird.RegRefTransform
as it would be if loaded directly from a script to Blackbird. For example, the following SF circuitwill, when transformed into a Blackbird program, converting
q[0].par*1.41421356237000
andq[1].par*1.41421356237000
into the strings"1.41421356237000*q0"
and"1.41421356237000*q1"
, rather than, as it should, intoblackbird.RegRefTransform
objects.If attempting to load the following blackbird script
both
1.41421356237*q0
and1.41421356237*q0
will be stored asblackbird.RegRefTransform
objects.Description of the Change: The
strawberryfields.to_blackbird
function is changed so that if an SF parameter contains a regref (e.g.q0
orq1
, as in the string representation of the symbolic expression in SF) it stores it as ablackbird.RegRefTransform
instead of as a string.When converting from a Blackbird program to an SF program, the symbolic expression needs to be extracted from the
RegRefTransform
, so that SF can understand it. This is being added in this Blackbird PR #46.Benefits: SF circuits with feed-forwarding can now be transformed and serialized into Blackbird and back, without any issues or loss of information.
Possible Drawbacks: None
Related GitHub Issues: Closes #595