Skip to content

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, cduck and vtomole 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