in reply to Re^2: PDL works for real number matrix operations, but not working for complex number matrix operations.
in thread PDL works for real number matrix operations, but not working for complex number matrix operations.

You wrote:

Equation 1: (1+i)*Xsub1 + (2+i)*Xsub2 = 5+10i Equation 2: (1-2i)*Xsub1 + (2-i)*Xsub2 = 8 -5i
[...]

This says that Xsub1 = 3+i, and Xsub2 = 2+i .....which is the correct result!

No, it isn't! I checked your result manually and couldn't believe what I found. So I took out PDL (which I'm not particularly familiar with) and used Math::Complex to run the following:

use Math::Complex; my ( $m11, $m12) = ( 1 + i, 2 + i); my ( $m21, $m22) = ( 1 - 2*i, 2 - i); my $b1 = 5 + 10*i; my $b2 = 8 - 5*i; my $xsub1 = 3 + i; my $xsub2 = 2 + i; my $r1 = $m11*$xsub1 + $m12*$xsub2; my $r2 = $m21*$xsub1 + $m22*$xsub2; print "$r1 (should be $b1)\n"; print "$r2 (should be $b2)\n";
which prints
5+8i (should be 5+10i) 10-5i (should be 8-5i)
Pardon me for being blunt, but you should have checked your result yourself instead of sending me (and who knows how many venerable monks more) on a wild-goose chase.

Apart from that, I don't see how you arrive at the real 4x4 matrix that you use to represent a complex 2x2 matrix. I think there is such a representation, but the one you're using is obviously wrong.

I have not followed your calculations any further. Very probably the result Math::Pari gave you is the correct one.

Anno

Update: Corrected mistaken reference to Math::Pari

  • Comment on Re^3: PDL works for real number matrix operations, but not working for complex number matrix operations.
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: PDL works for real number matrix operations, but not working for complex number matrix operations.
by gmacfadden (Sexton) on Mar 21, 2007 at 17:00 UTC
    Anno, please accept my sincere apology. I'm grateful for your's and all the monks' altruism in helping those of us trying to come up on the learning curve. I feel badly about whatever time the bespoke error caused you to waste.

    I will re-create a correct problem statement for my PDL question. If you can forgive this mistake, I would again value and invite your and the monk community's help.
      The differently-asked question was at PDL::Complex question. The answer was that PDL::Complex has severe limitations which can be partly mitigated by using PDL::LinearAlgebra; a more complete solution was part of PDL 2.040 with "native complex" number support.