Re: Define an antisymmetric function
- To: mathgroup at smc.vnet.net
- Subject: [mg107448] Re: Define an antisymmetric function
- From: Torsten Schoenfeld <kaffeetisch at gmx.de>
- Date: Fri, 12 Feb 2010 05:44:33 -0500 (EST)
- References: <hl0r36$uu$1@smc.vnet.net> <201002111307.IAA03558@smc.vnet.net> <hl380m$ekc$1@smc.vnet.net>
On 12.02.10 10:45, Leonid Shifrin wrote: > ClearAll[G]; > G[a, b] := f[a, b] > G[a, c] := g[a, c] > G[b, c] := h[b, c] > G[x_, y_] := -G[y, x] /; > Hold[G[y, x]] =!= (Hold[G[y, x]] /. Most@DownValues[G]) This actually works perfectly fine even if pattern-based definitions are involved! (Pattern-based definitions appear normally in DownValues.) I neglected to mention it, but G[_, _] is also supposed to act as a derivative in both slots, e.g. G[x_, y_^2] := 2 G[x, y] y. Your approach handles this gracefully: G[x^2, y] yields -2 x G[y, x]. So, thanks a lot! Thanks also for all the other suggestions in this thread; I learned many nice tricks.
- References:
- Re: Define an antisymmetric function
- From: Szabolcs Horvát <szhorvat@gmail.com>
- Re: Define an antisymmetric function