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

Commit

Permalink
src/sage/tensor/modules/finite_rank_free_module.py: isomorphism_with_…
Browse files Browse the repository at this point in the history
…fixed_basis with codomain=symmetric matrices
  • Loading branch information
mkoeppe committed Aug 27, 2022
1 parent eb517b2 commit e2d2ea8
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/sage/tensor/modules/finite_rank_free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,36 @@ def isomorphism_with_fixed_basis(self, basis=None, codomain=None):
[2 4 5]
[3 5 6]
Same but explicitly in the subspace of symmetric bilinear forms::
sage: Sym2Vdual = V.dual_symmetric_power(2); Sym2Vdual
Free module of type-(0,2) tensors
with Fully symmetric 2-indices components w.r.t. (1, 2, 3)
on the 3-dimensional vector space over the Rational Field
sage: Sym2Vdual.is_submodule(T02)
True
sage: Sym2Vdual.rank()
6
sage: e_Sym2Vdual = Sym2Vdual.basis("e"); e_Sym2Vdual
Standard basis on the Free module of type-(0,2) tensors
with Fully symmetric 2-indices components w.r.t. (1, 2, 3)
on the 3-dimensional vector space over the Rational Field
induced by Basis (e_1,e_2,e_3) on the 3-dimensional vector space over the Rational Field
sage: W_basis = [phi_e_T02(b) for b in e_Sym2Vdual]; W_basis
[
[1 0 0] [0 1 0] [0 0 1] [0 0 0] [0 0 0] [0 0 0]
[0 0 0] [1 0 0] [0 0 0] [0 1 0] [0 0 1] [0 0 0]
[0 0 0], [0 0 0], [1 0 0], [0 0 0], [0 1 0], [0 0 1]
]
sage: W = MatrixSpace(QQ, 3).submodule(W_basis); W
Free module generated by {0, 1, 2, 3, 4, 5} over Rational Field
sage: phi_e_Sym2Vdual = Sym2Vdual.isomorphism_with_fixed_basis(e_Sym2Vdual, codomain=W); phi_e_Sym2Vdual
Generic morphism:
From: Free module of type-(0,2) tensors
with Fully symmetric 2-indices components w.r.t. (1, 2, 3)
on the 3-dimensional vector space over the Rational Field
To: Free module generated by {0, 1, 2, 3, 4, 5} over Rational Field
Sending tensors to elements of the tensor square of :class:`CombinatorialFreeModule`::
sage: T20 = V.tensor_module(2, 0); T20
Expand Down Expand Up @@ -909,6 +939,8 @@ def isomorphism_with_fixed_basis(self, basis=None, codomain=None):
else:
# assume that the keys of the codomain should be used
key_pairs = zip(codomain_basis.keys(), basis.keys())
# Need them several times, can't keep as generators
key_pairs = tuple(key_pairs)

def _isomorphism(x):
r"""
Expand Down

0 comments on commit e2d2ea8

Please sign in to comment.