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.Tue, 17 May 2022 23:10:22 +0200Galois Field tower field representationhttps://ask.sagemath.org/question/62484/galois-field-tower-field-representation/I'm trying to create some galois field (GF4, GF16 and GF256) using a tower field representation, as described here:
GF(4) := GF(2)[a] / (a^2 + a+ 1) <br>
GF(16) := GF(4)[b] / (b^2 + b + a) <br>
GF(256) := GF(16)[c] / (c^2 + c + a*b) <br>
I've tried doing that using field extensions, but i've been bumping in errors and dead ends so far. For example, i tried doing something like this:
GF2.<a> = GF(2)
GF4.<b> = GF(4, modulus=a^2+a+1)
But of course i'm getting this error, since the modulus simply evaluates to 1:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-ca2ad50ca645> in <module>
----> 1 GF4 = GF(Integer(2)**Integer(2), modulus=a**Integer(2)+a+Integer(1), names=('b',)); (b,) = GF4._first_ngens(1)
~/sage/sage-9.6/local/var/lib/sage/venv-python3.8/lib/python3.8/site-packages/sage/structure/factory.pyx in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:2264)()
365 False
366 """
--> 367 key, kwds = self.create_key_and_extra_args(*args, **kwds)
368 version = self.get_version(sage_version)
369 return self.get_object(version, key, kwds)
~/sage/sage-9.6/local/var/lib/sage/venv-python3.8/lib/python3.8/site-packages/sage/rings/finite_rings/finite_field_constructor.py in create_key_and_extra_args(self, order, name, modulus, names, impl, proof, check_irreducible, prefix, repr, elem_cache, **kwds)
651
652 if modulus.degree() != n:
--> 653 raise ValueError("the degree of the modulus does not equal the degree of the field")
654 if check_irreducible and not modulus.is_irreducible():
655 raise ValueError("finite field modulus must be irreducible but it is not")
ValueError: the degree of the modulus does not equal the degree of the field
Do you have any idea on how to achieve this?
torresTue, 17 May 2022 23:10:22 +0200https://ask.sagemath.org/question/62484/Polynomials over number fieldshttps://ask.sagemath.org/question/38381/polynomials-over-number-fields/Below I define a polynomial ring K[s,t]. My goal is to compute the minors of a large matrix with entries in this ring.
var('x')
# K.<t> = NumberField(x^2-2)
K.<s,t> = NumberField([x^2-2,x^2-5])
R.<p0,p1,p2,p3,p4,p5> = K[]
M = Mat(R,10,10).random_element()
mins = M.minors(2)
This code works fine, but if I replace the last line with
mins = M.minors(7)
it fails with the error message
TypeError: no conversion to a Singular ring defined
Is it possible to avoid this error?coreyharrisMon, 24 Jul 2017 18:09:25 +0200https://ask.sagemath.org/question/38381/embeddings in NumberFieldTower?https://ask.sagemath.org/question/25312/embeddings-in-numberfieldtower/I'm trying to do my calculations in a number field tower (or some equivalent), then get the results in real form (or anything that the graphics functions will take). I'm extending the rationals twice.
I've tried constructing the first with NumberField, then using extension, but apparently embedding isn't implemented in extension.
I've tried using NumberFieldTower, but I can't find an equivalent to embedding.
I've tried using NumberField(poly_1, poly_2) or QQ[poly_1, poly_1], but can't figure out how to assign an embedding or something equivalent.
I've considered trying to construct a field homomorphism from the field to the reals, but I don't know sage well enough to figure out if this is possible.
Is there some equivalent way of getting the values that I want?
Thanks!apeirogonSun, 21 Dec 2014 05:37:28 +0100https://ask.sagemath.org/question/25312/