>
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]]);
> b:=matrix(4,4,[[0,0,1,0],[0,0,0,1],[3,0,0,0],[0,3,0,0]]);
> e:=matrix(4,4,[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);
> 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);
Now the matrix of a generic element in terms of the basis
> evalm(x1*e+x2*a+x3*b+x4*z);
Norm of an element is the determinant of the representing matrix (by definition):
> det(%);
Note that the trace of the generic element is 4x1.
>