-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add functional option to circuit_key
primitives util
#8775
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 3126566913
💛 - Coveralls |
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 understood the necessity of the feature. I approve this change, but note that _circuit_key
is only a workaround in the first place, which is why it is set to private.
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'm personally fine to remove id
from this key. We need to discuss it in the future.
I believe that I am removing |
32e14ec
|
Yeah we talked about using |
Thank you, Jessie. We can simplify the code by removing |
IMO, I like to stay on the safe side for these rare cases, in which circuits have different It is a preference which way to fall on the tradeoff between efficiency and safety, so let's take the efficiency side in this case. |
Okay, let's do the following then:
The PR should now be ready to merge as soon as tests pass 😉 |
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.
LGTM
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.
Thanks. LGTM.
Since this PR is not a new feature, but a follow-up of #8604 to improve efficiency, I would put it in at 0.22. |
Summary
Adds optional kwarg to request a purely functional key from the
circuit_key
primitives utility. This is necessary to avoid recomputation on circuits which are functionally equivalent but vary in non-functional data (e.g. name, id).Details and comments
Default behavior is set to
False
(i.e. default key is not purely functional) this decision has been made for compatibility with the previous implementation, but I think setting the default toTrue
would be preferred.EDIT: default behavior set to
True
after discussion (see below).