#6204: [with patch, needs work] make norms for degree 1 relative number fields
work; add doctests
---------------------------+------------------------------------------------
Reporter: ncalexan | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.0.2
Component: number theory | Keywords: degree 1 relative number field norm
Reviewer: | Author:
Merged: |
---------------------------+------------------------------------------------
Comment(by davidloeffler):
Hold it, this fails doctests under 4.0.1:
{{{
da...@groke:~/sage-4.0.1.rc2/devel/sage-nfstuff/sage/rings/number_field>
sage -t number_field_ideal_rel.py
sage -t "devel/sage-
nfstuff/sage/rings/number_field/number_field_ideal_rel.py"
**********************************************************************
File "/home/david/sage-4.0.1.rc2/devel/sage-
nfstuff/sage/rings/number_field/number_field_ideal_rel.py", line 361:
sage: L.ideal(b).relative_norm()
Exception raised:
Traceback (most recent call last):
File "/home/david/sage-4.0/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/david/sage-4.0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/david/sage-4.0/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_11[19]>", line 1, in <module>
L.ideal(b).relative_norm()###line 361:
sage: L.ideal(b).relative_norm()
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field_ideal_rel.py", line 370, in
relative_norm
return K.ideal(map(K, self.gens()))
File "parent.pyx", line 323, in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:4130)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3058)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:2949)
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field.py", line 941, in
_element_constructor_
return self._coerce_from_other_number_field(x)
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field.py", line 4317, in
_coerce_from_other_number_field
raise TypeError, "Cannot coerce element into this number field"
TypeError: Cannot coerce element into this number field
**********************************************************************
File "/home/david/sage-4.0.1.rc2/devel/sage-
nfstuff/sage/rings/number_field/number_field_ideal_rel.py", line 480:
sage: L.ideal(b).ideal_below()
Exception raised:
Traceback (most recent call last):
File "/home/david/sage-4.0/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/david/sage-4.0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/david/sage-4.0/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_13[50]>", line 1, in <module>
L.ideal(b).ideal_below()###line 480:
sage: L.ideal(b).ideal_below()
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field_ideal_rel.py", line 489, in
ideal_below
return K.ideal(map(K, self.gens()))
File "parent.pyx", line 323, in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:4130)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3058)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:2949)
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field.py", line 941, in
_element_constructor_
return self._coerce_from_other_number_field(x)
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field.py", line 4317, in
_coerce_from_other_number_field
raise TypeError, "Cannot coerce element into this number field"
TypeError: Cannot coerce element into this number field
**********************************************************************
File "/home/david/sage-4.0.1.rc2/devel/sage-
nfstuff/sage/rings/number_field/number_field_ideal_rel.py", line 482:
sage: L.ideal(b^2 + 2).ideal_below()
Exception raised:
Traceback (most recent call last):
File "/home/david/sage-4.0/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/david/sage-4.0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/david/sage-4.0/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_13[51]>", line 1, in <module>
L.ideal(b**Integer(2) + Integer(2)).ideal_below()###line 482:
sage: L.ideal(b^2 + 2).ideal_below()
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field_ideal_rel.py", line 489, in
ideal_below
return K.ideal(map(K, self.gens()))
File "parent.pyx", line 323, in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:4130)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3058)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps._call_ (sage/structure/coerce_maps.c:2949)
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field.py", line 941, in
_element_constructor_
return self._coerce_from_other_number_field(x)
File "/home/david/sage-4.0.1.rc2/local/lib/python2.5/site-
packages/sage/rings/number_field/number_field.py", line 4317, in
_coerce_from_other_number_field
raise TypeError, "Cannot coerce element into this number field"
TypeError: Cannot coerce element into this number field
**********************************************************************
2 items had failures:
1 of 21 in __main__.example_11
2 of 52 in __main__.example_13
***Test Failed*** 3 failures.
For whitespace errors, see the file
/home/david/sage-4.0.1.rc2/tmp/.doctest_number_field_ideal_rel.py
[6.2 s]
exit code: 1024
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage-
nfstuff/sage/rings/number_field/number_field_ideal_rel.py"
Total time for all tests: 6.2 seconds
}}}
I'm changing this back to "needs work". The problem seems to be that we
need to work around a pari bug in "gens_reduced" as well as in
"relative_norm".
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6204#comment:3>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---