Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Type coercion on Symbols to get symbolic complex conjugation

38 views
Skip to first unread message

Patrick Reany

unread,
Jun 15, 1999, 3:00:00 AM6/15/99
to
I'm trying to mix complex conjugation on demonstrably complex numbers,
like a + b I (which works fine), with conjugation on symbols, such as
taking k -> k* ,which doesn't work because

1) it appears that in some cases Mathematica treats all symbols not
demonstrably equal to a complex number as a noncomplex number, in which
case if I could coerce it to complex by something like

makeComplex[x_] := Complex[x]

(which doesn't work) I might have a chance; or

2) in other cases that k -> Conjugate[k], which would be OK if I could
get it to print out as k* or overbar k.

What follows are a couple things I've already tried:

Conjugate[a_] := a* /; SymbolQ[a];
Format[Conjugate[x_]] :=x* /; SymbolQ[x]

In summary: I want to declare a symbol, say k, as having Head Symbol or
Complex and then to print out (display) the Conjugate of k in the form
of either k* or overbar k. (I use version 3.)

Thanks.

Harald Giese

unread,
Jun 17, 1999, 3:00:00 AM6/17/99
to
Patrick Reany wrote:
> ...

> In summary: I want to declare a symbol, say k, as having Head Symbol or
> Complex and then to print out (display) the Conjugate of k in the form
> of either k* or overbar k. (I use version 3.)
>

Hi Patrick,

There is a package called "Utilities`Notation`". I am not sure, whether
it is already included in Mathematica 3.0 (look at the Help Browser -> AddOns ->
Extra Utilities) or must be downloaded.

The documentation can be found at:
http://documents.wolfram.com/v4/GettingStarted/NotationMaker/None.html

You should to be able to create the notation you are looking for with
this package.

Hope that helps.

Regards,
Harald

--
Harald Giese
Email: gi...@dkrz.de
> NEUE TELEFON-NUMMER | NEW PHONE-NUMBER <
Phone: +49 (0)40 42838 5796; Fax: +49 (0)40 5605724
Institut fuer Meereskunde der Universitaet Hamburg
(Institute of Oceanography of the University of Hamburg)
Troplowitzstrasse 7, D-22529 Hamburg


Jens-Peer Kuska

unread,
Jun 17, 1999, 3:00:00 AM6/17/99
to
Hi Patrick,

The definition


ToBoxes[Conjugate[x_],form_:TraditionalForm]:=SuperscriptBox[ToBoxes[x],"*"]

will print the complex conjugate in the form you like.
Since Mathematica knows no types for symbols it has no information
about you assumption that some variables are complexes. In Mathematica 4
you can specify that Element[z,Complexes] for Simplify and
FullSimplify[]
but not more.

Regards
Jens


Patrick Reany wrote:
>
> I'm trying to mix complex conjugation on demonstrably complex numbers,
> like a + b I (which works fine), with conjugation on symbols, such as
> taking k -> k* ,which doesn't work because
>
> 1) it appears that in some cases Mathematica treats all symbols not
> demonstrably equal to a complex number as a noncomplex number, in which> case if I could coerce it to complex by something like
> > makeComplex[x_] := Complex[x]
> > (which doesn't work) I might have a chance; or
> > 2) in other cases that k -> Conjugate[k], which would be OK if I could
> get it to print out as k* or overbar k.
> > What follows are a couple things I've already tried:
> > Conjugate[a_] := a* /; SymbolQ[a];
> Format[Conjugate[x_]] :=x* /; SymbolQ[x]
>

> In summary: I want to declare a symbol, say k, as having Head Symbol or
> Complex and then to print out (display) the Conjugate of k in the form
> of either k* or overbar k. (I use version 3.)
>

> Thanks.


0 new messages