[Date Index] [Thread Index] [Author Index]
Re: Type coercion on Symbols to get symbolic complex conjugation
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.