diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index 491a8866372..24b944d6a6c 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,3 +1,3 @@ tarball=configure-VERSION.tar.gz -sha1=282c4b485888da0c9e2ce72c1c2b08f2df47480b -sha256=ddb46580851222af6d0f3bc8f997c47792cccb5a875dd22d130bb5b1acb8731e +sha1=7b7c79fc15432a1cc3d08c2f2fc610391970a727 +sha256=732dc8f003f58952b811302a48ad743dab86208d236df8843fd6b904c46aa474 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 53e8ec388c9..b2696d2b691 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -3c279ec5712e0fa35c5733e03e010970727d7189 +46d6ebe05583047bc9cc89904af075483e78fdae diff --git a/src/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py index b4a6d4acd47..ad04a988f15 100644 --- a/src/sage/algebras/free_algebra.py +++ b/src/sage/algebras/free_algebra.py @@ -915,7 +915,7 @@ def g_algebra(self, relations, names=None, order='degrevlex', check=True): """ The `G`-Algebra derived from this algebra by relations. - By default is assumed, that two variables commute. + By default it is assumed that any two variables commute. .. TODO:: @@ -958,6 +958,7 @@ def g_algebra(self, relations, names=None, order='degrevlex', check=True): (-t)*x*y + t*y + (t + 1) """ from sage.matrix.constructor import Matrix + commutative = not relations base_ring = self.base_ring() polynomial_ring = PolynomialRing(base_ring, self.gens()) @@ -993,7 +994,7 @@ def g_algebra(self, relations, names=None, order='degrevlex', check=True): from sage.rings.polynomial.plural import g_Algebra return g_Algebra(base_ring, cmat, dmat, names=names or self.variable_names(), - order=order, check=check) + order=order, check=check, commutative=commutative) def poincare_birkhoff_witt_basis(self): """ diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx index d78464e1deb..cdcb01eb2d2 100644 --- a/src/sage/rings/polynomial/plural.pyx +++ b/src/sage/rings/polynomial/plural.pyx @@ -157,7 +157,7 @@ class G_AlgFactory(UniqueFactory): - ``key`` -- a 6-tuple, formed by a base ring, a tuple of names, two matrices over a polynomial ring over the base ring with the given variable names, a term order, and a category - - ``extra_args`` -- a dictionary, whose only relevant key is 'check'. + - ``extra_args`` -- a dictionary, whose only relevant key is 'check' TESTS:: @@ -174,7 +174,7 @@ class G_AlgFactory(UniqueFactory): category, check) def create_key_and_extra_args(self, base_ring, c, d, names=None, order=None, - category=None, check=None): + category=None, check=None, commutative=None): """ Create a unique key for g-algebras. @@ -186,6 +186,7 @@ class G_AlgFactory(UniqueFactory): - ``order`` -- (optional) term order - ``category`` -- (optional) category - ``check`` -- optional bool + - ``commutative`` -- optional bool TESTS:: @@ -193,6 +194,10 @@ class G_AlgFactory(UniqueFactory): sage: H = A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) sage: H is A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) # indirect doctest True + + sage: P = A.g_algebra(relations={}, order='lex') + sage: P.category() + Category of commutative algebras over Rational Field """ if names is None: raise ValueError("The generator names must be provided") @@ -213,7 +218,11 @@ class G_AlgFactory(UniqueFactory): d.set_immutable() # Get the correct category - category = check_default_category(Algebras(base_ring), category) + if commutative: + usualcat = Algebras(base_ring).Commutative() + else: + usualcat = Algebras(base_ring) + category = check_default_category(usualcat, category) # Extra arg if check is None: diff --git a/src/sage/structure/factory.pyx b/src/sage/structure/factory.pyx index ab8b5afa4a1..548e2c40a4e 100644 --- a/src/sage/structure/factory.pyx +++ b/src/sage/structure/factory.pyx @@ -171,9 +171,9 @@ cdef class UniqueFactory(SageObject): ....: return args, {'impl':kwds.get('impl', None)} ....: def create_object(self, version, key, **extra_args): ....: impl = extra_args['impl'] - ....: if impl=='C': + ....: if impl == 'C': ....: return C(*key) - ....: if impl=='D': + ....: if impl == 'D': ....: return D(*key) ....: return E(*key) ....: