#5409: [with patch; positive review, needs work] rewrite quaternion algebras --
the current implementation isn't sufficiently good
-------------------------+--------------------------------------------------
Reporter: was | Owner: tbd
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.4.1
Component: algebra | Keywords:
-------------------------+--------------------------------------------------
Comment(by mabshoff):
Besides the known pickle issue John's patch breaks two more doctests:
{{{
sage -t -long devel/sage/sage/structure/sage_object.pyx # 1 doctests
failed
sage -t -long devel/sage/sage/algebras/quaternion_algebra.py # 8 doctests
failed
sage -t -long devel/sage/sage/algebras/quaternion_algebra_element.pyx # 1
doctests failed
}}}
In detail:
{{{
sage -t -long "devel/sage/sage/algebras/quaternion_algebra_element.pyx"
**********************************************************************
File
"/scratch/mabshoff/sage-3.4.rc2/devel/sage/sage/algebras/quaternion_algebra_element.pyx",
line 322:
sage: 1/Q(0)
Exception raised:
Traceback (most recent call last):
File "/scratch/mabshoff/sage-3.4.rc2/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/scratch/mabshoff/sage-3.4.rc2/local/bin/sagedoctest.py", line
38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/scratch/mabshoff/sage-3.4.rc2/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_11[6]>", line 1, in <module>
Integer(1)/Q(Integer(0))###line 322:
sage: 1/Q(0)
File "element.pyx", line 1238, in
sage.structure.element.RingElement.__div__ (sage/structure/element.c:9116)
File "coerce.pyx", line 712, in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:5438)
File "element.pyx", line 1236, in
sage.structure.element.RingElement.__div__ (sage/structure/element.c:9099)
File "quaternion_algebra_element.pyx", line 362, in
sage.algebras.quaternion_algebra_element.QuaternionAlgebraElement_abstract._div_
(sage/algebras/quaternion_algebra_element.cpp:5726)
File "quaternion_algebra_element.pyx", line 346, in
sage.algebras.quaternion_algebra_element.QuaternionAlgebraElement_abstract.__invert__
(sage/algebras/quaternion_algebra_element.cpp:5660)
File "rational.pyx", line 1445, in
sage.rings.rational.Rational.__invert__ (sage/rings/rational.c:10565)
ZeroDivisionError: rational division by zero
**********************************************************************
}}}
and
{{{
sage -t -long "devel/sage/sage/algebras/quaternion_algebra.py"
**********************************************************************
File
"/scratch/mabshoff/sage-3.4.rc2/devel/sage/sage/algebras/quaternion_algebra.py",
line 89:
sage: QuaternionAlgebra(0,0)
Exception raised:
Traceback (most recent call last):
File "/scratch/mabshoff/sage-3.4.rc2/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/scratch/mabshoff/sage-3.4.rc2/local/bin/sagedoctest.py", line
38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/scratch/mabshoff/sage-3.4.rc2/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_1[7]>", line 1, in <module>
QuaternionAlgebra(Integer(0),Integer(0))###line 89:
sage: QuaternionAlgebra(0,0)
File "/scratch/mabshoff/sage-3.4.rc2/local/lib/python2.5/site-
packages/sage/algebras/quaternion_algebra.py", line 175, in
QuaternionAlgebra
raise ValueError, "a and b must be nonzero"
ValueError: a and b must be nonzero
**********************************************************************
<SNIP>
}}}
Cheers,
Michael
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5409#comment:13>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---