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.
[...]
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:
which printsuse 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";
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.5+8i (should be 5+10i) 10-5i (should be 8-5i)
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
|
|---|
| 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 | |
by etj (Priest) on Jun 21, 2022 at 17:44 UTC |