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

Commit a002f4b

Browse files
author
Travis Scrimshaw
committed
Some tweaks to lifted_bilinear_form and fixed doctest.
1 parent 8698275 commit a002f4b

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

src/sage/algebras/clifford_algebra.py

+26-22
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
2222
from sage.categories.graded_hopf_algebras_with_basis import GradedHopfAlgebrasWithBasis
2323
from sage.categories.modules_with_basis import ModuleMorphismByLinearity
24+
from sage.categories.poor_man_map import PoorManMap
2425
from sage.rings.all import ZZ
2526
from sage.modules.free_module import FreeModule, FreeModule_generic
2627
from sage.matrix.constructor import Matrix
28+
from sage.matrix.matrix_space import MatrixSpace
2729
from sage.sets.family import Family
2830
from sage.combinat.free_module import CombinatorialFreeModule
2931
from sage.combinat.subset import SubsetsSorted
@@ -1773,15 +1775,15 @@ def lifted_bilinear_form(self, M):
17731775
a bilinear form `\Lambda(f) : \Lambda(V) \times
17741776
\Lambda(V) \to R` on `\Lambda(V)` can be canonically
17751777
defined as follows: For every `n \in \NN`, `m \in \NN`,
1776-
`v_1, v_2, \ldots, v_n \in V` and `w_1, w_2, \ldots,
1777-
w_m \in W`, we set
1778+
`v_1, v_2, \ldots, v_n, w_1, w_2, \ldots, w_m \in V`,
1779+
we define
17781780
17791781
.. MATH::
17801782
17811783
\Lambda(f)
17821784
( v_1 \wedge v_2 \wedge \cdots \wedge v_n ,
1783-
w_1 \wedge w_2 \wedge \cdots \wedge v_m )
1784-
= \begin{cases}
1785+
w_1 \wedge w_2 \wedge \cdots \wedge w_m )
1786+
:= \begin{cases}
17851787
0, &\mbox{if } n \neq m ; \\
17861788
\det G, & \mbox{if } n = m \end{cases} ,
17871789
@@ -1794,38 +1796,40 @@ def lifted_bilinear_form(self, M):
17941796
17951797
The bilinear form `\Lambda(f)` is symmetric if `f` is.
17961798
1797-
.. NOTE::
1798-
1799-
This takes a bilinear form on `V` as matrix, and
1800-
returns a bilinear form on ``self`` as a function in
1801-
two arguments. This is one of a myriad possible
1802-
design choices; is it a good one? (I would rather
1803-
not return the bilinear form on ``self`` as matrix,
1804-
since this matrix can be huge and one often needs
1805-
just a particular value. I don't know if it is
1806-
possible to return the bilinear form on ``self`` as
1807-
a bilinear map -- is there a class for bilinear
1808-
maps? -- and, if so, if this is useful thing to do.
1809-
18101799
INPUT:
18111800
18121801
- ``M`` -- a matrix over the same base ring as ``self``,
18131802
whose `(i, j)`-th entry is `f(e_i, e_j)`, where
18141803
`(e_1, e_2, \ldots, e_N)` is the standard basis of the
1815-
module `V` for which ``self`` `= \Lambda(V)` (so
1816-
that ``N = self.ngens()``), and where `f` is the
1817-
bilinear form which is to be lifted.
1804+
module `V` for which ``self`` `= \Lambda(V)` (so that
1805+
`N = 2^{\dim(V)}`), and where `f` is the bilinear form
1806+
which is to be lifted.
18181807
18191808
OUTPUT:
18201809
18211810
A bivariate function which takes two elements `p` and
18221811
`q` of ``self`` to `\Lambda(f)(p, q)`.
18231812
1813+
.. NOTE::
1814+
1815+
This takes a bilinear form on `V` as matrix, and
1816+
returns a bilinear form on ``self`` as a function in
1817+
two arguments. We do not return the bilinear form as
1818+
a matrix since this matrix can be huge and one often
1819+
needs just a particular value.
1820+
1821+
.. TODO::
1822+
1823+
Implement a class for bilinear forms and rewrite this
1824+
method to use that class.
1825+
18241826
EXAMPLES::
18251827
18261828
sage: E.<x,y,z> = ExteriorAlgebra(QQ)
18271829
sage: M = Matrix(QQ, [[1, 2, 3], [2, 3, 4], [3, 4, 5]])
18281830
sage: Eform = E.lifted_bilinear_form(M)
1831+
sage: Eform
1832+
Bilinear Form from The exterior algebra of rank 3 over Rational Field to Rational Field
18291833
sage: Eform(x*y, y*z)
18301834
-1
18311835
sage: Eform(x*y, y)
@@ -1877,7 +1881,6 @@ def lifted_bilinear_form(self, M):
18771881
back are implemented, check if this is faster.
18781882
"""
18791883
R = self.base_ring()
1880-
from sage.matrix.matrix_space import MatrixSpace
18811884
def lifted_form(x, y):
18821885
result = R.zero()
18831886
for mx, cx in x:
@@ -1897,7 +1900,8 @@ def lifted_form(x, y):
18971900
# typing (:trac:`17124`).
18981901
result += cx * cy * matr.determinant()
18991902
return result
1900-
return lifted_form
1903+
return PoorManMap(lifted_form, domain=self, codomain=self.base_ring(),
1904+
name="Bilinear Form")
19011905

19021906
class Element(CliffordAlgebraElement):
19031907
"""

src/sage/combinat/descent_algebra.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ def to_B_basis(self, S):
293293
[B[4],
294294
B[1, 3] - B[4],
295295
B[2, 2] - B[4],
296-
B[1, 1, 2] - B[1, 3] - B[2, 2] + B[4],
297296
B[3, 1] - B[4],
297+
B[1, 1, 2] - B[1, 3] - B[2, 2] + B[4],
298298
B[1, 2, 1] - B[1, 3] - B[3, 1] + B[4],
299299
B[2, 1, 1] - B[2, 2] - B[3, 1] + B[4],
300300
B[1, 1, 1, 1] - B[1, 1, 2] - B[1, 2, 1] + B[1, 3]
301-
- B[2, 1, 1] + B[2, 2] + B[3, 1] - B[4]]
301+
- B[2, 1, 1] + B[2, 2] + B[3, 1] - B[4]]
302302
"""
303303
B = self.realization_of().B()
304304

0 commit comments

Comments
 (0)