Skip to content

Commit 33505aa

Browse files
committed
use parent in quaternions
1 parent 0c390a0 commit 33505aa

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/sage/algebras/quatalg/quaternion_algebra.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
# (at your option) any later version.
3535
# https://www.gnu.org/licenses/
3636
# ****************************************************************************
37+
from operator import itemgetter
3738

3839
from sage.arith.misc import (hilbert_conductor_inverse,
3940
hilbert_symbol,
40-
factor,
4141
gcd,
4242
kronecker as kronecker_symbol,
4343
prime_divisors,
@@ -47,8 +47,6 @@
4747
from sage.rings.integer_ring import ZZ
4848
from sage.rings.rational import Rational
4949
from sage.rings.finite_rings.finite_field_constructor import GF
50-
51-
from sage.rings.ring import Algebra
5250
from sage.rings.ideal import Ideal_fractional
5351
from sage.rings.rational_field import is_RationalField, QQ
5452
from sage.rings.infinity import infinity
@@ -64,7 +62,6 @@
6462
from sage.modules.free_module import FreeModule
6563
from sage.modules.free_module_element import vector
6664

67-
from operator import itemgetter
6865

6966
from .quaternion_algebra_element import (
7067
QuaternionAlgebraElement_abstract,
@@ -310,7 +307,7 @@ def is_QuaternionAlgebra(A):
310307
return isinstance(A, QuaternionAlgebra_abstract)
311308

312309

313-
class QuaternionAlgebra_abstract(Algebra):
310+
class QuaternionAlgebra_abstract(Parent):
314311
def _repr_(self):
315312
"""
316313
EXAMPLES::
@@ -665,7 +662,7 @@ def __init__(self, base_ring, a, b, names='i,j,k'):
665662
ValueError: 2 is not invertible in Integer Ring
666663
"""
667664
cat = Algebras(base_ring).Division().FiniteDimensional()
668-
Algebra.__init__(self, base_ring, names, category=cat)
665+
Parent.__init__(self, base=base_ring, names=names, category=cat)
669666
self._a = a
670667
self._b = b
671668
if is_RationalField(base_ring) and a.denominator() == 1 == b.denominator():
@@ -984,6 +981,19 @@ def gen(self, i=0):
984981
"""
985982
return self._gens[i]
986983

984+
def gens(self) -> tuple:
985+
"""
986+
Return the generators of ``self``.
987+
988+
EXAMPLES::
989+
990+
sage: Q.<ii,jj,kk> = QuaternionAlgebra(QQ,-1,-2); Q
991+
Quaternion Algebra (-1, -2) with base ring Rational Field
992+
sage: Q.gens()
993+
(ii, jj, kk)
994+
"""
995+
return self._gens
996+
987997
def _repr_(self):
988998
"""
989999
Print representation.

0 commit comments

Comments
 (0)