Re: Simplifying Conjugate[] with 5.2 Mac
- To: mathgroup at smc.vnet.net
- Subject: [mg59823] Re: Simplifying Conjugate[] with 5.2 Mac
- From: "Carl K. Woll" <carlw at u.washington.edu>
- Date: Tue, 23 Aug 2005 04:51:17 -0400 (EDT)
- Organization: University of Washington
- References: <de45i8$qtf$1@smc.vnet.net> <de6maf$cj5$1@smc.vnet.net> <de9cqi$q5a$1@smc.vnet.net> <debt13$9bu$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"James Gilmore" <james.gilmore at yale.edu> wrote in message news:debt13$9bu$1 at smc.vnet.net... [snip] > Are you just interested in changing I's to -I's? If so, I would suggest > that > you forget about Conjugate altogether and use pattern matching instead. > This > will give you an efficient method that will not depend on the internals of > Conjugate. You will also not have to deal with changes in future versions > of > Mathematica. > > The other suggestions in this thread are compared to the pattern matching > method below. It is clear pattern matching is the most efficient for the > simple form tested: > $ProductInformation > {"ProductIDName" -> "Mathematica", "ProductKernelName" -> > "Mathematica 5 Kernel", "ProductVersion" -> > "5.0 for Microsoft Windows (June 11, 2003)", > "ProductVersionNumber" -> 5.} > ConjugateSimple[z_] := z /. {I -> -I, -I -> I} This definition is too simple: In[6]:= ConjugateSimple[1+2I]//OutputForm Out[6]//OutputForm= 1 + 2 I A better definition would use Complex, as in Complex[a_,b_]->Complex[a,-b]. [snip] Carl Woll Wolfram Research