conjugate is weird



> conj(x):=realpart(x)-%i*imagpart(x);
> ...seems to work well. But complex conjugation is such a common 
> operation that it really needs to be build in.

There are two issues here: conjugate as an operation on expressions
(what Maxima calls a verb form), and conjugate as a mathematical
function (noun form).  The verb form "does" something; the noun form
"means" something.

For the verb, your definition above works fine, with the disadvantage
that in general it makes expressions larger.  Assuming z is declared
complex, consider for example conj(conj(z)).  (I'll use conj from now on
for brevity.)  The definition in Eigen is also correct for compositions
of analytic functions of real variables, but not in general for
non-analytic functions or for variables declared complex.  Maxima
currently assumes that all undeclared variables and functions are
real-valued.  This should probably be changed so that if domain=complex,
they are all assumed complex-valued.

For the noun, things are a little more complicated.  It is of course
trivial to create a noun form conjugation operation: 'conj(z) will do
it.  But this is pretty useless without accompanying simplification
rules such as conj(conj(z))=>z; abs(conj(z))=>abs(z) etc.  But what is
"simplification"?  In one approach to complex variables, conj is
fundamental, not realpart/imagpart (rectform) or cabs/carg (polarform).
So the simplification of abs(z) is sqrt(z*conj(z)); the simplification
of carg(z) is(z); the simplification of realpart(z) is (z+conj(z))/2;
the simplification of carg(z) is sqrt(z/conj(z)); etc.  You might call
that conjform.  Right now, Maxima doesn't even do a very good job of
handling polarform, much less conjform -- for example, it never uses the
noun form of carg.

In general, Maxima is very uneven in its support of the complex
declaration and of domain:complex.  Even within the realpart/imagpart
package, it is not handled correctly -- that is definitely a bug (which
I am reporting separately).

So there is some work to be done here....

      -s