How to factorize a polynomial in a Skew Polynomial Ring
I am trying this code, but it is not giving any output. However, the same code provides the factorization if I take the polynomial x^n+1, where n is an odd number.
k.<t>= GF(2^2)
sigma = k.frobenius_endomorphism()
S.<x>= k['x', sigma]
a=x^4+1;
count = a.count_factorizations()
print(f"Number of factorizations: {count}")
factorizations = a.factorizations()
print("Factorizations of the polynomial:")
for factorization in factorizations:
print(factorization)
What version of Sage are you using? Also, your post is contradictory: you say that it gives output for
x^n+1
whenn
is an odd number, but your example hasx^3+1
and you say that there is no output. Can you clarify?FWIW, on Sage 10.6.beta3 :
The first use of
F
works :but a second use fails :
"Spent generator" ?
Regenerate it :
First use in a loop :
Works.
Second call fails...
It seems that the
_cython_3_0_11.generator object
is a one-shot : first call works, then it is "spent" and won't generate anymore.WTF ?
Obvious workaround :
Second call works...
I apologize for the mistake. This code does not give any factors over F4 for x^n+1 when n is even. I am using Sage Version 10.4.