pyunlocbox
pyunlocbox copied to clipboard
WIP: fixing broken support for complex numbers and adding new complex functionality
This is a work-in-progress pull request that I recommend not to merge in until I am done fixing and implementing new complex support features. I will be adding commits to this branch as I go along.
This PR addresses #11
Coverage decreased (-0.2%) to 98.376% when pulling a9cfec3b51140973f135985ebd01068d97edff0a on ThomasA:fix_complex into ee37c50586a445e2a8d851028d5e878a16164e89 on epfl-lts2:master.
I am currently working on making the compressed sensing forward-backward example from the tutorial work. So far the example seems able to complete without discarding imaginary parts anywhere, but at least the l-2 norm still computes wrong and my so far un-committed attempts at fixing it still lead to wrong solutions...
The above-mentioned compressed sensing forward-backward example now seems to work correctly. The next steps will be to determine which other parts of the package may have complex number issues and also to implement further tests to validate the so far altered code for complex numbers.
I am adding tests to test everything with complex numbers as well. Should I test with complex numbers in addition to the already existing tests, or should I replace the numbers in the existing tests with complex numbers? In principle, testing everything with complex numbers should be more general and ensure that it works with real numbers as well, but maybe someone would like to keep the strictly real tests?
I have been thinking about this adaptation of the toolbox to handle complex numbers. Wouldn't it be better to just input n-by-2 matrices instead of n-dimensional complex vectors? Are there any operations currently implemented in pyunlocbox that would fail if you were simply to add an extra dimension to your input to account for the imaginary part?
Hi @ThomasA. I know it's been a long time, but may I ask what is the status of this PR?
(There are some more commits in another branch of yours at https://github.com/ThomasA/pyunlocbox/commits/fix_complex_tmp.)
@ThomasA if you want to finish this, I would be happy to help.
It has been so long now that I need to dig around a bit to remember where I got to, but it would actually be nice exercise to finish this up.