Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ This is pretty close to what I came up with. The /: and Notation is a neat trick and will definitely clean up the code some. I am curious though why del /: del[i_, j_]^_ := del[i, j]; is necessary? $\endgroup$ Commented Feb 7, 2013 at 14:31
  • $\begingroup$ When you use the commutator rule two or more times in succession it generates products of Kronecker deltas, so terms such as del[i,j]^2 (etc) can arise. The del /: del[i_, j_]^_ := del[i, j] definition simplifies these. $\endgroup$ Commented Feb 7, 2013 at 17:17
  • $\begingroup$ Ah I was reading that as del /: del[i_, j_] ^= del[i, j]. One additional question, is there any benefit to the above over something like del[i_, j_]^_ := del[i, j] without the del /:? $\endgroup$ Commented Feb 7, 2013 at 17:37
  • $\begingroup$ The effect of del /: is to make the definition associate itself with del, which is what you would want. If you omit del /: then it defaults to trying to associate itself with the Head of del[i_, j_]^_ which is Power, which is not what you you would want. Try a_^b_ := f[a,b] to see what happens. $\endgroup$ Commented Feb 8, 2013 at 0:19