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

Update max measurements check #662

Closed thisac closed 2 years ago

thisac commented 2 years ago

Context: The platform returns a flat dictionary entry for the maximum number of measurements allowed when running jobs on Simulon. Strawberry Fields currently expects a nested dictionary entry (which was added in #545).

Description of the Change: Program.assert_max_number_of_measurements is updated to use the flat modes entry when checking for maximum allowed measurements.

Benefits: simulon_gaussian is one step closer to working again.

Possible Drawbacks: None

Related GitHub Issues: None

codecov[bot] commented 2 years ago

Codecov Report

Merging #662 (731f3a0) into master (5c2aeb3) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #662   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files          72       72           
  Lines        8812     8815    +3     
=======================================
+ Hits         8661     8664    +3     
  Misses        151      151           
Impacted Files Coverage Δ
strawberryfields/program.py 100.00% <100.00%> (ø)

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 5c2aeb3...731f3a0. Read the comment docs.