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

Min, max, ceil, floor in ParameterExpression #5276

Open
eggerdj opened this issue Oct 22, 2020 · 1 comment
Open

Min, max, ceil, floor in ParameterExpression #5276

eggerdj opened this issue Oct 22, 2020 · 1 comment
Labels
type: enhancement It's working, but needs polishing

Comments

@eggerdj
Copy link
Contributor

eggerdj commented Oct 22, 2020

What is the expected enhancement?

Support functions min, max, ceiling, and floor in ParameterExpression.

Discussion points

ParameterExpression will support comples numbers: #5192.

min and max are not well defined for complex numbers (ceiling and floor do not have this characteristic). A possible implementation could use Sympy and allow Sympy to raise errors. For example:

import sympy as sym
x = sym.Symbol('x', complex=True)
y = sym.Max(x*1.0j, -2)
y.subs(x, 1.0j)  # This works and returns -1
y.subs(x, 1.0)  # This raises ValueError: The argument '1.0*I' is not comparable.
@mrvee-qC
Copy link

mrvee-qC commented Dec 13, 2021

Update for Santa:elf:- QGoGP

✅ PR #5278 Seems to address this and is awaiting approval for being merged!

Will update comment/add more comments if cause is found/fixed!

Python version 3.9.7
qiskit-terra version: 0.19.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants