MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: On Defining Functions Symmetric wrt Some Indices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34326] RE: [mg34316] On Defining Functions Symmetric wrt Some Indices
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 15 May 2002 03:35:15 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Alexei,

One method to obtain partially ordered arguments is to use subvalues with
the first argument list Orderless.

ClearAll[f];
Attributes[f] = {Orderless};

f[2, 3][1, 4] + f[3, 2][1, 4]
2 f[2, 3][1, 4]

f[2, 3][1, 4] + f[2, 3][4, 1]
f[2, 3][1, 4] + f[2, 3][4, 1]

But I don't like that method too well. Here is another method.

ClearAll[f]
f[a_, b_, c_] /; ¬ OrderedQ[{b, c}] := f[a, c, b]

f[1, 3, 2] + f[1, 2, 3]
2 f[1, 2, 3]

f[1, 2, 3] + f[2, 1, 3]
f[1, 2, 3] + f[2, 1, 3]

You could also define anti-symmetry by

ClearAll[f]
f[a_, b_, c_] /; ¬ OrderedQ[{b, c}] := -f[a, c, b]

f[1, 3, 2] + f[1, 2, 3]
0

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


> From: Alexei Akolzin [mailto:akolzine at uiuc.edu]
To: mathgroup at smc.vnet.net
>
> Hello,
>
> For the purposes of formula simplification I need to specify that some
> function "f" is symmetric upon SOME of its indices. For example,
> f[a,b,c] == f[a,c,b] but NOT equal to f[b,a,c].
>
> The proposed command SetAttribute[f,Orderless] makes the function
> symmetric wrt ALL of its indices, which I want to avoid.
>
> Is there is a way to neatly solve this problem?
>
> Thanks.
>
> Alexei.
>



  • Prev by Date: RE: On Defining Functions Symmetric wrt Some Indices
  • Next by Date: RE: RE: Conditional evaluation
  • Previous by thread: RE: On Defining Functions Symmetric wrt Some Indices
  • Next by thread: RE: On Defining Functions Symmetric wrt Some Indices