MathGroup Archive 2004

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

Search the Archive

Re: How to substitute?


\!\(\((y\_0 - z\_3)\)\ \((\(-y\_1\) + z\_3)\)\ \((\(-y\_2\) + 
          z\_3)\)\ \((\(-y\_3\) + z\_3)\)\  /. \ \((a_. *y\_i_ + 
          b_. \ \ z\_j_)\) :> \ Q[{a, i}, {b, j}]\)


Steve Gray wrote:
> \!\(\((y\_0 - z\_3)\)\ \((\(-y\_1\) + z\_3)\)\ \((\(-y\_2\) +
>         z\_3)\)\ \((\(-y\_3\) + z\_3)\)\)
>         I have output cells containing various expressions such as
> (y[0]-z[1]) (y[1]-z[2]) (y[4] - z[0]), where I use [x] here to mean
> subscript. The integers can have any small values. For compactness of
> expression, I want to make substitutions which make the above
> expression look like Q[0,1]Q[1,2]Q[4,0]. There are many combinations
> of subscript pairs and I don't want to write explicit substitution
> rules for every possible combination. I tried doing /.(y[i]-z[j]) ->
> Q[i,j] , and /.(y[i_]-z[j_]) -> Q[i,j] but they don't work.
>         Any suggestions will be gratefully received.

  • Prev by Date: Re: composing functions
  • Next by Date: hyperlink to pdf files
  • Previous by thread: RE: How to substitute?
  • Next by thread: preserve neighborhood during random reordering