Skip to content
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

Reject formulas as keys of ParamResolvers #5384

Merged
merged 3 commits into from
May 20, 2022

Conversation

dstrain115
Copy link
Collaborator

  • A ParamResolver resolves variables into values.
  • Having non-trivial formulas as keys allows a significant
    complexity and ambiguity into ParamResolvers, since it is
    unclear how much is supported. Prevent this case altogether
    by raising an error if non-symbol formulas are used in ParamResolvers.

Fixes: #3550

- A ParamResolver resolves variables into values.
- Having non-trivial formulas as keys allows a significant
complexity and ambiguity into ParamResolvers, since it is
unclear how much is supported.  Prevent this case altogether
by raising an error if non-symbol formulas are used in ParamResolvers.

Fixes: quantumlib#3550
@dstrain115 dstrain115 requested review from a team, vtomole and cduck as code owners May 20, 2022 19:36
@CirqBot CirqBot added the size: S 10< lines changed <50 label May 20, 2022
@95-martin-orion 95-martin-orion added the BREAKING CHANGE For pull requests that are important to mention in release notes. label May 20, 2022
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I remember writing this issue!

Approved, but marked as BREAKING_CHANGE since this does cut some (possibly unintended) functionality of ParamResolver.

@dstrain115 dstrain115 merged commit 95bebae into quantumlib:master May 20, 2022
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
* Reject formulas as keys of ParamResolvers

- A ParamResolver resolves variables into values.
- Having non-trivial formulas as keys allows a significant
complexity and ambiguity into ParamResolvers, since it is
unclear how much is supported.  Prevent this case altogether
by raising an error if non-symbol formulas are used in ParamResolvers.

Fixes: quantumlib#3550
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
* Reject formulas as keys of ParamResolvers

- A ParamResolver resolves variables into values.
- Having non-trivial formulas as keys allows a significant
complexity and ambiguity into ParamResolvers, since it is
unclear how much is supported.  Prevent this case altogether
by raising an error if non-symbol formulas are used in ParamResolvers.

Fixes: quantumlib#3550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE For pull requests that are important to mention in release notes. size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expression-to-symbol maps in ParamResolver are ignored
3 participants