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: WIP isomorphism_w…
Browse files Browse the repository at this point in the history
…ith_fixed_basis with codomain=symmetric matrices
  • Loading branch information
mkoeppe committed Aug 27, 2022
1 parent eb517b2 commit 06e0cd8
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 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,42 @@ 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: [phi_e_T02(b) for b in e_T02]
[
[0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0]
[0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0]
[0 0 0], [0 0 0], [0 0 0], [0 0 0], [0 0 0], [0 0 0], [0 0 0], [0 0 0],
<BLANKLINE>
[0 0 0]
[0 0 0]
[0 0 0]
]
sage: W_basis = [phi_e_T02(b) for b in e_Sym2Vdual]; W_basis
[
[0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0]
[0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0] [0 0 0]
[0 0 0], [0 0 0], [0 0 0], [0 0 0], [0 0 0], [0 0 0]
]
sage: W = MatrixSpace(QQ, 3).submodule(W_basis); W
Free module generated by {} over Rational Field
sage: phi_e_Sym2Vdual = Sym2Vdual.isomorphism_with_fixed_basis(e_Sym2Vdual, codomain=W); phi_e_Sym2Vdual
Traceback (most recent call last):
...
ValueError: domain and codomain must have the same rank
Sending tensors to elements of the tensor square of :class:`CombinatorialFreeModule`::
sage: T20 = V.tensor_module(2, 0); T20
Expand Down

0 comments on commit 06e0cd8

Please sign in to comment.