URL:
  <https://savannah.gnu.org/bugs/?66574>

                 Summary: Feature: complex singular value decomposition
                   Group: GNU Scientific Library
               Submitter: mangrove84
               Submitted: Wed 18 Dec 2024 11:34:07 AM CET
                Category: None
                Severity: 3 - Normal
        Operating System:
                  Status: None
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: v2.8


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Wed 18 Dec 2024 11:34:07 AM CET By: Christian Krueger <mangrove84>
Hi all,

I'm offering a series of patches against GSL v2.8 that implements the singular
value decomposition (SVD) for complex matrices.

The patches are attached and should be applied in correct order (see
filename). There are several patches because I wanted to keep the changes
contained within logic units, and there are several changes made to GSL before
the complex SVD can be implemented.

The attached patches implement complex SVD into GSL and it works (including
tests), but as the changes are quite deep in GSL, even though I implemented to
the best of my knowledge, I'm not entirely sure if I followed GSL design
everywhere.

The patches come with changes to the GSL documentation and a bunch of tests.

Whoever sees use in this is welcome to use those patches; if they are useful,
I am happy for those to be implemented into GSL.



In more detail:


1) 1_householder_cmplx.patch

This implements a new function gsl_linalg_complex_householder_right() that
multiplies a Householder transformation to the right of a matrix. This is in
line with the corresponding function for real matrices.


2) 2_givens_cmplx.patch

This implements Givens rotations for complex vectors.


3) 3_bidiag_cmplx.patch

This implements the bidiagonalisation for complex matrices. For the function
bidiag_unpack2(), I have also implemented complex_householder_hm1(), which is
a specialised function for householder multiplications (optimised for
particular HH multiplications). Using this function allows to have fewer work
spaces.


4) 4_svd_cmplx.patch

This implements the complex SVD.




Questions/Issues:

a) The complex Givens rotation that I found has the minus sign for the sines
swapped, i.e., the negative element is the bottom left one. In the real-valued
implementation within GSL the top right one is the negative one.

b) For the bidiagonalisation, the function
gsl_linalg_complex_householder_hm1() is marked as deprecated (it was already
for real matrices) but this function seems to be very useful for the
bidiagonalisation procedure. Perhaps it should stay within GSL?

c) For the real SVD, there is a compiler switch "USE_BLAS" which implements
certain parts of the real SVD using BLAS functions. For the complex SVD, some
function gsl_blas_zdrot() would be necessary, which, however, is not
implemented yet. I haven't had time to understand the BLAS implementation;
also, the switch "USE_BLAS" seems to be undocumented and it's not clear if it
is used at all? Due to this, I have commented out the USE_BLAS switch for
complex SVD. Once gsl_blas_zdrot() exists in GSL, this could be extended if
necessary.






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Name: 2_givens_cmplx.patch  Size: 6KiB
<https://file.savannah.gnu.org/file/2_givens_cmplx.patch?file_id=56699>
-------------------------------------------------------
Name: 4_svd_cmplx.patch  Size: 31KiB
<https://file.savannah.gnu.org/file/4_svd_cmplx.patch?file_id=56700>
-------------------------------------------------------
Name: 1_householder_cmplx.patch  Size: 17KiB
<https://file.savannah.gnu.org/file/1_householder_cmplx.patch?file_id=56697>
-------------------------------------------------------
Name: 3_bidiag_cmplx.patch  Size: 38KiB
<https://file.savannah.gnu.org/file/3_bidiag_cmplx.patch?file_id=56698>

    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-3b9d8f2f3b65257ee40f9dc78baa5a1aa46a8a5e.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66574>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to