Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced polred with polredbest in Numfield.optimized_subfields #39205

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -8614,12 +8614,12 @@
sage: x = polygen(QQ, 'x')
sage: K = NumberField([x^2 + p for p in [5, 3, 2]],'a').absolute_field('b'); K
Number Field in b with defining polynomial x^8 + 40*x^6 + 352*x^4 + 960*x^2 + 576
sage: L = K.optimized_subfields(name='b')

Check failure on line 8617 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[2]>", line 1, in <module> L = K.optimized_subfields(name='b') File "/sage/src/sage/rings/number_field/number_field.py", line 8699, in optimized_subfields return self._subfields_helper(degree=degree, name=name, File "/sage/src/sage/rings/number_field/number_field.py", line 8855, in _subfields_helper v = f.polredbest(2) File "cypari2/auto_gen.pxi", line 27808, in cypari2.gen.Gen_base.polredbest File "cypari2/handle_error.pyx", line 211, in cypari2.handle_error._pari_err_handle raise PariError(errnum, pari_error_string, clone_gen_noclear(E)) cypari2.handle_error.PariError: invalid flag in polredbest
sage: L[0][0]

Check failure on line 8618 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[3]>", line 1, in <module> L[Integer(0)][Integer(0)] NameError: name 'L' is not defined
Number Field in b0 with defining polynomial x
sage: L[1][0]

Check failure on line 8620 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[4]>", line 1, in <module> L[Integer(1)][Integer(0)] NameError: name 'L' is not defined
Number Field in b1 with defining polynomial x^2 - 3*x + 3
sage: [z[0] for z in L] # random -- since algorithm is random

Check failure on line 8622 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[5]>", line 1, in <module> [z[Integer(0)] for z in L] # random -- since algorithm is random NameError: name 'L' is not defined
[Number Field in b0 with defining polynomial x - 1,
Number Field in b1 with defining polynomial x^2 - x + 1,
Number Field in b2 with defining polynomial x^4 - 5*x^2 + 25,
Expand All @@ -8628,10 +8628,10 @@

We examine one of the optimized subfields in more detail::

sage: M, from_M, to_M = L[2]

Check failure on line 8631 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[6]>", line 1, in <module> M, from_M, to_M = L[Integer(2)] NameError: name 'L' is not defined
sage: M # random

Check failure on line 8632 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[7]>", line 1, in <module> M # random NameError: name 'M' is not defined
Number Field in b2 with defining polynomial x^4 - 5*x^2 + 25
sage: from_M # may be slightly random

Check failure on line 8634 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[8]>", line 1, in <module> from_M # may be slightly random NameError: name 'from_M' is not defined
Ring morphism:
From: Number Field in b2 with defining polynomial x^4 - 5*x^2 + 25
To: Number Field in a1 with defining polynomial
Expand All @@ -8641,18 +8641,18 @@

The ``to_M`` map is ``None``, since there is no map from `K` to `M`::

sage: to_M

Check failure on line 8644 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[9]>", line 1, in <module> to_M NameError: name 'to_M' is not defined

We apply the from_M map to the generator of M, which gives a
rather large element of `K`::

sage: from_M(M.0) # random

Check failure on line 8649 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[10]>", line 1, in <module> from_M(M.gen(0)) # random NameError: name 'from_M' is not defined
-5/1152*a1^7 + 1/96*a1^6 - 97/576*a1^5 + 17/48*a1^4
- 95/72*a1^3 + 17/12*a1^2 - 53/24*a1 - 1

Nevertheless, that large-ish element lies in a degree 4 subfield::

sage: from_M(M.0).minpoly() # random

Check failure on line 8655 in src/sage/rings/number_field/number_field.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 716, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.number_field.number_field.NumberField_absolute.optimized_subfields[11]>", line 1, in <module> from_M(M.gen(0)).minpoly() # random NameError: name 'from_M' is not defined
x^4 - 5*x^2 + 25

TESTS:
Expand Down Expand Up @@ -8852,7 +8852,7 @@
pass
f = self.pari_polynomial()
if optimize:
v = f.polred(2)
v = f.polredbest(2)
elts = v[0]
polys = v[1]
else:
Expand Down
Loading