Closed antalszava closed 2 years ago
Perhaps a short term solution is to simply include validation on Spec creation, to ensure that the two target values are identical?
This has been fixed in #656. The DeviceSpec
object uses the target value in the device specification dictionary. There could still potentially be two targets in the specification dictionary (in the layout and in the target field), although this is related to the device specifications on the platform and not an SF issue.
Issue description
Creating a
DeviceSpec
object involves specifying atarget
device at two distinct places:target
argumentlayout
in thespec
argument. Such a layout contains atarget
field, an excerpt could look as follows:It is, however, not checked if these two values are equal. Therefore, in certain cases, different values are accepted, making it a (rare) edge case for
DeviceSpec
creation.Expected behavior: (What you expect to happen) The
target
values contained in aDeviceSpec
object are the same.Actual behavior: (What actually happens) These
target
values can differ.Reproduces how often: (What percentage of the time does it reproduce?) Rarely: the user has to explicitly pass a
target
different to thetarget
defined inlayout
.System information: (post the output of
import strawberryfields as sf; sf.about()
) SF0.15.0
Additional information
The solution could involve removing the
target
argument and derivingtarget
from thelayout
specified. This might be a breaking change to the stack though.