Closed thisac closed 2 years ago
Merging #643 (bc9653b) into master (4161918) will increase coverage by
0.00%
. The diff coverage is97.24%
.
@@ Coverage Diff @@
## master #643 +/- ##
========================================
Coverage 98.28% 98.29%
========================================
Files 72 75 +3
Lines 8824 9029 +205
========================================
+ Hits 8673 8875 +202
- Misses 151 154 +3
Impacted Files | Coverage Δ | |
---|---|---|
strawberryfields/io/blackbird_io.py | 93.39% <93.39%> (ø) |
|
strawberryfields/io/utils.py | 98.24% <98.24%> (ø) |
|
strawberryfields/io/xir_io.py | 98.27% <98.27%> (ø) |
|
strawberryfields/io/__init__.py | 100.00% <100.00%> (ø) |
|
strawberryfields/tdm/tdmprogram.py | 98.29% <100.00%> (+0.01%) |
: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 4161918...bc9653b. Read the comment docs.
Context: To fully support XIR in SF we need to have a way to convert back and forth between XIR and SF programs.
Description of the Change: Function to be able to convert between XIR and SF programs (both ways) are added.
sf.io.to_program
now recognizes whether an XIR program or a Blackbird program is being passed, and converts it properly into an SF program._from_xir
function has been added taking an XIR program, returning the corresponding SF program._from_blackbird
.to_xir
function has been added that takes an SF program and returns the corresponding XIR program. Keyword argumentsadd_decl
, for adding declarations to the XIR program, andversion
, for passing a version string, are added.save
,load
andloads
are now able to save and load both Blackbird and XIR scripts (determined by their
keyword, which defaults toir="blackbird"
for backwards compatibility.test_io.py
and adapted to fit the XIR case. The tests have now been separated intotest_io_xir.py
,test_io_blackbird.py
, andtest_io
, the latter containing all non-ir tests.Benefits: SF supports serializing XIR!
Possible Drawbacks: None
Related GitHub Issues: None