>

First we compute the "norm form", or the norm of a general element in the field Q(sqrt(2),sqrt(3)),relative

to the basis 1, sqrt(2), sqrt(3), sqrt(6). First the matrices representing sqrt(2), sqrt(3), 1, and sqrt(6)

> a:=matrix(4,4,[[0,1,0,0],[2,0,0,0],[0,0,0,1],[0,0,2,0]]);

a := matrix([[0, 1, 0, 0], [2, 0, 0, 0], [0, 0, 0, ...

> b:=matrix(4,4,[[0,0,1,0],[0,0,0,1],[3,0,0,0],[0,3,0,0]]);

b := matrix([[0, 0, 1, 0], [0, 0, 0, 1], [3, 0, 0, ...

> e:=matrix(4,4,[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);

e := matrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, ...

> z:=multiply(a,b);

z := multiply(a,b)

Need to load the linear algebra package.

> with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> z:=multiply(a,b);

z := matrix([[0, 0, 0, 1], [0, 0, 2, 0], [0, 3, 0, ...

Now the matrix of a generic element in terms of the basis

> evalm(x1*e+x2*a+x3*b+x4*z);

matrix([[x1, x2, x3, x4], [2*x2, x1, 2*x4, x3], [3*...

Norm of an element is the determinant of the representing matrix (by definition):

> det(%);

x1^4-4*x1^2*x2^2-12*x4^2*x1^2+48*x1*x4*x3*x2-6*x3^2...
x1^4-4*x1^2*x2^2-12*x4^2*x1^2+48*x1*x4*x3*x2-6*x3^2...

Note that the trace of the generic element is 4x1.

>