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

Manipulation of complex TT vectors #30

Open
rborrelli opened this issue Jan 19, 2017 · 0 comments
Open

Manipulation of complex TT vectors #30

rborrelli opened this issue Jan 19, 2017 · 0 comments

Comments

@rborrelli
Copy link

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant