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
745 stars 187 forks source link

Space unrolling for TDM programs #601

Closed thisac closed 3 years ago

thisac commented 3 years ago

Context: This PR adds support for using a TDMProgram to construct TDM circuits with Fock measurements and multiple loops (e.g. TD3). The major change is needed support for space-unrolling.

Description of the Change:

Note: when space-unrolling a circuit, subsystems need to be added to the TDMProgram. These are removed when rolling back the circuit.

Benefits: TDM programs with Fock measurements can be constructed (via TDMProgram) and all TDM programs can be space-unrolled.

Possible Drawbacks: None

Related GitHub Issues: None

codecov[bot] commented 3 years ago

Codecov Report

Merging #601 (6255187) into master (cda84e4) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #601   +/-   ##
=======================================
  Coverage   98.55%   98.56%           
=======================================
  Files          77       77           
  Lines        8857     8893   +36     
=======================================
+ Hits         8729     8765   +36     
  Misses        128      128           
Impacted Files Coverage Δ
strawberryfields/engine.py 96.49% <100.00%> (+0.07%) :arrow_up:
strawberryfields/tdm/tdmprogram.py 98.15% <100.00%> (+0.30%) :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 cda84e4...6255187. Read the comment docs.