sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 462 forks source link

broken (?) discriminant of quaternion algebra #337

Closed aghitza closed 17 years ago

aghitza commented 17 years ago

Quaternion algebras seem to have a function discriminant(), but this fails when I try to use it. Here is an example -- as far as I can tell the problem might actually be in gram_matrix():

----------------------------------------------------------------------
| SAGE Version 2.4.1.2, Release Date: 2007-03-28                     |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: B.<i,j,k> = QuaternionAlgebra(QQ,-3,-1)
sage: B
Quaternion algebra with generators (i, j, k) over Rational Field
sage: B.discriminant()
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'>        Traceback (most recent call last)

/home/ghitza/python/<ipython console> in <module>()

/opt/sage/local/lib/python2.5/site-packages/sage/algebras/quaternion_algebra.py in discriminant(self)
    349         
    350     def discriminant(self):
--> 351         return self.gram_matrix().determinant()
    352 
    353     def gram_matrix(self):

/opt/sage/local/lib/python2.5/site-packages/sage/algebras/quaternion_algebra.py in gram_matrix(self)
    353     def gram_matrix(self):
    354         V = self.__vector_space
--> 355         if not V._FreeModule_generic__inner_product_is_dot_product:
    356             return V.inner_product_matrix()
    357         K = self.base_ring()

<type 'exceptions.AttributeError'>: 'FreeModule_ambient_field' object has no attribute '_FreeModule_generic__inner_product_is_dot_product'

Component: packages: standard

Issue created by migration from https://trac.sagemath.org/ticket/337

williamstein commented 17 years ago
comment:1

fixed in sage-2.8.