Hi everyone
I am trying to create a polynomial from a list of its coefficients. In the past, I have done so when the coefficients are all integers (or they belong to a fixed number field). Typically, that would require me to declare the coefficient field at the beginning. The syntax would look like this
R.<x> = PolynomialRing(QQ)
def test(p):
v = srange(1,p)
v.reverse()
F = R(v)
return F
After that, I can create $F$ and do some calculations such as factoring $F$ over $\mathbb{Q}$.
My new problem is that I want to create a polynomial with coefficients in (varying) cyclotomic field. I tried the following code but it did not work (it will work if I use the coefficient field as $\overline{\mathbb{Q}}$. However, I won't be able to do factorization over the relevant cyclotomic field).
def test_2(p):
K1.<x> = CyclotomicField(p**2)
v = [E(p)**s for s in srange(0,p)]
v.reverse()
F = K1(v)
return F
I appreciate any advice and suggestions.
Thank you for your help.
Best wishes, Tung