Skip to content

Commit

Permalink
Limit Xstrict validation to X-series compilers (#713)
Browse files Browse the repository at this point in the history
* limit Xstrict validation to X-series compilers

* fix tests
  • Loading branch information
thisac authored May 31, 2022
1 parent 1295993 commit db4d931
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion strawberryfields/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def run_async(
self.log.info(msg)
program = program.compile(device=device, **compile_options)

else:
elif program.compile_info[1][0] == "X":
# validating program
msg = (
f"Program previously compiled for {device.target} using {program.compile_info[1]}. "
Expand Down
6 changes: 3 additions & 3 deletions tests/api/test_remote_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_recompilation_run_async(self, prog, infolog, device):
engine = sf.RemoteEngine("X8")
device = engine.device

prog._compile_info = (device, device.compiler)
prog._compile_info = (device, device.compiler[0])

compile_options = {"compiler": "Xunitary"}
engine.run_async(prog, shots=10, compile_options=compile_options, recompile=True)
Expand All @@ -303,7 +303,7 @@ def test_recompilation_run(self, prog, infolog, device):
engine = sf.RemoteEngine("X8")
device = engine.device

prog._compile_info = (device, device.compiler)
prog._compile_info = (device, device.compiler[0])

compile_options = {"compiler": "Xunitary"}
engine.run(prog, shots=10, compile_options=compile_options, recompile=True)
Expand All @@ -326,7 +326,7 @@ def test_validation(self, prog, infolog, device):
engine = sf.RemoteEngine("X8_01")
device = engine.device

prog._compile_info = (device, device.compiler)
prog._compile_info = (device, device.compiler[0])

engine.run_async(prog, shots=10)

Expand Down

0 comments on commit db4d931

Please sign in to comment.