qiskit/releasenotes/notes/0.25/parameter-float-cast-48f373...

14 lines
760 B
YAML

---
fixes:
- |
Improved the error messages returned when an attempt to convert a fully bound
:class:`.ParameterExpression` into a concrete ``float`` or ``int`` failed, for example because
the expression was naturally a complex number.
- |
Fixed ``float`` conversions for :class:`.ParameterExpression` values which had, at some point in
their construction history, an imaginary component that had subsequently been cancelled. When
using Sympy as a backend, these conversions would usually already have worked. When using
Symengine as the backend, these conversions would often fail with type errors, despite the
result having been symbolically evaluated to be real, and :meth:`.ParameterExpression.is_real`
being true.