Ticket #12861 (closed enhancement: fixed)
maximal_order of quaternion algebras should be more general
| Reported by: | daniels | Owned by: | daniels |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.3 |
| Component: | algebra | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | Aly Deines |
| Authors: | Daniel Smertnig | Merged in: | sage-5.3.beta1 |
| Dependencies: | #12860 | Stopgaps: |
Description (last modified by daniels) (diff)
Currently Sage can only compute maximal orders in quaternion algebras over QQ having prime discriminant.
Algorithms exist to do this for arbitrary discriminants over arbitrary number fields, and should probably be implemented at least over QQ (for general number fields we don't have the necessary basics to deal with pseudo-bases of quaternion orders implemented at the moment).
The attached patch implements the algorithm from J. Voight, "Identifying the matrix ring: algorithms for quaternion algebras and quadratic forms" over QQ. (Needs to be applied after the patch from #12860)
Attachments
Change History
comment:2 Changed 13 months ago by daniels
Second patch is the right one, and applies on sage-5.0.beta13 after #12860. Ignore the first patch (I forgot to check "replace patch").
comment:4 Changed 10 months ago by aly.deines
- Status changed from needs_review to needs_work
Running -t using sage-5.2.rc0, the following errors came up:
Alys-MacBook-Air:sage-5.2.rc0 aly$ ./sage -t devel/sage/sage/algebras/quatalg/
sage -t "devel/sage/sage/algebras/quatalg/__init__.py"
[0.1 s]
sage -t "devel/sage/sage/algebras/quatalg/all.py"
[0.1 s]
sage -t "devel/sage/sage/algebras/quatalg/quaternion_algebra.py"
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 641:
sage: QuaternionAlgebra(-17*9,-3).maximal_order().basis()
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_20[11]>", line 1, in <module>
QuaternionAlgebra(-Integer(17)*Integer(9),-Integer(3)).maximal_order().basis()###line 641:
sage: QuaternionAlgebra(-17*9,-3).maximal_order().basis()
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 739, in maximal_order
f = normalize_basis_at_p(list(e), p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 650:
sage: QuaternionAlgebra(-3,-89).maximal_order(take_shortcuts=False)
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_20[13]>", line 1, in <module>
QuaternionAlgebra(-Integer(3),-Integer(89)).maximal_order(take_shortcuts=False)###line 650:
sage: QuaternionAlgebra(-3,-89).maximal_order(take_shortcuts=False)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 739, in maximal_order
f = normalize_basis_at_p(list(e), p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 652:
sage: QuaternionAlgebra(1,1).maximal_order(take_shortcuts=False) # Matrix ring
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_20[14]>", line 1, in <module>
QuaternionAlgebra(Integer(1),Integer(1)).maximal_order(take_shortcuts=False) # Matrix ring###line 652:
sage: QuaternionAlgebra(1,1).maximal_order(take_shortcuts=False) # Matrix ring
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 739, in maximal_order
f = normalize_basis_at_p(list(e), p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 654:
sage: QuaternionAlgebra(-22,210).maximal_order(take_shortcuts=False)
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_20[15]>", line 1, in <module>
QuaternionAlgebra(-Integer(22),Integer(210)).maximal_order(take_shortcuts=False)###line 654:
sage: QuaternionAlgebra(-22,210).maximal_order(take_shortcuts=False)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 739, in maximal_order
f = normalize_basis_at_p(list(e), p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 2693:
sage: normalize_basis_at_p(e, 2)
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_83[5]>", line 1, in <module>
normalize_basis_at_p(e, Integer(2))###line 2693:
sage: normalize_basis_at_p(e, 2)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 2697:
sage: normalize_basis_at_p(e, 2)
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_83[8]>", line 1, in <module>
normalize_basis_at_p(e, Integer(2))###line 2697:
sage: normalize_basis_at_p(e, 2)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 2701:
sage: normalize_basis_at_p(e, 5)
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_83[11]>", line 1, in <module>
normalize_basis_at_p(e, Integer(5))###line 2701:
sage: normalize_basis_at_p(e, 5)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/devel/sage/sage/algebras/quatalg/quaternion_algebra.py", line 2705:
sage: normalize_basis_at_p(e, 2)
Exception raised:
Traceback (most recent call last):
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_83[14]>", line 1, in <module>
normalize_basis_at_p(e, Integer(2))###line 2705:
sage: normalize_basis_at_p(e, 2)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2744, in normalize_basis_at_p
f = normalize_basis_at_p(e[1:], p)
File "/Users/aly/Desktop/AllSage/sage-5.2.rc0/local/lib/python/site-packages/sage/algebras/quatalg/quaternion_algebra.py", line 2745, in normalize_basis_at_p
print 'f', f, 'dif', min_v - valuation(p,2)
File "element.pyx", line 1550, in sage.structure.element.RingElement.__sub__ (sage/structure/element.c:13697)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7668)
File "coerce.pxi", line 71, in sage.structure.coerce.arith_error_message (sage/structure/coerce.c:3038)
File "coerce.pxi", line 41, in sage.structure.coerce.parent_c (sage/structure/coerce.c:2710)
TypeError: descriptor 'parent' of 'sage.structure.element.Element' object needs an argument
**********************************************************************
2 items had failures:
4 of 19 in __main__.example_20
4 of 16 in __main__.example_83
***Test Failed*** 8 failures.
For whitespace errors, see the file /Users/aly/.sage//tmp/quaternion_algebra_66690.py
[13.4 s]
sage -t "devel/sage/sage/algebras/quatalg/quaternion_algebra_cython.pyx"
[2.3 s]
sage -t "devel/sage/sage/algebras/quatalg/quaternion_algebra_element.pyx"
[4.4 s]
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage/sage/algebras/quatalg/quaternion_algebra.py"
Total time for all tests: 20.5 seconds
I'll try again on sage-5.1.
comment:5 Changed 10 months ago by daniels
Thanks for testing the patch! I just tried applying the patch from #12860 and after that the second patch from this ticket to a fresh install of Sage 5.2rc0, and the tests passed.
I also tried inserting your debug print:
print 'f', f, 'dif', min_v - valuation(p,2)
after the calls to f = normalize_basis_at_p(e[1:], p), but wasn't able to reproduce this error message.
I noticed that my line numbers are a bit different, i.e., a call to f = normalize_basis_at_p(e[1:], p) sits at line 2744 for you, while this only occurs on 2756 and 2787 for me.
Are there any other patches I should apply to debug this? (I have only #12860 followed by patch.2 of this ticket).
I did however notice a typo in the docstring of normalize_basis_at_p and have fixed thatin a new upload (p \eq 2 becomes p = 2).
On an unrelated note: If working with quaternion algebras you might also care about #12811 (which has a tiny patch).
comment:6 Changed 10 months ago by daniels
Finally, I managed to reliably reproduce the error but only when running `make ptestlong'. Calling either
sage -t --long -force_lib devel/sage/sage/algebras/quatalg/
or
sage -t --long devel/sage/sage/algebras/quatalg/
directly all tests pass. I'll try to figure out what's going on here, but this seems to be quite strange.
comment:7 Changed 10 months ago by aly.deines
That's interesting. I applied both patches to a clean Sage-5.2.rc0 install on mod.math.washington.edu, the tests ran fine. For me, the tests have only failed on my mac, but with both Sage-5.1 and Sage-5.2.rc0.
For the line discrepancy, I'd been debugging and had some print statements in a few places.
comment:8 Changed 10 months ago by daniels
Strange. But at least it always seems to die on the subtraction min_v - valuation(p, 2), so I suppose I must in fact be doing something wrong there (but so far I don't see the problem).
comment:9 Changed 10 months ago by daniels
It seems the problem was that I used PlusInfinity which is the class, not an instance thereof. Comparing the class with an integer is of course non-sense, but seems to have accidently worked most of the time (it is only used to ensure that B(e[0],e[0]) is less than min_v in the first iteration). So I need to replace it by either PlusInfinity() or infinity.
I'll upload a new patch once I have verified that make ptestlong now works for me.
comment:11 Changed 10 months ago by aly.deines
- Status changed from needs_review to positive_review
Good catch!
You aren't planning to generalize any of this to the number field case are you? If not, I'll have some patches up in that direction soon.
comment:12 Changed 10 months ago by daniels
I would love to see quaternion algebras over number fields implemented, but don't have any concrete plans to do it anytime soon. So feel free to work on it.
comment:13 Changed 10 months ago by jdemeyer
Please fill in your real name as Author.
comment:14 Changed 10 months ago by jdemeyer
Please fill in your real name as Reviewer.
comment:17 Changed 9 months ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-5.3.beta1

