Thanks! I started looking around PDL::LinearAlgebra, and, as I suspected, many of the routines should be modified to accomodate the native complex'es. For example, consider a 1x1 complex square matrix:
pdl> use PDL::LinearAlgebra pdl> $a=pdl([[i()]]) pdl> p $a [ [i] ] pdl> p $a->t [ [i] ] pdl> p $a->issym 1 pdl> use PDL::Complex Subroutine sumover redefined... pdl> $b=pdl([[1]])*i() pdl> p $b [ [i] ] pdl> p $b->t [ [-i] ] pdl> p $b->issym 0 pdl> Thus, the 't' method transposes the matrix if it uses native complex numbers, but transposes it *and* conjugates it (by default) if it uses PDL::Complex numbers. Similarly, the issym function tests for symmetry when acting on PDL's (even native complex ones), but test for Hermiticity when acting on PDL::Complex's. The same happens for most other routines that act differently on complex than on real numbers, but treat PDL's as real and only PDL::Complex's as complex. Regards, Luis On Sat, Sep 25, 2021 at 06:51:48PM +0000, Ed . wrote: > Thank you. Now merged your change (thanks for adding tests too) and released > 0.23. > > From: Luis Mochan<mailto:moc...@icf.unam.mx> > Sent: 25 September 2021 18:49 > To: perldl<mailto:pdl-general@lists.sourceforge.net>; > perldl<mailto:pdl-de...@lists.sourceforge.net> > Subject: Re: [Pdl-devel] native complex and PDL::LinearAlgebra > > On Sat, Sep 25, 2021 at 03:33:29PM +0000, Ed . wrote: > > Hi Luis, > > > > I’ll take a look shortly (in the final stages of getting the multi-C to > > work). Can you confirm whether this worked according to your expectation in > > 2.057? > > This failed in 2.057. > > Best regards, > Luis > > > > From: Luis Mochan<mailto:moc...@icf.unam.mx> > > Sent: 25 September 2021 15:49 > > To: perldl<mailto:pdl-general@lists.sourceforge.net>; > > perldl<mailto:pdl-de...@lists.sourceforge.net> > > Subject: [Pdl-devel] native complex and PDL::LinearAlgebra > > > > > > Hi, > > > > Congrats on the new release. > > > > I found an error in PDL::LinearAlgebra. > > > > pdl> use PDL::LinearAlgebra > > pdl> $a=(1+sequence(2,2))*i() > > pdl> p $a > > [ > > [ i 2i] > > [3i 4i] > > ] > > pdl> p $a->mdet > > 0 # instead of 2 > > > > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Av. Universidad s/n CP 62210 | (*)/\/ \ > Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ > GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB > > > _______________________________________________ > pdl-devel mailing list > pdl-de...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pdl-devel > -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB _______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general