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
Remove method
qasm
fromInstruction
and all of its subclasses #10399Remove method
qasm
fromInstruction
and all of its subclasses #10399Changes from 11 commits
26a3ec6
cbc81ae
23fe27e
cc19a4d
a2e2041
a790c38
c062ca6
68c1832
5f2d5f2
e4ab6a2
6875e17
275f9b3
8961c66
f78313c
6a42114
f32737d
93f5232
4058c1a
9a2db41
d056b81
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.
Regarding "The ordering of these calls doesn't look right...". I made a couple of commits to simplify the code that show that all I've done is exchange a method call for a plain function call. However, I think this makes it clear that the call to
_instruction_qasm2
could be moved inside_qasm2_define_custom_operation
. This would the code a bit less complex and add a bit more encapsulation. I think this may be what you are suggesting.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, your new commits make the structure much clearer. More importantly (with regard to the "ordering" comment), they also ensure that the
c3sx -> c3sqrtx
also happens when the gate appears during nested gates that need definitions as well, whereas in the version I'd commented on, it didn't.Given:
the output from where I commented (a2e2041) is:
and from 6875e17, which is the current PR head, it's the correct:
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.
Moving the hack down to a lower level feels worse in a sense. But, it is simpler and temporarily mutating something that should not change is distasteful. I didn't realize that it is more correct in the sense of your example. It's useful to make this clear