Type coercion on Symbols to get symbolic complex conjugation
- To: mathgroup at smc.vnet.net
- Subject: [mg18074] Type coercion on Symbols to get symbolic complex conjugation
- From: Patrick Reany <reany at xroads.com>
- Date: Tue, 15 Jun 1999 01:43:32 -0400
- Delivery-date: Tue Jun 15 07:15:54 1999
- Organization: Crossroads Communications
- Sender: owner-wri-mathgroup at wolfram.com
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.