[PYTHON MATRIX-SIG] Re: Conversion

Andrew P. Mullhaupt amullhau@ix.netcom
Tue, 01 Apr 1997 15:24:49 -0500


Guido van Rossum wrote:
> 
> I have a feeling that for orthogonality, conjugate() should have to be
> a built-in function (like abs()); and that there should be some other
> built-in function (angle()?) that returns ``the other polar
> coordinate'' so that (abs(z), angle(z)) are an alternate
> representation of z.  But you can tell that I'm not a complex number
> expert :-)

You want to do several things about complex numbers, and many are
already being done.

You want to be able to extract the real and imaginary parts, and
good names for these functions are Re and Im.

You want to be able to obtain the complex conjugate, and a good name for
that function is conjugate, or perhaps co. Of course, the best way to
get this is to use * as a postfix operator for adjunction (which
specializes to complex conjugation on scalars) but this presumes using
juxtaposition for matrix (and thereby ordinary) multiplication, which is
unavailable in Python, so conjugate is probably the way to go. I'm
assuming that people who really use conjugate a lot will use stuff like

    co = conjugate

to localize the function and make their code more readable.

You want to be able to extract the modulus and the argument, and good
names for these functions are mod and arg. People frequently call the
modulus of a real number it's 'absolute value' - and that's OK since the
absolute value in the real field coincides with the complex modulus.
There are technical reasons why modulus is mathematically more appealing
than absolute value, but lots of people already think in terms of
absolute value so you probably can't clean that up, especially since
modulus also refers to remainders and fractional parts.

There is a forlorn hope that one can change the highly objectionable use
of 'j' to denote the chosen imaginary unit. The use of 'i' is much more
standard. Some Electrjcal engjneers found that they had to reserve 'i'
to represent electrical current, and relegated the chosen imaginary unit
to the letter 'j'. There is no other reason for this breach with long
established tradition, and it appears that that reason has lapsed. One
can even use the symbol 'i' for the chosen imaginary unit in the IEEE
_Transactions on Signal Processing_ without raising an eyebrow.

Later,
Andrew Mullhaupt

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________