Question: How to convert and why this programme?

How to convert this equation?

RootOf(_Z^2+alpha+_Z, label = _L3)

and why this programme take long time to evaluate?

> isom := proc (A, B, n) local i, j, k, s, r, eqns, t, ISM, BChange, sols, l, S1, S2, C; C := matrix(n, n); BChange := matrix(n, n); ISM := 0; eqns := {}; for i to n do for j to n do for l to n do S1 := sum(A[i, j, k]*C[l, k], k = 1 .. n); S2 := sum(C[p, i]*(sum(C[r, j]*B[p, r, l], r = 1 .. n)), p = 1 .. n); eqns := `union`(eqns, {S1 = S2}) end do end do end do; sols := [solve(eqns)]; t := nops(sols); for i to t do for j to n do for k to n do BChange[j, k] := subs(sols[i], C[j, k]) end do end do; if simplify(linalg:-det(BChange)) <> 0 then print(BChange); print("The det is", simplify(linalg:-det(BChange))); ISM := 1 end if end do; if ISM = 0 then print("These two algebras are not isomorphic") end if end proc;
proc(A, B, n) ... end;
>
> A16 := array(sparse, 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]);
> A17 := array(sparse, 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]);
>
> isom(A16, A17, 5);


Thank you.

Please Wait...