Is this a bug, or am I doing something else wrong.
Yes, I'd say that this is a bug. But maybe from the following transkript
you can see what is happening.
Why have I used SUP? Well, Polynomial is a domain that can hold
polynomials in any variable. In fact, it's not a univariate polynomial
domain. So if you say p rem q, FriCAS has to figure out what you could
have meant. Well, you polynomials are univariate, so (I guess -- I
haven't actually looked at the source code) internally p and q will be
coerced to a univariate polynomial (i.e. to type SUP(gf16). As you see
below, for some reason, I don't yet understand, this goes wrong. Maybe
you should report this failing coercion as a but on the fricas bugtracker.
I have no idea why coercion with FiniteField(2,4) works, but not with
FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1).
Anyway, I'd suggest, that you try to use the most specific type that
works for you operation. If you try to find the most specific type
yourself (i.e. basically do the work of the interpreter), you'll
probably learn a lot how FriCAS works. But, of course, that will cost time.
Ralf
(1) -> gf2 := PrimeField 2
(1) PrimeField(2)
Type: Type
(2) -> gf16 := FiniteFieldExtensionByPolynomial(gf2, x**4 + x + 1)
(2) FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
Type: Type
(3) -> P := SUP gf16
(3)
SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4
+?+1))
Type: Type
(4) -> a:gf16 := primitiveElement()
(4) %A
Type:
FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
(5) -> p:P := a*x^3
>> Error detected within library code:
coerce: element doesn't belong to smaller field
(5) -> m:P := monomial(1,1)
(5) ?
Type:
SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
(6) -> p:P := a*m^3
3
(6) %A ?
Type:
SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
(7) -> q:P := a*x^2+1
>> Error detected within library code:
coerce: element doesn't belong to smaller field
(8) -> a := primitiveElement()$gf16
(8) %A
Type:
FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
(7) -> q:P := a*m^2+1
2
(7) %A ? + 1
Type:
SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
(8) -> p rem q
(8) ?
Type:
SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
(9) ->
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.