-
Notifications
You must be signed in to change notification settings - Fork 2
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
PHIR generation #12
PHIR generation #12
Conversation
… into phir-out Also, fix some minor issues
for shard in enumerate(shards): | ||
s = shard[1] | ||
for shard in shards: | ||
s = shard |
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.
I believe the typing issue in the above two lines was the root cause behind all previous type ignores below.
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.
huh interesting, mypy couldn't determine that shard
had type (int, Shard)
and s had type Shard
?
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.
I don't think the problem originated from mypy. We needed to be more careful while writing the code.
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.
Definitely agree that enumerate shouldn't be used unless both the index and the element in the collection are both being used.
def place_and_route( | ||
machine: Machine, | ||
shards: list[Shard], | ||
) -> list[tuple[list[int], list[Shard], float]]: |
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 great, but as a note for later, we should definitely come up with some good type aliases for some of these things to make the dataflow a bit more readable.
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 for getting us to having end to end QASM => PHIR for simple circuits!
Just a first pass. Perhaps can be improved a lot.