Avoid Module creation for Constant Gate scenarios#481
Open
mjayasim9 wants to merge 14 commits intointel:mainfrom
Open
Avoid Module creation for Constant Gate scenarios#481mjayasim9 wants to merge 14 commits intointel:mainfrom
mjayasim9 wants to merge 14 commits intointel:mainfrom
Conversation
mkorbel1
reviewed
Apr 5, 2024
mkorbel1
requested changes
May 31, 2024
Added some more changes based on feedback (intel#481)
mkorbel1
reviewed
Jan 31, 2025
Contributor
mkorbel1
left a comment
There was a problem hiding this comment.
This is looking very good, and the tests make sense to me for &, |, and ~
|
|
||
| /// Logical bitwise AND. | ||
| Logic operator &(Logic other) => And2Gate(this, other).out; | ||
| Logic operator &(Logic other) { |
Contributor
There was a problem hiding this comment.
Upon review, I realized that perhaps operators could be overridden on Const class instead of these special cases here.
For example:
if(other is Const) {
return other & this;
}Then in Const you can just override @override Logic operator &(Logic other) to perform the const version of things.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description & Motivation
#429
Related Issue(s)
#429
Testing
Added test cases to check if the result of '&', '|' and '~' operations are as expected for constant input scenarios.
Backwards-compatibility
No.
Documentation
No.