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.Sun, 07 Apr 2019 22:40:40 +0200parametric solution for a system of polynomial equationshttps://ask.sagemath.org/question/46043/parametric-solution-for-a-system-of-polynomial-equations/I have the following system of equations,
1+x+y+z==0, 1+xy+yz+xz==0
which I want to solve in the extension field of GF(2) for example. There is a parametric solution of these equations in terms of the parameter s as x=1+s, y=1+$\omega$ s, z=1+$\omega^2$s where $s$ is the parameter and $\omega^2+\omega+1=0$. How can I modify the following for Sage to be able to output parametric solutions like this one?
R.<x,y,z> = PolynomialRing(GF(4))
I = R.ideal([1 + x + y + z, 1 + x*y + y*z + x*z])
I.variety()arpitSun, 07 Apr 2019 22:40:40 +0200https://ask.sagemath.org/question/46043/Is K = QQ[polynomial_root] the same as K.<a> = QQ.extension(polynomial)?https://ask.sagemath.org/question/40400/is-k-qqpolynomial_root-the-same-as-ka-qqextensionpolynomial/I have tested it in a few cases and it seems to be the same, however the following piece of code shows they are not equal :
sage: f
x^3 + 2*x + 5
sage: f.roots(QQbar)
[(-1.328268855668609?, 1),
(0.664134427834305? - 1.822971095411114?*I, 1),
(0.664134427834305? + 1.822971095411114?*I, 1)]
sage: alpha = f.roots(QQbar, multiplicities=False)[0]
sage: K = QQ[alpha]
sage: K
Number Field in a with defining polynomial x^3 + 2*x + 5
sage: H.<a> = QQ.extension(f)
sage: H
Number Field in a with defining polynomial x^3 + 2*x + 5
sage: K['x'](f).factor()
(x - a) * (x^2 + a*x + a^2 + 2)
sage: H['x'](f).factor()
(x - a) * (x^2 + a*x + a^2 + 2)
sage: H == K
False
sage: H.gen() == K.gen()
False
sage: type(K)
<class 'sage.rings.number_field.number_field.NumberField_absolute_with_category'>
sage: type(H)
<class 'sage.rings.number_field.number_field.NumberField_absolute_with_category'>
sage: H.categories() == K.categories()
True
Moreover, I would like to suggest adding this special use of brackets ( such as QQ[polynomial_root] ) to the official doc as long as it is missing.Daniel JimenezSun, 31 Dec 2017 17:56:35 +0100https://ask.sagemath.org/question/40400/Finding a $\gamma$ to define a number field like $E=\mathbb{Q}(\zeta_5)(X^5-\gamma)$https://ask.sagemath.org/question/33638/finding-a-gamma-to-define-a-number-field-like-emathbbqzeta_5x5-gamma/ By working with eliptic curves, I found that the extension E defined by:
E.<a> = NumberField(x^20 - 2*x^19 - 2*x^18 + 18*x^17 - 32*x^16 + 88*x^15 + 58*x^14 -
782*x^13 + 1538*x^12 + 1348*x^11 - 466*x^10 - 894*x^9 + 346*x^8 -
114*x^7 - 424*x^6 - 88*x^5 + 214*x^4 + 54*x^3 + 14*x^2 + 4*x + 1)
Is a cyclic Kummer extension of degree $5$ over $\mathbb{Q}(\zeta_5)$, thus by the clasification of Kummer extensions, there exists $\gamma \in \mathbb{Q}(\zeta_5)$ such that $E=\mathbb{Q}(\sqrt[5]{\gamma})$.
So, about all the polynomials $f$ that define $E$ how do I find $\gamma$ such that the polynomial $X^5-\gamma$ also defines $E$?belvedereThu, 02 Jun 2016 09:13:29 +0200https://ask.sagemath.org/question/33638/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/Comparing numbers in an algebraic fieldhttps://ask.sagemath.org/question/24841/comparing-numbers-in-an-algebraic-field/I get a very strange results from comparison of number in an algebraic field, see the example:
version()
X = polygen(ZZ)
f = X^3 - 2*X^2 - 2*X - 2
Qb.<b> = QQ.extension(f, embedding=3)
b.N() # b is positive
0 < b # gives False; why?
0 < 1 # gives True; fine
Qb(0) < Qb(1) # gives False; WTF?
---
sage: version()
'Sage Version 6.1.1, Release Date: 2014-02-04'
sage: X = polygen(ZZ)
sage: f = X^3 - 2*X^2 - 2*X - 2
sage: Qb.<b> = QQ.extension(f, embedding=3)
sage:
sage: b.N() # b is positive
2.91963956583942
sage: 0 < b # gives False; why?
False
sage: 0 < 1 # gives True; fine
True
sage: Qb(0) < Qb(1) # gives False; WTF?
False
sage:
Can I do something to obtain the correct results of comparison, or is using the flawed `.N()` the only option?toheczWed, 12 Nov 2014 20:25:40 +0100https://ask.sagemath.org/question/24841/QQ.extension() with embedding: incorrect modulushttps://ask.sagemath.org/question/11352/qqextension-with-embedding-incorrect-modulus/Minimal Example:
print version() # get the version
ZX.<X>=ZZ[] # polynomials in X
f=X^3-X-1 # minimal polynomial of minimal Pisot
roots=f.complex_roots() # its roots
root_beta=roots[0] # the real root is first
print 'A:', root_beta # verify we got the real root
Qb.<ext_beta> = QQ.extension(f, embedding=root_beta) # make an extension
float_beta = CC(ext_beta) # convert to float
print 'B:', float_beta.abs()
print 'C:', ext_beta.abs() # why B != C ???
print 'D:', roots[1].abs() # it turns out that ext_beta.abs() gives the modulus of another root of f !!!
Output:
Sage Version 6.1.1, Release Date: 2014-02-04
A: 1.32471795724475
B: 1.32471795724475
C: 0.868836961832709
D: 0.868836961832709
The problem is that `ext_beta.abs() != CC(ext_beta).abs()` for `ext_beta` the generator of an algebraic extension, which just doesn't sound right (and arises some problems of course).
I want to work in precise arithmetics, therefore I need to apply `abs()` without conversion to floats. Is there any way how to achieve this?
toheczFri, 11 Apr 2014 07:34:40 +0200https://ask.sagemath.org/question/11352/multiple algebraic extensionhttps://ask.sagemath.org/question/10877/multiple-algebraic-extension/I'm looking for a way to formulate a number field which can express corners of a given regular $n$-gon exactly, but which might be faster than `AA`. I need to be able to check signs of elements of that number field. Here is what I tried:
n = 17
z = QQbar.zeta(n)
ca = z.real()
sa = z.imag()
QQ[ca, sa]
However I get the error message
ValueError: defining polynomial (x^16 - 17/4*x^14 + 119/16*x^12 -
221/32*x^10 + 935/256*x^8 - 561/512*x^6 + 357/2048*x^4 - 51/4096*x^2 +
17/65536) must be irreducible
How can I avoid this?MvGFri, 03 Jan 2014 04:24:00 +0100https://ask.sagemath.org/question/10877/