Re: Creating an Attribute AntiSymmetric ?!?!?!
- To: mathgroup at smc.vnet.net
- Subject: [mg6428] Re: [mg6279] Creating an Attribute AntiSymmetric ?!?!?!
- From: fransm at win.tue.nl (Frans Martens)
- Date: Thu, 20 Mar 1997 00:52:25 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, Bjoern Hassler wrote several weeks ago > is there a way of creating your own Attributes? > In particular I am looking for an attribute which > work like Orderless (especially in wrt. to pattern > matching), but makes a function totally anti(skew)- > symmetric, rather than totally symmetric. and Paul Abbot replied > The following ideas have appeared in various issues of the > Mathematica Journal. .... and with a suggestion > In[4]:= f[x__ /; !OrderedQ[{x}]] := Signature[{x}] f @@ Sort[{x}] > > attached to f, ensures that it is antisymmetric independent of the > number of its arguments. An example illustrates the utility of the > technique: etc. The following rule is more adequate: f[x__ /; Union[{x}]=!={x}]:= ReleaseHold[Signature[{x}] Hold[f @@ Sort[{x}]]] With this rule f[1,1,2] yields 0 and f[1,1,2] itself is not computed! Frans Martens Eindhoven The Netherlands