You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found a problem when using TT complex vectors. When adding complex vectors with a zero imaginary component the code automatically change the result to real. This is due to the use of the numpy.iscomplex() function that return false if the imaginary component of a number is zero, (1+1j*0.0 is not complex).
While this seems a desired feature I found that it can be a trouble when reading and writing vector from a file, because it might happen that you think you are writing a complex vector but it is written as a real, so when you try to read it you have problems because you don't know what you are reading. Wouldn't it be simpler to stick to complex numbers even if the imaginary part is zero? After all if the user is using complex numbers probably he knows that his data are complex. This can be easily done by checking the data type instead of using iscomplex().
The text was updated successfully, but these errors were encountered:
I have found a problem when using TT complex vectors. When adding complex vectors with a zero imaginary component the code automatically change the result to real. This is due to the use of the numpy.iscomplex() function that return false if the imaginary component of a number is zero, (1+1j*0.0 is not complex).
While this seems a desired feature I found that it can be a trouble when reading and writing vector from a file, because it might happen that you think you are writing a complex vector but it is written as a real, so when you try to read it you have problems because you don't know what you are reading. Wouldn't it be simpler to stick to complex numbers even if the imaginary part is zero? After all if the user is using complex numbers probably he knows that his data are complex. This can be easily done by checking the data type instead of using iscomplex().
The text was updated successfully, but these errors were encountered: