|
1 | 1 | r"""
|
2 | 2 | Super algebras with basis
|
3 | 3 | """
|
4 |
| -#***************************************************************************** |
| 4 | +# **************************************************************************** |
5 | 5 | # Copyright (C) 2015,2019 Travis Scrimshaw <tcscrims at gmail.com>
|
6 | 6 | #
|
7 | 7 | # Distributed under the terms of the GNU General Public License (GPL)
|
8 |
| -# http://www.gnu.org/licenses/ |
9 |
| -#****************************************************************************** |
| 8 | +# https://www.gnu.org/licenses/ |
| 9 | +# ***************************************************************************** |
10 | 10 |
|
11 | 11 | from sage.categories.super_modules import SuperModulesCategory
|
12 | 12 | from sage.categories.signed_tensor import SignedTensorProductsCategory
|
13 | 13 | from sage.misc.cachefunc import cached_method
|
14 | 14 |
|
| 15 | + |
15 | 16 | class SuperAlgebrasWithBasis(SuperModulesCategory):
|
16 | 17 | """
|
17 | 18 | The category of super algebras with a distinguished basis
|
@@ -59,6 +60,66 @@ def graded_algebra(self):
|
59 | 60 | from sage.algebras.associated_graded import AssociatedGradedAlgebra
|
60 | 61 | return AssociatedGradedAlgebra(self)
|
61 | 62 |
|
| 63 | + class ElementMethods: |
| 64 | + def supercommutator(self, x): |
| 65 | + r""" |
| 66 | + Return the supercommutator of ``self`` and ``x``. |
| 67 | +
|
| 68 | + Let `A` be a superalgebra. The *supercommutator* of homogeneous |
| 69 | + elements `x, y \in A` is defined by |
| 70 | +
|
| 71 | + .. MATH:: |
| 72 | +
|
| 73 | + [x, y\} = x y - (-1)^{|x| |y|} y x |
| 74 | +
|
| 75 | + and extended to all elements by linearity. |
| 76 | +
|
| 77 | + EXAMPLES:: |
| 78 | +
|
| 79 | + sage: Q = QuadraticForm(ZZ, 3, [1,2,3,4,5,6]) |
| 80 | + sage: Cl.<x,y,z> = CliffordAlgebra(Q) |
| 81 | + sage: a = x*y - z |
| 82 | + sage: b = x - y + y*z |
| 83 | + sage: a.supercommutator(b) |
| 84 | + -5*x*y + 8*x*z - 2*y*z - 6*x + 12*y - 5*z |
| 85 | + sage: a.supercommutator(Cl.one()) |
| 86 | + 0 |
| 87 | + sage: Cl.one().supercommutator(a) |
| 88 | + 0 |
| 89 | + sage: Cl.zero().supercommutator(a) |
| 90 | + 0 |
| 91 | + sage: a.supercommutator(Cl.zero()) |
| 92 | + 0 |
| 93 | +
|
| 94 | + sage: Q = QuadraticForm(ZZ, 2, [-1,1,-3]) |
| 95 | + sage: Cl.<x,y> = CliffordAlgebra(Q) |
| 96 | + sage: [a.supercommutator(b) for a in Cl.basis() for b in Cl.basis()] |
| 97 | + [0, 0, 0, 0, 0, -2, 1, -x - 2*y, 0, 1, |
| 98 | + -6, 6*x + y, 0, x + 2*y, -6*x - y, 0] |
| 99 | + sage: [a*b-b*a for a in Cl.basis() for b in Cl.basis()] |
| 100 | + [0, 0, 0, 0, 0, 0, 2*x*y - 1, -x - 2*y, 0, |
| 101 | + -2*x*y + 1, 0, 6*x + y, 0, x + 2*y, -6*x - y, 0] |
| 102 | +
|
| 103 | + Exterior algebras inherit from Clifford algebras, so |
| 104 | + supercommutators work as well. We verify the exterior algebra |
| 105 | + is supercommutative:: |
| 106 | +
|
| 107 | + sage: E.<x,y,z,w> = ExteriorAlgebra(QQ) |
| 108 | + sage: all(b1.supercommutator(b2) == 0 |
| 109 | + ....: for b1 in E.basis() for b2 in E.basis()) |
| 110 | + True |
| 111 | + """ |
| 112 | + P = self.parent() |
| 113 | + ret = P.zero() |
| 114 | + for ms, cs in self: |
| 115 | + term_s = P.term(ms, cs) |
| 116 | + sign_s = (-1)**P.degree_on_basis(ms) |
| 117 | + for mx, cx in x: |
| 118 | + ret += term_s * P.term(mx, cx) |
| 119 | + s = sign_s**P.degree_on_basis(mx) |
| 120 | + ret -= s * P.term(mx, cx) * term_s |
| 121 | + return ret |
| 122 | + |
62 | 123 | class SignedTensorProducts(SignedTensorProductsCategory):
|
63 | 124 | """
|
64 | 125 | The category of super algebras with basis constructed by tensor
|
|
0 commit comments