Re: few easy questions
- To: mathgroup@smc.vnet.net
- Subject: [mg11500] Re: [mg11451] few easy questions
- From: "C. Woll" <carlw@u.washington.edu>
- Date: Fri, 13 Mar 1998 12:21:52 -0500
Hi Arturas, Concerning your first question, the reason Dt[x_]:>1 doesn't work can be found by examining the FullForm of the rule FullForm[Dt[x_]:>1] RuleDelayed[Times[Dt[x],Derivative[1,0][Pattern][Blank[]]],1] We see that the derivative is acting on the function x_ (which in FullForm is given by Pattern[x,Blank[]]). I can see two ways around this. One is to use the rule Dt[a] /. HoldPattern[Dt[x_]]:>1 The other is to use the rule Dt[a] /. x_Dt :> 1 as you basically did. The problem with the latter approach is if you want the rule to depend on the value of a. Suppose you want Dt[a] to go to some function of a, f[a]. Then you could do the following Dt[a] /. x_Dt :> f @@ Unevaluated[x] Is this the explanation you were looking for? Carl Woll Dept of Physics U of Washington On Thu, 12 Mar 1998, Arturas Acus wrote: > Hello, Group > > 1) > Why this two substitutions act differently In[9]:= > {Dt[a], Sin[a]} //. {Dt[x_] :> 1, Sin[x_] :> 1} Out[9]= > {Dt[a], 1} > > Of course the dirty trick bellow works, but I am still interesting > what's > going. > > In[10]:= > Dt[a] //. {x_Dt :> mydt[x], mydt[x_] :> 1} > > 2) > Thanks to P. Abbot I know about number of packages for tensor > manipulation. I was rather interesting in "EinS" and planned to use it > as a starting point of my own purposes. Unfortunately, the package is > encoded, (like STensor, and MathTensor) and the author do not intended > to put the actual > code for free use. So I have few questions about that format a)Is the > format simple encoding or it includes some precompilation, compression, > etc.? > b) How the encoding acts on general performance of the code(speed up?)? > c) Do algorithms on manipulation of dummy indices are such a huge > problem ? > d)How to make this encoding myself ? ( I could not hope that anybody > could answer me how to decode them :-) > ).What is WRI opinion on the topic. > > > Sincerely, > Arturas Acus > Institute of Theoretical > Physics and Astronomy > Gostauto 12, 2600,Vilnius > Lithuania > > > E-mail: acus@itpa.lt > Fax: 370-2-225361 > Tel: 370-2-612906 > >