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
754 stars 191 forks source link

Unify RemoteEngine.run() and LocalEngine.run() signatures, and allow for default chip specs for each device family. #337

Closed josh146 closed 4 years ago

josh146 commented 4 years ago

Context:

Currently in Strawberry Fields:

While these appear as two separate issues, they are quite interconnected. Since eng.run() internally calls the prog.compile() method, both engines must keep track and pass on any run_options that the user specifies so that they can be taken into account during compilation/execution.

Description of the Change:

Benefits: see above.

Possible Drawbacks:

Related GitHub Issues:

thisac commented 4 years ago

The tests fail because of the new run_options convention. I created a new branch where I've updated all of the instances of run_options as dictionaries, e.g. run_options={"shots": shots}, to keyword arguments instead. I'm not sure if this is the easiest way to fix this, though. Please tell me if I should rather create a separate PR for this.

The branch with all the changes is called shots_as_kwargs, and should fix the run_options in all files (including tutorials and documentation).

codecov[bot] commented 4 years ago

Codecov Report

Merging #337 into master will increase coverage by 0.00%. The diff coverage is 99.23%.

@@           Coverage Diff           @@
##           master     #337   +/-   ##
=======================================
  Coverage   97.69%   97.70%           
=======================================
  Files          51       51           
  Lines        6346     6354    +8     
=======================================
+ Hits         6200     6208    +8     
  Misses        146      146           
Impacted Files Coverage Δ
strawberryfields/io.py 98.78% <66.66%> (-1.22%) :arrow_down:
strawberryfields/api/connection.py 97.70% <100.00%> (+0.02%) :arrow_up:
strawberryfields/apps/sample.py 100.00% <100.00%> (ø)
strawberryfields/circuitspecs/X12.py 100.00% <100.00%> (ø)
strawberryfields/circuitspecs/X8.py 100.00% <100.00%> (ø)
strawberryfields/circuitspecs/__init__.py 100.00% <100.00%> (ø)
strawberryfields/engine.py 95.33% <100.00%> (+0.77%) :arrow_up:
strawberryfields/program.py 98.84% <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 605819a...64c850c. Read the comment docs.