New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assert spec and layout target equality #687
Conversation
Codecov Report
@@ Coverage Diff @@
## master #687 +/- ##
=======================================
Coverage 98.69% 98.69%
=======================================
Files 75 75
Lines 9198 9209 +11
=======================================
+ Hits 9078 9089 +11
Misses 120 120
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @thisac! I suppose I have one question, though - is there anywhere in the logic where we are making use of the fact that different spec and different layout targets are allowed?
That is, do we have any existing cases where they might already differ?
Co-authored-by: Josh Izaac <josh146@gmail.com>
…ryfields into sc-15707-assert-target
Context:
Currently, there's no check against using different targets in the specification (
Device.target
, orDevice._spec["target"]
) and in the Blackbird layout (target field inDevice.layout
, orBlackbirdProgram.target
). This shouldn't be an issue for the user unless the specification is incorrect, although it's safer to have a check for this at device creation directly.Description of the Change:
Device.assert_spec
static method is added which checks that the target in the layout is the same as the target field in the specification. This check is also performed atDevice
initialization.CircuitError
would be raised.Benefits:
Possible Drawbacks:
None
Related GitHub Issues:
None