ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 11 Mar 2024 06:19:51 +0100Creating a polynomial with coefficients in a cyclotomic fieldshttps://ask.sagemath.org/question/76418/creating-a-polynomial-with-coefficients-in-a-cyclotomic-fields/ 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, TungtungntMon, 11 Mar 2024 06:19:51 +0100https://ask.sagemath.org/question/76418/Cyclotomic fields - displaying powers of zetahttps://ask.sagemath.org/question/76070/cyclotomic-fields-displaying-powers-of-zeta/Is there any way how to avoid expressing $\zeta^{n-1}$ in terms of lower powers of $\zeta$ when working with cyclotomic fields?
K.<zeta> = CyclotomicField(3)
zeta^5
-zeta - 1
I would like to show $\zeta^2$ in this case.
I know that I can do this instead:
K.<zeta> = QQ[]
zeta^5 % (zeta^3 - 1)
zeta^2
But the problem is that eventually, I want to work with a polynomial ring over K and perform a factorization there, and that is not possible in `QQ[].<x,y>`.kejv2Sun, 18 Feb 2024 20:39:43 +0100https://ask.sagemath.org/question/76070/Specific term order of polynomialshttps://ask.sagemath.org/question/75602/specific-term-order-of-polynomials/I'm studying the Lagrange resolvent method for solving n-degree equations. This is what I have so far:
# a,b,c,d represent the roots of a 4-degree polynomial
R.<a,b,c,d> = QQ[]
# w will be treated as a primitive 4th root of unity
K.<w> = R[]
F = a + b*w + c*w^2 + d*w^3
# Lagrange resolvent
W = F^4 % (w^4 - 1)
# list of coefficients of w^i in W
Ws = [W[i] for i in range(4)]
S4 = SymmetricGroup(R.gens())
# compute the orbit of W under the action of S4
WOrbit = set([tuple([ws(s(R.gens())) for ws in Ws]) for s in S4])
# pretty print the orbit
for indt, t in enumerate(WOrbit):
print(f"Res {indt + 1}:")
for ind, i in enumerate(t):
show(html(f"${latex(w^ind)}$: ${latex(i)}$"))
This works quite nicely except for the term ordering of the coefficients (polynomials in the roots a,b,c,d). For example, for two elements of the orbit, I have the following constant terms:
$1: a^{4} + b^{4} + 12 a^{2} b c + 6 b^{2} c^{2} + c^{4} + 12 a b^{2} d + 12 a c^{2} d + 6 a^{2} d^{2} + 12 b c d^{2} + d^{4}$
$1: a^{4} + 6 a^{2} b^{2} + b^{4} + 12 a b c^{2} + c^{4} + 12 a^{2} c d + 12 b^{2} c d + 12 a b d^{2} + 6 c^{2} d^{2} + d^{4}$
I would like some consistent ordering of the terms. I guess the inconsistency is caused by permuting the variables. Is there any way to adapt the term ordering according to the used permutation?
Also, is it possible to achieve an ordering first by the "degree signature" and then lexicographically? E.g. the first example should be ordered as (I grouped the terms with the same degree signature):
$1: (a^{4} + b^{4} + c^{4} + d^{4}) + (6 a^{2} d^{2} + 6 b^{2} c^{2}) + (12 a^{2} b c + 12 a b^{2} d + 12 a c^{2} d + 12 b c d^{2} )$
Last but not least, since I'm a beginner in Sage I would appreciate any comments on my solution. I'm sure there must be nicer or more efficient solutions for some of my steps.kejv2Sun, 21 Jan 2024 12:01:34 +0100https://ask.sagemath.org/question/75602/Symbolic arithmetic in a number fieldhttps://ask.sagemath.org/question/75522/symbolic-arithmetic-in-a-number-field/How to prevent expanding the value of the generating element in symbolic expressions?
E.<w> = CyclotomicField(3)
w^4 # shows w
(w+1)^2 # shows w
a = var('a')
(w + a)^2 # shows an expression with w expanded as a complex number
How can I make the last expression show up as $w^2 + 2aw + a^2$?
My use case is to expand $(a+bw+cw^2)^3$ so that the result is expressed as a rational (or integer) combination of `1, w, w^2`.kejv2Wed, 17 Jan 2024 22:46:28 +0100https://ask.sagemath.org/question/75522/Cyclotomic Polynomials and Primitive Roots of Unityhttps://ask.sagemath.org/question/74565/cyclotomic-polynomials-and-primitive-roots-of-unity/I want to print the primitive root of unity $\zeta_m$ associated with the $m'th$ cyclotomic polynomial $\phi_m(x)$ where m is a power of two. I want to print the primitive root of this polynomial over $\mathbb{Z}_p$ with $p$ prime.
I tried the following as an example, with $p = 12206081$ and $m = 16384$. However this prints all the totient(16384) roots rather than just the primitive root.
x = PolynomialRing(GF(12206081), 'x').gen()
n = euler_phi(16384)
f = x^n + 1
print(f.roots())RohitTue, 28 Nov 2023 23:10:54 +0100https://ask.sagemath.org/question/74565/Does sympy break CyclotomicField?https://ask.sagemath.org/question/72642/does-sympy-break-cyclotomicfield/ One can define a cyclotomic field as `CyclotomicField(16)` for example. But the code below crashes:
from sympy import *
CyclotomicField(16)
...
File ~/Soft/sage/src/sage/rings/integer.pyx:714, in sage.rings.integer.Integer.__init__()
712 return
713
--> 714 raise TypeError("unable to coerce %s to an integer" % type(x))
715
716 def __reduce__(self):
TypeError: unable to coerce <class 'sympy.core.numbers.Integer'> to an integer
Am I doing something wrong? Is my sage broken? I would like to use sympy and CyclotomicField in the same program. Specs: Sage 9.8, 10.0, Ubuntu 22.04.Alex KareninThu, 17 Aug 2023 13:49:15 +0200https://ask.sagemath.org/question/72642/Determinants over cyclotomic fields are broken?https://ask.sagemath.org/question/64194/determinants-over-cyclotomic-fields-are-broken/ I launch the code below which generates two unimodular matrices L and U until it thinks that norm(det(L*U)) is not in [-1,1] which is probably a bug:
def seek_bug(K,n, rng=[-3,3], density=1.0):
print("Searching")
z=K.gen()
OK = K.fraction_field().ring_of_integers()
units = [z^((1-(i))/2) * (1-z^i)/(1-z) for i in list( range(1,K.degree(),2) ) ] if K.degree()>2 else [1,z]
assert( all([OK(u).is_unit() for u in units]) ), "Wrong units!"
L = Matrix.identity(K,n)
U = Matrix.identity(K,n)
for i in range(n):
for j in range(n):
if i<j:
if uniform(0,1)<density:
L[i,j]=OK.random_element(rng[0],rng[1])
elif j<i:
if uniform(0,1)<density:
U[n-j-1,n-i-1]=OK.random_element(rng[0],rng[1])
else:
U[i,i]*=prod([ units[randrange(len(units))] for i in range(6) ])
L[i,j]*=prod([ units[randrange(len(units))] for i in range(6) ])
B = L*U
if not( norm(det(B)) in [-1,1] ):
return L, U, B
return None, None, None
n=2
K.<z> = CyclotomicField(16)
L, U, B = None, None, None
while L is None:
L, U, B = seek_bug(K,n)
print(norm(det(L)), norm(det(U)))
assert det(L)*det(U) == det(L*U), "This should work... But it doesn't"
The last assertion fails which implies det(L)*det(U) != det(L*U) (Note: even without taking the norm!), but this should not be the thing. It fails in power-of-two cyclotomics. Did I make a mistake, or are the determinants in sage are broken?
Checked this on 3 machines with sage 9.4, 9.5 and 9.6: it fails everywhere.Alex KareninTue, 27 Sep 2022 09:36:54 +0200https://ask.sagemath.org/question/64194/Factoring an integer inside a ring of integers different from $\mathbb{Z}$https://ask.sagemath.org/question/61241/factoring-an-integer-inside-a-ring-of-integers-different-from-mathbbz/ I am trying to find divisors of an element in the ring of integers of a Cyclotomic Field. My code is
K=CyclotomicField(23)
L=K.ring_of_integers()
L.factor(2)
It gives an error:
'AbsoluteOrder_with_category' object has no attribute 'factor'
I guess the problem is L is defined as an "order" here instead of a ring. But I need that to be a ring. How can I fix this problem?nomaddd4Sun, 20 Feb 2022 17:53:24 +0100https://ask.sagemath.org/question/61241/Challenges with subgroup elementshttps://ask.sagemath.org/question/60945/challenges-with-subgroup-elements/I'm running into apparent inconsistencies when studying subgroups of the unit group of a cyclotomic field.
k = CyclotomicField(7,'z')
U = k.unit_group()
z = k.gen()
a = 1+z
b = a^(-1)
T = U.subgroup([U(a)])
print(U(a) in U)
print(U(b) in U)
print(U(a) in T)
print(U(b) in T)
What I'm getting is:
True
True
True
False
which doesn't make sense. $T$ is a subgroup, so if it contains $a$ it must also contain $a^{-1}$. The group $U$ gets it right, but the subgroup $T$ does not. I'm guessing this is some coercion issue, but I'm not sure why it's happening, if it's a bug, and how to work around it.
(Checked this on the Sage Cell Server and CoCalc with Sage 9.4)AlonAmitSat, 05 Feb 2022 01:11:27 +0100https://ask.sagemath.org/question/60945/Subgroup of unit grouphttps://ask.sagemath.org/question/60913/subgroup-of-unit-group/ k = CyclotomicField(5)
U = k.unit_group()
v = U.gens()
u = U.gens_values()
T1 = U.subgroup([v[0]])
T2 = U.subgroup([u[0]])
This code attempts to generate a subgroup of the unit group of $\mathbb{Q}(\zeta_{5})$. The subgroup call for T1 works fine. The one for T2 breaks. This is close to bug #18863 that was already fixed, but this version of the problem persists.
The elements of u are recognized as elements of the group U. Still, Sage is unable to compute the subgroup generated by those elements. For my use case, it's important to manipulate the elements of u as elements in the field (including addition), which I don't think I can do with the elements of v.
AlonAmitWed, 02 Feb 2022 23:32:08 +0100https://ask.sagemath.org/question/60913/support() and coefficients() in combinatorial free moduleshttps://ask.sagemath.org/question/58724/support-and-coefficients-in-combinatorial-free-modules/I was surprised that in the code below I could not count on the lists returned by support() and coefficients() to correspond. Is there a proper way to use these methods in conjunction with each other, or should I adopt a different approach? If I sort the list returned by support() will I be able to count on the coefficients corresponding with generators?
k3.<w3> = CyclotomicField(3)
F3 = CombinatorialFreeModule(k3,NN,prefix='v3')
v3 = F3.basis()
v3
> Lazy family (Term map from Non negative integer semiring to Free module generated by Non negative integer semiring over Cyclotomic Field of order 3 and degree 2(i))_{i in Non negative integer semiring}
expr = -2*v3[34] - (-2*w3)*v3[42] - 2*v3[58] - (2*w3+2)*v3[66]
[expr.support(),expr.coefficients()]
> [[34, 42, 66, 58], [-2, 2*w3, -2, -2*w3 - 2]]
Perhaps I should ask my real question, while I'm here. I have a list of module elements (actually vectors) and would like to find the kernel of the matrix with these vectors as rows. The matrix is likely to be sparse. I encountered the issue described above while trying to set up the matrix by hand from the list of vectors.
**Added:** The suggestion of John Palmieri in a comment and of tmonteil in an answer to use expr.monomial_coefficients() solves my problem, but I think it still worth trying to pin down the answer to the original question.
The documentation for support() says
> Return a list of the objects indexing the basis of "self.parent()"
whose corresponding coefficients of "self" are non-zero.
>
> This method returns these objects in an arbitrary order.
The documentation for coefficients() says
> Return a list of the (non-zero) coefficients appearing on the basis elements in "self" (in an arbitrary order).
>
> INPUT:
>
> * "sort" -- (default: "True") to sort the coefficients based upon the default ordering of the indexing set
Both mention that elements are returned "in an arbitrary order". Since it is not specified that the arbitrary order returned by the two functions is the same, one must assume the orders could be different. I wonder, however, whether they are intended to be the same since it is difficult to imagine many uses for a function that returns coefficients without making it possible to determine what they are coefficients of.
The other striking thing is that coefficients() actually doesn't default to the behavior described in the first line of the documentation: it defaults to "sort=True" which causes the coefficients to be returned in an order corresponding to the sorted order of the elements of the support, and not an arbitrary order. Since support() has no "sort" option, the only option is the "arbitrary" order. I strongly suspect that if one turns off the default option in coefficients() by setting "sort=False", one will get an arbitrary order that corresponds to that of support(), but, if true, it would be nice to have that documented somewhere.Will OrrickSun, 29 Aug 2021 05:02:37 +0200https://ask.sagemath.org/question/58724/Computing the ideal below in a cyclotomic fieldhttps://ask.sagemath.org/question/57601/computing-the-ideal-below-in-a-cyclotomic-field/ I have a cyclotomic field L, and I define K as a decomposition field for an ideal (non prime) I of OL. ( I made the decomposition field function ). I know that K is a subfield of L, but it just considers it as an extension of Q. I would like to calculate the intersection of I and OK or of I and K, which is supposed to be the ideal below I in K. I've tried the "intersection" function, but it doesn't work because they don't consider OK as an L-ideal. I've also tried the ideal_below function, but it tells me that a NumberFieldFractionalIdeal does not have the method.
Thank you for your help.rerouilleThu, 17 Jun 2021 10:51:01 +0200https://ask.sagemath.org/question/57601/Factoring a cyclotomic polynomial mod phttps://ask.sagemath.org/question/57099/factoring-a-cyclotomic-polynomial-mod-p/ How can I factor a cyclotomic polynomial into polynomials that are irreducible modulo p?
dtoprakhisarThu, 13 May 2021 10:18:22 +0200https://ask.sagemath.org/question/57099/tensor_product of matrices over cyclotomic fieldhttps://ask.sagemath.org/question/54762/tensor_product-of-matrices-over-cyclotomic-field/Beginner question: I have created some matrices over a cyclotomic field and attempted to compute some of their tensor products:
N = 3
k.<w> = CyclotomicField(N)
Z = diagonal_matrix(k,N,[w^j for j in range(0,N)])
X = matrix(k,N,N,[1 if (i%N - floor(i/N)) % N == N-1 else 0 for i in range(0,N*N)])
I = identity_matrix(k,N)
I.tensor_product(X)
X.tensor_product(I)
Z.tensor_product(I)
Z.tensor_product(X)
#I.tensor_product(Z)
#X.tensor_product(Z)
If I uncomment either of the last two lines I get
> AttributeError: 'sage.matrix.matrix_generic_sparse.Matrix_generic_sparse' object has no attribute '_rational_matrix'
It seems my code is working when both matrices in the tensor product are rational or when self is non-rational, but not when self is rational and the argument is non-rational. Should I be somehow instructing sagemath to regard self as a matrix over the cyclotomic field?Will OrrickSat, 19 Dec 2020 20:38:38 +0100https://ask.sagemath.org/question/54762/How to Compute $\operatorname{Pic}(\mathbb{Z}[\zeta_p,1/p])$https://ask.sagemath.org/question/50467/how-to-compute-operatornamepicmathbbzzeta_p1p/Consider the extension $\mathbb{Q}(\zeta_p)/\mathbb{Q}$, where $\zeta_p$ is a primitive $p^{\text{th}}$ root of unity (and $p$ is a prime number). Form the ring of integers $\mathbb{Z}[\zeta_p]$. Now, invert the prime $p$, to obtain the ring $R=\mathbb{Z}[\zeta_p,1/p]$. I want to compute $\operatorname{Pic}(R)$.
Is this possible to do using sagemath? If so, how? How do I construct the ring $R$ using sagemath?JoelThu, 02 Apr 2020 17:08:04 +0200https://ask.sagemath.org/question/50467/Problem with UniversalCyclotomicField?https://ask.sagemath.org/question/50145/problem-with-universalcyclotomicfield/Consider `L=[[0, 1, 0], [1, 0, 1], [0, 1, 1]]` and `M=matrix(CyclotomicField(7),L)`, then:
sage: M.eigenvalues()
[-zeta7^4 - zeta7^3, zeta7^5 + zeta7^4 + zeta7^3 + zeta7^2 + 1, -zeta7^5 - zeta7^2]
Now by taking `N=matrix(UniversalCyclotomicField(),L)` I **expected** the following:
sage: N.eigenvalues()
[-E(7)^4 - E(7)^3, E(7)^5 + E(7)^4 + E(7)^3 + E(7)^2 + 1, -E(7)^5 - E(7)^2]
but I got the following error message:
sage: N.eigenvalues()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-49-ae504b86ebb7> in <module>()
----> 1 T.eigenvalues()
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/matrix/matrix2.pyx in sage.matrix.matrix2.Matrix.eigenvalues (build/cythonized/sage/matrix/matrix2.c:44161)()
6000
6001 res = []
-> 6002 for f, e in self.charpoly().change_ring(K).factor():
6003 if f.degree() == 1:
6004 res.extend([-f.constant_coefficient()]*e)
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/rings/polynomial/polynomial_element.pyx in sage.rings.polynomial.polynomial_element.Polynomial.factor (build/cythonized/sage/rings/polynomial/polynomial_element.c:35771)()
4331 R = self._parent.base_ring()
4332 if hasattr(R, '_factor_univariate_polynomial'):
-> 4333 return R._factor_univariate_polynomial(self, **kwargs)
4334
4335 G = None
/opt/sagemath-9.0/local/lib/python3.7/site-packages/sage/rings/universal_cyclotomic_field.py in _factor_univariate_polynomial(self, f)
1682 m = p.is_cyclotomic(certificate=True)
1683 if not m:
-> 1684 raise NotImplementedError('no known factorization for this polynomial')
1685 for i in range(1, m):
1686 if gcd(m, i) == 1:
NotImplementedError: no known factorization for this polynomial
Sébastien PalcouxTue, 03 Mar 2020 12:17:15 +0100https://ask.sagemath.org/question/50145/Killed Process Meaning?https://ask.sagemath.org/question/42708/killed-process-meaning/ I tried computing this -
sage : K = CyclotomicField(37^5)
But after almost a minute, the process just popped up "Killed" and automatically exited sage session.
Why does that happen and what is the meaning?
Is there any alternative way to do this? mathjainThu, 21 Jun 2018 15:54:57 +0200https://ask.sagemath.org/question/42708/how to find minimal polynomialhttps://ask.sagemath.org/question/34412/how-to-find-minimal-polynomial/How to find the minimal polynomial of an element ? Let $\zeta_n$ be a primitive $n$-th root of unity. I want to find the minimal polynomial of $\zeta_n$ over $\mathbb{Q}(\zeta_n+\zeta_{n}^{-1})$. How do I do that ?nebuckandazzerWed, 10 Aug 2016 19:45:47 +0200https://ask.sagemath.org/question/34412/Evaluating discriminant of a polynomial in Z_n[x]/<x^r-1>https://ask.sagemath.org/question/33879/evaluating-discriminant-of-a-polynomial-in-z_nxxr-1/Consider the following code
Zn=Zmod(n)
R = PolynomialRing(Zn,'x')
F = R.quotient((x**r)-1)
y=F((x+1))
f=F(y**n)
Clearly **f** will be a polynomial in xbar , I want to consider this polynomial as a polynomial in $ \mathbb{Z}[x] $ and evaluate its discriminant.
I tried **"f.polynomial()"** but it is not working. Any suggestions ? vishbWed, 22 Jun 2016 08:10:18 +0200https://ask.sagemath.org/question/33879/Taking gcd with respect to one variablehttps://ask.sagemath.org/question/33734/taking-gcd-with-respect-to-one-variable/ I want to compute $$ gcd_{X}((X-y)^2 -a , X^{\frac{q-1}{2}}-1)$$ with respect to X(taking y as a field constant).
I can't see any direct implementation of this in sage. Can any one suggest how to implement it.
Here Arithmetic is over $GF(p)$ and y is root of cyclotomic polynomial of degree r over $GF(p)$ and $q = p^r$vishbFri, 10 Jun 2016 14:17:30 +0200https://ask.sagemath.org/question/33734/How make Kummer extensionshttps://ask.sagemath.org/question/33553/how-make-kummer-extensions/ I want to calculate the relative discriminant of field extensions of this kind:
$$\mathbb{Q}(\zeta_5)(\sqrt[5]{a})$$
Where $a \in \mathbb{Q}(\zeta_5)$. So I use SAGE and make this calculations:
K.<b>=CyclotomicField(5); //my field base
alpha=1+3*b^2; //an element of my field base
f=(1+3*b^2).minpoly(); //its minimal polynomial
f.is_irreducible() //is it irreducible?
R.<a>=K.extension(f) //the field extension of my field base
R.relative_discriminant() //the calculation of the relative discriminant
But when I execute it, appears this error
defining polynomial (x^4 - x^3 + 6*x^2 + 14*x + 61) must be irreducible
But it is irreducible, what am I doing wrong? Or how can I solve this?belvedereThu, 26 May 2016 15:10:12 +0200https://ask.sagemath.org/question/33553/variable assumptionhttps://ask.sagemath.org/question/33126/variable-assumption/I have an expression in term of an independent variable $q$. Now, I would like to assume that $q$ is an arbitrary $14$-th root of unity (i.e. $q^{14}=1$).
It is not allow to evaluate in any primitive root of unity, say $\eta$, since the coefficients of my expression are in the $7$-th cyclotomic field (i.e. the field is generated by $\xi=e^{2\pi i/7}$), so $\eta$ is in the field.
I also tried with "assume(q^14==1)", but it didn't work.
How can I do?
**Added after Bruno's comment**: Here is an example. I have the expression
exp=q^16*xi^5 + (q^325-12*q^235)*xi^2.
where q is an independent variable and xi is the 7th-root of unity with least argument. In other words, I have an expression in terms of an independent variable q with coefficients in the 7-th cyclotomic field
K.<xi> = CyclotomicField(7)
Now, I want to assume that $q^{14}=1$, thus the resultant expression should be
q^2*xi^5 + (q^3-12*q^11)*xi^2
since $16\equiv 2\pmod {14}$, $325 \equiv 3\pmod {14}$ and $235\equiv 11\pmod {14}$.
How can I do that? Note that it is not sufficient to evaluate the expression in $q=$some primitive $14$-th root of unity, since $q$ can be $+1$ or $-1$.
Please, think that the expression have thousands of terms, so I cannot do it by hand as above.
emiliocbaSat, 16 Apr 2016 01:49:39 +0200https://ask.sagemath.org/question/33126/is the class field a kind of field(group,ring,feild)?https://ask.sagemath.org/question/8068/is-the-class-field-a-kind-of-fieldgroupringfeild/is the class field a kind of field(group,ring,feild)?
if it is,finite field or unfinite field?cjshThu, 26 Dec 2013 00:01:36 +0100https://ask.sagemath.org/question/8068/how to run CyclotomicField([zeta7+zeta7^-1]?https://ask.sagemath.org/question/10813/how-to-run-cyclotomicfieldzeta7zeta7-1/ - LL.<x>=CyclotomicField(7);LL
Cyclotomic Field of order 7 and
degree 6
x.conjugate()
-x^5 - x^4 - x^3 - x^2 - x - 1
LL.<c>=CyclotomicField(-x^5 - x^4 - x^3 - x^2 - 1);LL
Traceback (click to the left of this block for traceback)
...
TypeError: Unable to
coerce -x^5 - x^4 - x^3 - x^2 - 1 to
an integer
s=LL.gen() + (LL.gen()).conjugate();s
LL.<y>=CyclotomicField(s);LL
Traceback (click to the left of this
block for traceback) ... TypeError:
Unable to coerce -x^5 - x^4 - x^3 -
x^2 - 1 to an integer
KK.<s> = NumberField(-x^5 - x^4 - x^3 - x^2 - 1); KK
Traceback (click to the left of this block for traceback)
... NotImplementedError: number
fields for non-monic polynomials not
yet implemented.
KKK.<s> = NumberField(x^5 + x^4 + x^3 + x^2 + 1); KKK
Number Field in s with defining polynomial x^5 + x^4 +
x^3 + x^2 + 1
KKK is same with Q[zeta7+zeta7^-1]?cjshSat, 07 Dec 2013 02:34:12 +0100https://ask.sagemath.org/question/10813/