complex conjugation

Richard B. Kreckel kreckel at thep.physik.uni-mainz.de
Sat Dec 20 16:54:44 CET 2003


Salam

On Fri, 19 Dec 2003 chrisd at sci.kun.nl wrote:
> Do not know how it is with you, but almost all of the symbols I use are
> supposed to stand for something real. Having cconj(x) in a result is
> strange if I know that x is real (and having to do
> .subs(lst(cconj(x)==x,cconj(y)==y,...)) after a conjugation is at least as
> awkward as my original proposal of having the user use a list of the form
> {a==astar,astar==a,etc}). Is there anything wrong with each symbol
> containing a boolean that says whether it is real? You could then have the
> evaluation cconj(x) -> x for real symbols.

One remark.  Maybe you all are aware of it but it was not spelled out in
this thread (yet).

We've always had the assumption of all symbols representing something
complex by default in the backs of our minds.  And I think this should not
be changed.  However, if the user wants to tell the system a bit more
about a symbol's domain and the system can put that knowledge into use,
that would be Just Fine (tm).

Just consider the (in-)famous log(exp(x)) example.  We do not let the
anonymous evaluator simplify that to x.  The reason is log() not being a
single-valued function -- log(exp(42.0*I)) != 42.0*I.  However, we do
evaluate exp(log(x)) -> x anomymously because that is correct in the whole
complex domain.

If a flag saying "I am real" would be attached to some symbol x we could
have a look into the pseudofunction evaluation routines and allow
log(exp(x)) -> x.  And many many others, too.

Cheers
    -richy.
-- 
Richard B. Kreckel
<Richard.Kreckel at GiNaC.DE>
<http://www.ginac.de/~kreckel/>




More information about the GiNaC-devel mailing list