-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
EHN: make real_if_close elementwise #11375
Comments
The function may be weird, but it does exactly what the documentation says it does? |
True. I thought it was elementwise, like |
Well, the question is why it's not elementwise? I can't imagine any usecase for current behaviour. |
The use case is probably to call it on an input that requires a real datatype, which most of the time would probably just error out if the input was still complex then. Not that I really know that the use case is very useful, heh. |
Also:
|
Anyway, I doubt we should change the function, we could add a kwarg argument, or since I doubt it is used much, create a new similar one and deprecate this one (but should ping the list or check downstream first, it is not unlikely that I am completely misjudging and this function is used a lot). |
I'm not sure this function is useful enough to be in numpy in the first place, let alone having two similar buyt different copies - For what @homocomputeris wants, |
Scipy uses |
@eric-wieser It seems that |
@eric-wieser @rgommers The
In qiskit the Because of the last item I would prefer the |
@seberg has pointed out that this function in not elementwise (yeah, I can't read the docs, obviously). It would be nice to have the possibility to apply it to each element.
gives
and M is not changed.
Version info:
The text was updated successfully, but these errors were encountered: