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

Commit 6cc8b84

Browse files
author
Travis Scrimshaw
committed
Reviewer changes with Darij.
1 parent fa476dd commit 6cc8b84

9 files changed

+70
-26
lines changed

src/sage/algebras/associated_graded.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,16 @@ def __init__(self, A, category=None):
178178
base_ring = A.base_ring()
179179
base_one = base_ring.one()
180180

181-
if category is None:
182-
category = A.category().Graded()
183-
opts = copy(A.print_options())
184-
if not opts['prefix'] and not opts['bracket']:
185-
opts['bracket'] = '('
186-
opts['prefix'] = opts['prefix'] + 'bar'
187-
188-
CombinatorialFreeModule.__init__(self, base_ring, A.indices(),
181+
category = A.category().Graded().or_subcategory(category)
182+
try:
183+
opts = copy(A.print_options())
184+
if not opts['prefix'] and not opts['bracket']:
185+
opts['bracket'] = '('
186+
opts['prefix'] = opts['prefix'] + 'bar'
187+
except AttributeError:
188+
opts = {'prefix': 'Abar'}
189+
190+
CombinatorialFreeModule.__init__(self, base_ring, A.basis().keys(),
189191
category=category, **opts)
190192

191193
# Setup the conversion back

src/sage/algebras/clifford_algebra.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,9 @@ class CliffordAlgebra(CombinatorialFreeModule):
426426
(where `\ZZ_2 = \ZZ / 2 \ZZ`); this grading is determined by
427427
placing all elements of `V` in degree `1`. It is also an
428428
`\NN`-filtered algebra, with the filtration too being defined
429-
by placing all elements of `V` in degree `1`. Due to current
430-
limitations of the category framework, Sage can consider
431-
either the grading or the filtration but not both at the same
432-
time (though one can introduce two equal Clifford algebras,
433-
one filtered and the other graded); the ``graded`` parameter
434-
determines which of them is to be used.
429+
by placing all elements of `V` in degree `1`. The :meth:`degree` gives
430+
the `\NN`-*filtration* degree, and to get the super degree use instead
431+
:meth:`~sage.categories.super_modules.SuperModules.ElementMethods.is_even_odd`.
435432
436433
The Clifford algebra also can be considered as a covariant functor
437434
from the category of vector spaces equipped with quadratic forms
@@ -466,8 +463,6 @@ class CliffordAlgebra(CombinatorialFreeModule):
466463
467464
- ``Q`` -- a quadratic form
468465
- ``names`` -- (default: ``'e'``) the generator names
469-
- ``graded`` -- (default: ``True``) if ``True``, then use the `\ZZ / 2\ZZ`
470-
grading, otherwise use the `\ZZ` filtration
471466
472467
EXAMPLES:
473468
@@ -528,6 +523,9 @@ def __init__(self, Q, names, category=None):
528523
529524
sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6])
530525
sage: Cl = CliffordAlgebra(Q)
526+
sage: Cl.category()
527+
Category of finite dimensional super algebras with basis
528+
over (euclidean domains and infinite enumerated sets)
531529
sage: TestSuite(Cl).run()
532530
533531
TESTS:
@@ -1125,7 +1123,8 @@ def lift_isometry(self, m, names=None):
11251123
f = lambda x: Cl.prod(Cl._from_dict( {(j,): m[j,i] for j in range(n)},
11261124
remove_zeros=True )
11271125
for i in x)
1128-
return self.module_morphism(on_basis=f, codomain=Cl)
1126+
return self.module_morphism(on_basis=f, codomain=Cl,
1127+
category=AlgebrasWithBasis(self.base_ring()).Super())
11291128

11301129
# This is a general method for finite dimensional algebras with bases
11311130
# and should be moved to the corresponding category once there is
@@ -1348,7 +1347,7 @@ class ExteriorAlgebra(CliffordAlgebra):
13481347
`Q(v) = 0` for all vectors `v \in V`. See :class:`CliffordAlgebra`
13491348
for the notion of a Clifford algebra.
13501349
1351-
The exterior algebra of an `R`-module `V` is a super connected
1350+
The exterior algebra of an `R`-module `V` is a connected `\ZZ`-graded
13521351
Hopf superalgebra. It is commutative in the super sense (i.e., the
13531352
odd elements anticommute and square to `0`).
13541353
@@ -1422,6 +1421,9 @@ def __init__(self, R, names):
14221421
EXAMPLES::
14231422
14241423
sage: E.<x,y,z> = ExteriorAlgebra(QQ)
1424+
sage: E.category()
1425+
Category of finite dimensional super hopf algebras with basis
1426+
over Rational Field
14251427
sage: TestSuite(E).run()
14261428
"""
14271429
cat = HopfAlgebrasWithBasis(R).Super()
@@ -1569,7 +1571,7 @@ def lift_morphism(self, phi, names=None):
15691571
f = lambda x: E.prod(E._from_dict( {(j,): phi[j,i] for j in range(n)},
15701572
remove_zeros=True )
15711573
for i in x)
1572-
return self.module_morphism(on_basis=f, codomain=E)
1574+
return self.module_morphism(on_basis=f, codomain=E, category=AlgebrasWithBasis(R).Super())
15731575

15741576
def volume_form(self):
15751577
"""

src/sage/algebras/weyl_algebra.py

+1
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def __init__(self, R, names=None):
589589
raise ValueError("variable names cannot differ by a leading 'd'")
590590
# TODO: Make this into a filtered algebra under the natural grading of
591591
# x_i and dx_i have degree 1
592+
# Filtered is not included because it is a supercategory of super
592593
if R.is_field():
593594
cat = AlgebrasWithBasis(R).NoZeroDivisors().Super()
594595
else:

src/sage/categories/filtered_algebras_with_basis.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,14 @@ def induced_graded_map(self, other, f):
461461
sage: Q = QuadraticForm(ZZ, 2, [1,2,3])
462462
sage: B = CliffordAlgebra(Q, names=['u','v']); B
463463
The Clifford algebra of the Quadratic form in 2
464-
variables over Integer Ring with coefficients:
464+
variables over Integer Ring with coefficients:
465465
[ 1 2 ]
466466
[ * 3 ]
467467
sage: m = Matrix(ZZ, [[1, 2], [1, -1]])
468468
sage: f = B.lift_module_morphism(m, names=['x','y'])
469469
sage: A = f.domain(); A
470470
The Clifford algebra of the Quadratic form in 2
471-
variables over Integer Ring with coefficients:
471+
variables over Integer Ring with coefficients:
472472
[ 6 0 ]
473473
[ * 3 ]
474474
sage: x, y = A.gens()
@@ -521,7 +521,7 @@ def on_basis(m):
521521
lifted_img_of_m = f(from_gr(grA.monomial(m)))
522522
return other.projection(i)(lifted_img_of_m)
523523
return grA.module_morphism(on_basis=on_basis,
524-
codomain=grB, category=cat)
524+
codomain=grB, category=cat)
525525
# If we could assume that the projection of the basis
526526
# element of ``self`` indexed by an index ``m`` is the
527527
# basis element of ``grA`` indexed by ``m``, then this

src/sage/categories/filtered_modules_with_basis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def on_basis(m):
562562
lifted_img_of_m = f(from_gr(grA.monomial(m)))
563563
return other.projection(i)(lifted_img_of_m)
564564
return grA.module_morphism(on_basis=on_basis,
565-
codomain=grB, category=cat)
565+
codomain=grB, category=cat)
566566
# If we could assume that the projection of the basis
567567
# element of ``self`` indexed by an index ``m`` is the
568568
# basis element of ``grA`` indexed by ``m``, then this

src/sage/categories/modules_with_basis.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class ModulesWithBasis(CategoryWithAxiom_over_base_ring):
126126
.. NOTE::
127127
128128
This category currently requires an implementation of an
129-
element method ``support``. Once :trac:`18066`, an implementation
130-
of an ``items`` method will be required.
129+
element method ``support``. Once :trac:`18066` is merged, an
130+
implementation of an ``items`` method will be required.
131131
132132
TESTS::
133133

src/sage/categories/super_algebras.py

+17
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ def extra_super_categories(self):
4848
"""
4949
return [self.base_category().Graded()]
5050

51+
class ParentMethods:
52+
def graded_algebra(self):
53+
r"""
54+
Return the associated graded algebra to ``self``.
55+
56+
.. WARNING::
57+
58+
Because a super module `M` is naturally `\ZZ / 2 \ZZ`-graded, and
59+
graded modules have a natural filtration induced by the grading, if
60+
`M` has a different filtration, then the associated graded module
61+
`\operatorname{gr} M \neq M`. This is most apparent with super
62+
algebras, such as the :class:`differential Weyl algebra
63+
<sage.algebras.weyl_algebra.DifferentialWeylAlgebra>`, and the
64+
multiplication may not coincide.
65+
"""
66+
raise NotImplementedError
67+

src/sage/categories/super_algebras_with_basis.py

+22
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,25 @@ def extra_super_categories(self):
3737
"""
3838
return [self.base_category().Graded()]
3939

40+
class ParentMethods:
41+
def graded_algebra(self):
42+
r"""
43+
Return the associated graded module to ``self``.
44+
45+
See :class:`~sage.algebras.associated_graded.AssociatedGradedAlgebra`
46+
for the definition and the properties of this.
47+
48+
.. SEEALSO::
49+
50+
:meth:`~sage.categories.filtered_modules_with_basis.ParentMethods.graded_algebra`
51+
52+
EXAMPLES::
53+
54+
sage: W.<x,y> = algebras.DifferentialWeyl(QQ)
55+
sage: W.graded_algebra()
56+
Graded Algebra of Differential Weyl algebra of
57+
polynomials in x, y over Rational Field
58+
"""
59+
from sage.algebras.associated_graded import AssociatedGradedAlgebra
60+
return AssociatedGradedAlgebra(self)
61+

src/sage/categories/super_modules.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _repr_object_names(self):
8787
return "super {}".format(self.base_category()._repr_object_names())
8888

8989
class SuperModules(SuperModulesCategory):
90-
"""
90+
r"""
9191
The category of super modules.
9292
9393
An `R`-*super module* (where `R` is a ring) is an `R`-module `M` equipped

0 commit comments

Comments
 (0)