-
Notifications
You must be signed in to change notification settings - Fork 198
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
PolynomialTensor._multiply has incorrect type signature #896
Comments
Do you have some specific issue with the type? It follows the mixin definition from Terra (though there the type is specified on the arg) and the multiply checks Number the same way |
Please see #891 (comment) for context. Let me know if the issue is still not clear. |
Alright, let me try to summarize the situation of numeric type hints in Python. This is quite the convoluted rabbit hole, but I will try to keep it short and simple. Overview
What does this mean for us?
While this causes a technical mismatch, this is a technicality. When I see a type supporting So what do we do now?I consider this issue a minor technicality which we should not get hung up on. Instead, I suggest that we continue with my outline in the previous section, and if we do ever encounter a bug specifically because of this, we can revisit this given the specific scenario (but I do not think that further theoretical discussion on this topic is needed). Thus, I am closing this issue as per the above. |
Environment
What is happening?
In https://github.com/Qiskit/qiskit-nature/blob/ba3a191b30606d6c1da5c378de2eea7bceaeab57/qiskit_nature/second_q/operators/polynomial_tensor.py#L331
other
is typed ascomplex
even though the code assumes it's aNumber
. I tried replacingNumber
withcomplex
orComplex
but that still gave errors; I think this is a bit delicate to fix.How can we reproduce the issue?
N/A
What should happen?
Types should be correct.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: