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

Parameter is_real seems not correct #8619

Closed
ikkoham opened this issue Aug 26, 2022 · 2 comments · Fixed by #9664
Closed

Parameter is_real seems not correct #8619

ikkoham opened this issue Aug 26, 2022 · 2 comments · Fixed by #9664
Labels
bug Something isn't working
Milestone

Comments

@ikkoham
Copy link
Contributor

ikkoham commented Aug 26, 2022

Environment

  • Qiskit Terra version:
  • Python version:
  • Operating system:

What is happening?

Parameter.is_real() seems not correct.

How can we reproduce the issue?

>>> from qiskit.circuit import Parameter

>>> Parameter("a").is_real()
True
>>> (1j * Parameter("a")).is_real()
True

What should happen?

Both should return False since we don't know whether a is real or not.

Any suggestions?

No response

@ikkoham ikkoham added the bug Something isn't working label Aug 26, 2022
@jlapeyre
Copy link
Contributor

Didn't we already discuss whether to use three-level logic here ? @Cryoris

@Cryoris
Copy link
Contributor

Cryoris commented Aug 29, 2022

Yeah, we did 🙂 The plan was to do the same as sympy and symengine: return None while the expression is not bound, otherwise True or False accordingly

@Cryoris Cryoris added this to the 0.23.0 milestone Oct 11, 2022
@mtreinish mtreinish modified the milestones: 0.23.0, 0.24.0 Jan 9, 2023
@mergify mergify bot closed this as completed in #9664 Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants