Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support for
ExplicitPredicate
,ExplicitModifier
,MultiBitOp
#162Support for
ExplicitPredicate
,ExplicitModifier
,MultiBitOp
#162Changes from all commits
aa86d1c
049dcf3
f3edd7c
02a5064
2642518
c15e16a
46a9ab1
53195fc
3af777e
f7f2c26
367d3c1
d0c9685
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Need to be careful of endianness here. The conditional
value
in pytket is little-endian, e.g. a value of 2 on the bits[a[0], a[1]]
meansa[0] == 0 && a[1] == 1
. Does PHIR use the same convention?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.
@qciaran would you be able to confirm. I forgot to mention you at #162 (comment), I also had my doubts.
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 agree though that the default choice should be little-endian here. While Ciaran confirms, I am pushing the change to update the behavior.
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.
@cqc-alec although I wonder if the bits are explicitly specified like:
ie,
[b[1], b[2]] == 2
(pytket translation of above in the phir comment), is the intention from pytket still that they will be reordered and considered little-endian? I'd imagine the user to writecondition_bits=[Bit("b", 2), Bit("b", 1)]
if they wantedb[2]=1
andb[1]=0
.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.
Yes that is the intention: the order in which the bits are given corresponds to the little-endian binary expansion of the value. In your example, the condition is
b[1] == 0 && b[2] == 1
.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.
Yeah, in PHIR
a[0]==0 && a[1]==1
is the integer value 2. Or:{"cop": "=", "args": [2], "returns": ["b"]}
results inb[0]==0 & b[1]==1
Sounds like that should be mentioned in the spec, womp womp.
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.
Filed CQCL/phir#77, this PR seems ready to be merged.