This page demonstrates some features of FriCAS. Let's begin with the construction of a polynomial ring fricas (1) -> F := PrimeField 3
Type: Type
fricas P := UnivariatePolynomial(x,
Type: Type
fricas S := SquareMatrix(2,
Type: Type
fricas R := UnivariatePolynomial(z,
Type: Type
OK, now we have the type fricas s1:S := matrix[[2*x +1 ,
fricas s2 := transpose s1
And now we build the polynomial. fricas r: R := z^2 + s1*z + s2
Of course, since we work in characteristic 3, the following sum must be zero. fricas r+ 2*r
Note that this is not the integer 0, but it is still a polynomial of type Asking for the degree of fricas degree r
Type: PositiveInteger?
Let us add 1 to fricas r+1
Oh, interesting, FriCAS figured out that by 1 we actually meant the polynomial 1 in fricas one: R := 1
No no, it is not the unit square matrix. It is the unit square matrix multiplied
by So let's see what happens if we multiply fricas r2 := r*r
Well, of course there is a common factor of fricas gcd(r2, Ooops. What does that say?: Cannot find a definition or applicable library operation named gcd. Ah, of course, the coefficient ring of Of course, FriCAS can compute a gcd of univariate polynomials. fricas p1:=s1(1,
fricas p2:=s1(1,
fricas gcd(p1,
OK, let us do that again. fricas q1: UP(x,
Type: UnivariatePolynomial(x,
fricas q2: UP(x,
Type: UnivariatePolynomial(x,
fricas gcd(q1,
Type: UnivariatePolynomial(x,
Nice! Depending on where I compute these polynomials either have a common factor or are coprime. Well, all depends on the underlying ring, of course. |