|
34 | 34 | # (at your option) any later version.
|
35 | 35 | # https://www.gnu.org/licenses/
|
36 | 36 | # ****************************************************************************
|
| 37 | +from operator import itemgetter |
37 | 38 |
|
38 | 39 | from sage.arith.misc import (hilbert_conductor_inverse,
|
39 | 40 | hilbert_symbol,
|
40 |
| - factor, |
41 | 41 | gcd,
|
42 | 42 | kronecker as kronecker_symbol,
|
43 | 43 | prime_divisors,
|
|
47 | 47 | from sage.rings.integer_ring import ZZ
|
48 | 48 | from sage.rings.rational import Rational
|
49 | 49 | from sage.rings.finite_rings.finite_field_constructor import GF
|
50 |
| - |
51 |
| -from sage.rings.ring import Algebra |
52 | 50 | from sage.rings.ideal import Ideal_fractional
|
53 | 51 | from sage.rings.rational_field import is_RationalField, QQ
|
54 | 52 | from sage.rings.infinity import infinity
|
|
64 | 62 | from sage.modules.free_module import FreeModule
|
65 | 63 | from sage.modules.free_module_element import vector
|
66 | 64 |
|
67 |
| -from operator import itemgetter |
68 | 65 |
|
69 | 66 | from .quaternion_algebra_element import (
|
70 | 67 | QuaternionAlgebraElement_abstract,
|
@@ -310,7 +307,7 @@ def is_QuaternionAlgebra(A):
|
310 | 307 | return isinstance(A, QuaternionAlgebra_abstract)
|
311 | 308 |
|
312 | 309 |
|
313 |
| -class QuaternionAlgebra_abstract(Algebra): |
| 310 | +class QuaternionAlgebra_abstract(Parent): |
314 | 311 | def _repr_(self):
|
315 | 312 | """
|
316 | 313 | EXAMPLES::
|
@@ -665,7 +662,7 @@ def __init__(self, base_ring, a, b, names='i,j,k'):
|
665 | 662 | ValueError: 2 is not invertible in Integer Ring
|
666 | 663 | """
|
667 | 664 | 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) |
669 | 666 | self._a = a
|
670 | 667 | self._b = b
|
671 | 668 | if is_RationalField(base_ring) and a.denominator() == 1 == b.denominator():
|
@@ -984,6 +981,19 @@ def gen(self, i=0):
|
984 | 981 | """
|
985 | 982 | return self._gens[i]
|
986 | 983 |
|
| 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 | + |
987 | 997 | def _repr_(self):
|
988 | 998 | """
|
989 | 999 | Print representation.
|
|
0 commit comments