# Question:This programme doesn't work in Maple 11, why?

## Question:This programme doesn't work in Maple 11, why?

Maple

Somebody named Alec have gave me this programme after he modified my old programme.

```isom := proc (A, B)
local C, c, e, i, j, k, l, n, p, r, s;
uses ArrayTools, LinearAlgebra, Typesetting;
n := Size(A, 1);
if Size(B, 1) <> n then return
mtext("These two algebras have different dimensions.") fi;
C := Matrix(n, symbol = c);
s := remove(attributes, map(x -> setattribute(x, Determinant(x) = 0),
map2(eval, C, [solve({seq(seq(seq(add(A[i, j, k]*c[l, k], k = 1 .. n) =
add(add(c[p, i]*c[r, j]*B[p, r, l], r = 1 .. n), p = 1 .. n),
i = 1 .. n), j = 1 .. n), l = 1 .. n)},
{seq(e, e in C)}, Explicit)])));
if s <> [] then map(x -> mrow(Typeset(x), mtext("  with determinant "),
Typeset~(lhs(attributes(x)))), s)[]
else mtext("These two algebras are not isomorphic.") fi
end:
```

It works as follows,

```A16 := Array(1 .. 5, 1 .. 5, 1 .. 5,
{(1, 1, 1) = 1, (2, 2, 2) = 1, (2, 3, 3) = 1, (3, 1, 3) = 1, (4, 4, 4) = 1,
(4, 5, 5) = 1, (5, 1, 5) = 1}, datatype = integer[4], storage = sparse):
A17 := Array(1 .. 5, 1 .. 5, 1 .. 5,
{(1, 1, 1) = 1, (1, 3, 3) = 1, (1, 5, 5) = 1, (2, 2, 2) = 1, (3, 2, 3) = 1,
(4, 4, 4) = 1, (5, 4, 5) = 1}, datatype = integer[4], storage = sparse):
isom(A16, A16);

[   1         0        0        0        0   ]
[                                            ]
[   0         0        0        1        0   ]
[                                            ]
[-c[3, 4]     0        0     c[3, 4]  c[3, 5]]  with determinant c[5, 3] c[3, 5],
[                                            ]
[   0         1        0        0        0   ]
[                                            ]
[-c[5, 2]  c[5, 2]  c[5, 3]     0        0   ]

[   1         0        0        0        0   ]
[                                            ]
[   0         1        0        0        0   ]
[                                            ]
[-c[3, 2]  c[3, 2]  c[3, 3]     0        0   ]  with determinant c[3, 3] c[5, 5]
[                                            ]
[   0         0        0        1        0   ]
[                                            ]
[-c[5, 4]     0        0     c[5, 4]  c[5, 5]]

isom(A16, A17);

These two algebras are not isomorphic.

A1 := Array(1 .. 2, 1 .. 2, 1 .. 2,
{(1, 1, 1) = 1, (1, 2, 2) = 1, (2, 1, 2) = 1, (2, 2, 1) = -1},
datatype = integer[4], storage = sparse):
isom(A1, A1);

[1  0]                      [1   0]
[    ]  with determinant 1, [     ]  with determinant -1
[0  1]                      [0  -1]

A2 := Array(1 .. 2, 1 .. 2, 1 .. 2,
{(1, 1, 1) = 1, (1, 2, 2) = 1, (2, 1, 2) = 1, (2, 2, 1) = a, (2, 2, 2) = b}):
isom(A2, A1);

[          1          ]
[1         - b        ]
[          2          ]                                2
[                     ]                   sqrt(-4 a - b )
[                (1/2)]  with determinant ---------------,
[   1 /        2\     ]                          2
[0  - \-4 a - b /     ]
[   2                 ]

[          1            ]
[1         - b          ]
[          2            ]                                  2
[                       ]                     sqrt(-4 a - b )
[                  (1/2)]  with determinant - ---------------,
[     1 /        2\     ]                            2
[0  - - \-4 a - b /     ]
[     2                 ]

```

I've wrote this programme in Maple 11, but the result not same with this, why? Is it have any changing in this programme?

And this is the same programme which i wrote in Maple 11.

> isom := proc (A, B) local C, c, e, i, j, k, l, n, p, r, s; n := Size(A, 1); if Size(B, 1) <> n then return Typesetting:-mtext("These two algebras have different dimensions.") end if; C := Matrix(n, symbol = c); s := remove*(attributes, map(proc (x) options operator, arrow; setattribute(x, Determinant(x) = 0) end proc, map2(eval, C, [solve({seq(seq(seq(add(A[i, j, k]*c[l, k], k = 1 .. n) = add(add(c[p, i]*c[r, j]*B[p, r, l], r = 1 .. n), p = 1 .. n), i = 1 .. n), j = 1 .. n), l = 1 .. n)}, {seq(e, `in`(e, C))}, Explicit)]))); if s <> [] then map(proc (x) options operator, arrow; mrow(Typeset(x), mtext(" with determinant "))*Typeset*`~`*lhs(attributes(x)) end proc), s[] else Typesetting:-mtext("These two algebras are not isomorphic.") end if end proc;
> A16 := Array(1 .. 5, 1 .. 5, 1 .. 5, {(1, 1, 1) = 1, (2, 2, 2) = 1, (2, 3, 3) = 1, (3, 1, 3) = 1, (4, 4, 4) = 1, (4, 5, 5) = 1, (5, 1, 5) = 1}, datatype = integer[4], storage = sparse);
> A17 := Array(1 .. 5, 1 .. 5, 1 .. 5, {(1, 3, 3) = 1, (1, 5, 5) = 1, (3, 2, 3) = 1, (5, 4, 5) = 1, (1, 1, 1) = 1, (2, 2, 2) = 1, (4, 4, 4) = 1}, datatype = integer[4], storage = sparse);
>
> isom(A16, A16);
Error, (in Matrix) dimension parameters are required for this form of initializer
> isom(A16, A17);
These two algebras have different dimensions.
>
> A1 := Array(1 .. 2, 1 .. 2, 1 .. 2, {(1, 1, 1) = 1, (1, 2, 2) = 1, (2, 1, 2) = 1, (2, 2, 1) = -1}, datatype = integer[4], storage = sparse);
> A2 := Array(1 .. 2, 1 .. 2, 1 .. 2, {(1, 1, 1) = 1, (2, 2, 1) = alpha, (2, 2, 2) = beta, (1, 2, 2) = 1, (2, 1, 2) = 1});
>
> isom(A1, A1, 2);
Error, (in Matrix) dimension parameters are required for this form of initializer
> isom(A2, A1);
These two algebras have different dimensions.

Thank you.

﻿