# Question:Why the output of an expression using indexed name reversing coefficient and indeterminant?

## Question:Why the output of an expression using indexed name reversing coefficient and indeterminant?

Maple 2019

I have encountered a peculiar behavior in Maple 2019 worksheets. I have attached a worksheet which illustrates a reversal of the coefficient and the blade in the following types of expression.  My Maple installation is set in options to use maple input and output (1D notation).  I am using build ID 1399874.

The procedure I was testing used the add function to expand a multivector over basis blades and coefficients represented by indexed names; for example
add(a[indx[]]*e[indx[]], indx = indxes); where indxes:={,,,[1,2],[1,3],[1,4],[2,3],[2,4]};

The expected result
a*e+a*e+a*e+a*e[1, 2]+a*e[1, 3]+a*e[1, 4]+a*e[2, 3]+a*e[2, 4] in 1D notation but instead I got

e*xx+e*xx+e*xx+e[1, 2]*xx+e[1, 3]*xx+e[1, 4]*xx+ e[2, 3]*xx+e[2, 4]*xx

(Note and the different coefficient names illustrates the exchange is caused by sorting.)

Initially, I assumed that this resulted from the add command, but after I directly entered an indexed expression into the worksheet and obtained a similar result I realized it must be occurring during the output.  Apparently, before the expression is written, it is first sorted. I know this because, if the coefficient is named a,b,c,d ( less than e), the expression is not exchanged. In addition, if I convert the expression to 2D output, the expression is written in the normal order specified in the add command.

I also confirmed this behavior in Maple 2018.2 as well.  Hopefully, the example worksheet attached will illustrate this behavior.  Am I correct in assuming that when the code I am using in the worksheet with is incorporated into a module in an mpl file and loaded, this will not be an issue.

exchangeproblem.mw ﻿