Using linear algebra operations over a finite field in MuPad

134 Views Asked by At

When I try to use MuPad's linear algebra operations over a finite field, I receive the error 'An arithmetical expression is expected.' How should I go about doing this?

w := Dom::GaloisField(2, 2)(X1)
wbar := Dom::GaloisField(2, 2)(X1 + 1)
H := matrix([[0, 1, 1, 1, w, w], [0, w, 0, wbar, w, wbar], [1, 1, 1, 1, 1, 1]])
linalg::gaussJordan(H)
2

There are 2 best solutions below

0
On BEST ANSWER

MuPad provides a separate function to create a matrix over a finite field. Use:

GF := Dom::GaloisField(2, 2);
w := GF::"variable";
wbar := w + 1;
H := Dom::Matrix(GF)([[0, 1, 1, 1, w, w], [0, w, 0, wbar, w, wbar], [1, 1, 1, 1, 1, 1]]);
linalg::gaussJordan(H);
0
On

I don't know anything about finite fields, but, according to the R2016a documentation for Dom::GaloisField, the combination of input arguments you're using is not supported. You also need to terminate each line with ; or : if you're running these lines in one block. Maybe try:

w := Dom::GaloisField(2, 2, X1^2+X1+1)(X1):
wbar := Dom::GaloisField(2, 2, X1^2+X1+1)(X1 + 1):
H := matrix([[0, 1, 1, 1, w, w], [0, w, 0, wbar, w, wbar], [1, 1, 1, 1, 1, 1]]);

However, you'll get another Error: An arithmetical expression is expected. [normal] when you run linalg::gaussJordan(H). I believe this is because the function does not support matrices with abstract symbolic variables (X1), which makes sense.