Skip to content

Parameter is_real seems not correct #8619

@ikkoham

Description

@ikkoham

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions