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

protocols.is_parameterized(sympy.pi) currently returns True #7053

Open
daxfohl opened this issue Feb 9, 2025 · 7 comments
Open

protocols.is_parameterized(sympy.pi) currently returns True #7053

daxfohl opened this issue Feb 9, 2025 · 7 comments
Labels
good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/bug-report Something doesn't seem to work. triage/discuss Needs decision / discussion, bring these up during Cirq Cynque triage/needs-more-evidence [Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet

Comments

@daxfohl
Copy link
Collaborator

daxfohl commented Feb 9, 2025

is_parameterized needs a check for free symbols, not just isinstance(sympy.Basic)

@daxfohl daxfohl added good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/bug-report Something doesn't seem to work. labels Feb 9, 2025
@pavoljuhas pavoljuhas added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Feb 19, 2025
@NikolaiLong
Copy link

Hi again, @daxfohl. I know I just reached out to you regarding issue 7050, but this issue potentially looks like a simple fix. I would like to work on this issue to help give myself more scope of the project. Thanks again, I'm very excited to start working on Cirq!

@NikolaiLong
Copy link

I was previously unaware of the triage/discuss tag, I apologize for the confusion.

@mhucka
Copy link
Contributor

mhucka commented Mar 5, 2025

Discussed in Cirq Cynq 2025-03-05: @daxfohl could you provide an example of where there is a problem caused by the current behavior? Are there examples where data argument types need to be resolved this way? During discussions, the general sense was that the issue may have merit if the need/scenario could be demonstrated with an example or two.

@NoureldinYosri NoureldinYosri added triage/needs-more-evidence [Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Mar 5, 2025
@mhucka
Copy link
Contributor

mhucka commented Mar 5, 2025

I was previously unaware of the triage/discuss tag, I apologize for the confusion.

No worries! Thank you for your interest and patience.

@daxfohl
Copy link
Collaborator Author

daxfohl commented Mar 5, 2025

I noticed it when working on #7057. I initially tried to use is_parameterized here https://github.com/quantumlib/Cirq/pull/7057/files#diff-a213015092da682cefaaabc63494f1e0b4d627c49b9ffbcbcc642c9ace074930R308, but that failed in cases where the inputs are sympy constants (which occured in already-existing test cases), since is_parameterized says sympy constants are parameterized, so I had to write up my own lambda instead.

@daxfohl daxfohl changed the title protocols.is_parameterized(sympy.pi) == True protocols.is_parameterized(sympy.pi) currently returns True Mar 6, 2025
@daxfohl
Copy link
Collaborator Author

daxfohl commented Mar 6, 2025

I just saw the sync notes and wanted to make sure it's clear that currently is_parameterized(sympy.pi) returns true, which seems wrong, and we should change it to return false in that case since there are no free parameters. If I'm interpreting the sync notes correctly, the team thought this issue was saying the opposite.

Updated issue title to better reflect that.

@mhucka mhucka added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Mar 19, 2025
@mhucka
Copy link
Contributor

mhucka commented Mar 19, 2025

Add back triage/discuss to bring it to attention to the next Cynq.

@daxfohl Thank you for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. kind/bug-report Something doesn't seem to work. triage/discuss Needs decision / discussion, bring these up during Cirq Cynque triage/needs-more-evidence [Feature requests] Seems plausible, but maintainers are not convinced about the use cases yet
Projects
None yet
Development

No branches or pull requests

5 participants