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
737 stars 188 forks source link

Unrolling fix #710

Closed thisac closed 2 years ago

thisac commented 2 years ago

Context: If a rolled circuit is compiled and then later unrolled and then re-rolled, the un-compiled circuit, which has previously been stored, is used instead of rolling the circuit back to the compiled version.

Description of the Change: Store correct rolled circuit before unrolling (fixes issue when rolled circuit has changed due to e.g., compilation).

Benefits: Circuits can now be: compiled -> unrolled -> rolled without being reverted to the pre-compiled version.

Possible Drawbacks: None

Related GitHub Issues: None

codecov[bot] commented 2 years ago

Codecov Report

Merging #710 (d976a3a) into master (f2c6579) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #710   +/-   ##
=======================================
  Coverage   98.72%   98.72%           
=======================================
  Files          75       75           
  Lines        9224     9228    +4     
=======================================
+ Hits         9106     9110    +4     
  Misses        118      118           
Impacted Files Coverage Δ
strawberryfields/tdm/tdmprogram.py 99.20% <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 f2c6579...d976a3a. Read the comment docs.