Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'splitting_algebra_29716' into cubic_hecke_algebra_29717
Browse files Browse the repository at this point in the history
  • Loading branch information
soehms committed Jun 16, 2020
2 parents 16f7136 + e52eece commit 1d41115
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions src/sage/algebras/splitting_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ class SplittingAlgebra(PolynomialQuotientRing_domain):
sage: all(t^3 -u*t^2 +v*t -w == 0 for t in roots)
True
sage: xi = ~x; xi
((-w^-1)*x)*y + (-w^-1)*x^2 + ((w^-1)*u)*x
(w^-1)*x^2 + ((-w^-1)*u)*x + (w^-1)*v
sage: ~xi == x
True
sage: ~y
(w^-1)*x^2 + ((-w^-1)*u)*x + (w^-1)*v
((-w^-1)*x)*y + (-w^-1)*x^2 + ((w^-1)*u)*x
sage: zi = ((w^-1)*x)*y; ~zi
-y - x + u
Expand Down Expand Up @@ -438,8 +438,13 @@ def _first_ngens(self, n):
Splitting Algebra of x^3 + (-u^2 + v)*x^2 + (u + v)*x - 1
with roots [X, Y, -Y - X + u^2 - v]
over Multivariate Polynomial Ring in u, v over Integer Ring
sage: S._first_ngens(4)
(X, Y, u, v)
"""
return self.gens_recursive()[:n]
srts = self.splitting_roots()
k = len(srts)-1
gens = srts[:k] + list(self.scalar_base_ring().gens())
return tuple(gens[:n])

def _element_constructor_(self, x):
r"""
Expand All @@ -453,7 +458,7 @@ def _element_constructor_(self, x):
sage: S(u + v)
u + v
sage: S(X*Y + X)
(X + 1)*Y
X*Y + X
sage: TestSuite(S).run() # indirect doctest
"""
if isinstance(x, SplittingAlgebraElement):
Expand Down Expand Up @@ -576,26 +581,6 @@ def splitting_roots(self):
"""
return self._splitting_roots

@cached_method
def gens_recursive(self):
r"""
Return all generators recursively.
EXAMPLES::
sage: from sage.algebras.splitting_algebra import SplittingAlgebra
sage: L.<u, v, w > = LaurentPolynomialRing(ZZ)
sage: x = polygen(L)
sage: S = SplittingAlgebra(x^3 - u*x^2 + v*x - w, ('X', 'Y'))
sage: S.gens_recursive()
(Y, X, u, v, w)
"""
base_ring = self.base_ring()
res = self.gens()
if isinstance(base_ring, SplittingAlgebra):
return res + base_ring.gens_recursive()
return res + base_ring.gens()

@cached_method
def scalar_base_ring(self):
r"""
Expand Down

0 comments on commit 1d41115

Please sign in to comment.