Opened 4 months ago
Last modified 4 months ago
#30229 new defect
Submodules of TensorFreeModule defined by the symmetries of a Components object
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage9.3 
Component:  linear algebra  Keywords:  
Cc:  egourgoulhon, tscrim, ghmjungmath, slelievre  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/mkoeppe/extpowerfreemodule__extpowerdualfreemodule__tensorfreemodule_cannot_create_a_basis (Commits)  Commit:  19915c1a8b547069a5afc7e4f65c8f3700615ef2 
Dependencies:  #30254, #30250  Stopgaps: 
Description (last modified by )
Currently, TensorFreeModule
does not have an interface to the bases that it uses implicitly, nor is it possible to create new bases for it.
sage: M = FiniteRankFreeModule(ZZ, 3, name='M') sage: e = M.basis('e') sage: T = M.tensor_module(1, 2); T Free module of type(1,2) tensors on the Rank3 free module M over the Integer Ring sage: T.default_basis() No default basis has been defined on the Free module of type(1,2) tensors on the Rank3 free module M over the Integer Ring sage: T.basis('q') TypeError: __init__() missing 1 required positional argument: 'tensor_type'
On this ticket, we add a subclass TensorFreeSubmodule_comp
of TensorFreeModule
that implements subspaces spanned by the tensors with prescribed symmetries.
It provides a basis
method that returns an instance of the new class TensorFreeSubmoduleBasis_comp
, which represents the standard basis corresponding to a given Components
object.
Also any TensorFreeModule
provides a basis
method that returns such a basis object.
Change History (30)
comment:1 Changed 4 months ago by
 Summary changed from ExtPowerFreeModule and TensorFreeModule cannot create a basis to ExtPowerFreeModule, ExtPowerDualFreeModule, TensorFreeModule cannot create a basis
comment:2 followup: ↓ 7 Changed 4 months ago by
comment:3 Changed 4 months ago by
 Cc slelievre added
 Description modified (diff)
comment:4 followup: ↓ 6 Changed 4 months ago by
Thanks a lot for the explanation.
Yes, a NotImplementedError
with a clear message would be an improvement.
It could also be considered whether these three classes should really be subclasses of FiniteRankFreeModule
, or perhaps rather a new common baseclass.
comment:5 Changed 4 months ago by
 Description modified (diff)
comment:6 in reply to: ↑ 4 Changed 4 months ago by
 Description modified (diff)
Replying to mkoeppe:
It could also be considered whether these three classes should really be subclasses of
FiniteRankFreeModule
, or perhaps rather a new common baseclass.
Yes, indeed!
comment:7 in reply to: ↑ 2 Changed 4 months ago by
Replying to egourgoulhon:
all the basis management is performed at the level of the base module. Indeed, any choice of basis in the base module gives birth uniquely to a basis in each of the tensor modules and exterior power modules.
Given this, I am also wondering whether perhaps there should be a subclass of Basis_abstract
that would make these bases explicit.
comment:8 Changed 4 months ago by
 Branch set to u/mkoeppe/extpowerfreemodule__extpowerdualfreemodule__tensorfreemodule_cannot_create_a_basis
comment:9 Changed 4 months ago by
 Commit set to 862aca828ac0228f11afee91a4388b54d4834c74
 Description modified (diff)
Preliminary branch
New commits:
862aca8  WIP: Implement TensorFreeModule.basis with new class FreeModuleCompTensorBasis

comment:10 Changed 4 months ago by
 Commit changed from 862aca828ac0228f11afee91a4388b54d4834c74 to 3bd0a8a8004df62ad2e332d198e3f0529afe1f9d
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
3bd0a8a  TensorFreeSubmodule_comp, TensorFreeSubmoduleBasis_comp: New

comment:11 Changed 4 months ago by
 Description modified (diff)
 Summary changed from ExtPowerFreeModule, ExtPowerDualFreeModule, TensorFreeModule cannot create a basis to Submodules of TensorFreeModule defined by the symmetries of a Components object
comment:12 Changed 4 months ago by
 Commit changed from 3bd0a8a8004df62ad2e332d198e3f0529afe1f9d to c4d8d07ec2f8846b0607b46d1afd7840bf606c48
Branch pushed to git repo; I updated commit sha1. New commits:
c4d8d07  Move basis method to TensorFreeModule

comment:13 followup: ↓ 14 Changed 4 months ago by
Here's an early draft, comments welcome
comment:14 in reply to: ↑ 13 Changed 4 months ago by
Replying to mkoeppe:
Here's an early draft, comments welcome
Thanks. It seems that the file tensor_free_submodule_basis.py
is missing in the ticket branch.
comment:15 Changed 4 months ago by
 Commit changed from c4d8d07ec2f8846b0607b46d1afd7840bf606c48 to 270ebb309defd1ed9c8e701c7b45cfe1d39ed45c
Branch pushed to git repo; I updated commit sha1. New commits:
270ebb3  Add missing file

comment:16 followup: ↓ 20 Changed 4 months ago by
Sorry, here you go.
comment:17 Changed 4 months ago by
 Commit changed from 270ebb309defd1ed9c8e701c7b45cfe1d39ed45c to 22bb5ac40338cb028cc14e587ae9a83db14c3deb
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
a734bf8  TensorFreeSubmodule_comp, TensorFreeSubmoduleBasis_comp: New

fdd6646  Move basis method to TensorFreeModule

a61f8e7  Add missing file

c01a5e9  FiniteRankFreeModule: Add methods is_submodule, ambient_module

1aedfa4  TensorFreeModule: Remove duplicate method 'basis'

22bb5ac  TensorFreeSubmodule_comp.is_submodule: New

comment:18 Changed 4 months ago by
 Commit changed from 22bb5ac40338cb028cc14e587ae9a83db14c3deb to 80af815bffa9f7147adb15b65b14147558d1ea44
comment:19 Changed 4 months ago by
 Commit changed from 80af815bffa9f7147adb15b65b14147558d1ea44 to 8f3e41be3baa80dab17f50b1be54f4dff7904af9
Branch pushed to git repo; I updated commit sha1. New commits:
8f3e41b  TensorFreeSubmodule_comp: Add alias ambient = ambient_module

comment:20 in reply to: ↑ 16 Changed 4 months ago by
comment:21 Changed 4 months ago by
comment:22 Changed 4 months ago by
 Dependencies set to #30254, #30250
comment:23 Changed 4 months ago by
 Commit changed from 8f3e41be3baa80dab17f50b1be54f4dff7904af9 to ea1bac7b706f90d6aea1b2d568e1da28beb24543
Branch pushed to git repo; I updated commit sha1. New commits:
1da5b3d  TensorFreeSubmodule_comp: Add tests

d64c8ed  ExtPowerFreeModule._an_element_: Make sure a default basis is available

d2d7f42  ExtPowerDualFreeModule._an_element_: Make sure a default basis is available

9e739e5  FreeModuleLinearGroup._an_element_: Make sure a default basis is available

eec19fd  TensorFreeModule._an_element_: Make sure a default basis is available

0cf7917  Merge branch 't/30254/tensorfreemodule__an_element___create_a_default_basis_in_the_base_module_if_necessary' into t/30229/extpowerfreemodule__extpowerdualfreemodule__tensorfreemodule_cannot_create_a_basis

5a340d9  TensorFreeModule.__init__: Remove duplicate registration of self in the base module, uniqueness check

de35db3  FreeModuleBasis.__init__: Update all modules in the set fmodule._all_modules

ea1bac7  Merge branch 't/30250/finiterankfreemodule__simplify_unique_representation_code_for_dependent_modules' into t/30229/extpowerfreemodule__extpowerdualfreemodule__tensorfreemodule_cannot_create_a_basis

comment:24 Changed 4 months ago by
 Commit changed from ea1bac7b706f90d6aea1b2d568e1da28beb24543 to c98bc5db7d4416b0a4510d0a94080aebee78e68e
comment:25 Changed 4 months ago by
 Commit changed from c98bc5db7d4416b0a4510d0a94080aebee78e68e to d3366933fae1f4b618952b54f39952277cb37c26
Branch pushed to git repo; I updated commit sha1. New commits:
d336693  Fixup

comment:26 Changed 4 months ago by
 Commit changed from d3366933fae1f4b618952b54f39952277cb37c26 to 84387d99ce0ec880d5a9ad07bc4bc01e81a07805
comment:27 Changed 4 months ago by
 Commit changed from 84387d99ce0ec880d5a9ad07bc4bc01e81a07805 to b74f562ae9d611abd88221c57eec4d6e5fc2a3a7
comment:28 Changed 4 months ago by
 Commit changed from b74f562ae9d611abd88221c57eec4d6e5fc2a3a7 to a5da63b8e6be948b9b5c8deaaa0ecdc6e9566a29
comment:29 Changed 4 months ago by
 Commit changed from a5da63b8e6be948b9b5c8deaaa0ecdc6e9566a29 to 19915c1a8b547069a5afc7e4f65c8f3700615ef2
Branch pushed to git repo; I updated commit sha1. New commits:
19915c1  FiniteRankFreeModule._test_basis: Run the test suite of the basis object

comment:30 Changed 4 months ago by
 Milestone changed from sage9.2 to sage9.3
The current design of
ExtPowerFreeModule
,ExtPowerDualFreeModule
andTensorFreeModule
is such that they cannot have their own bases, although they are mathematically free modules and they inherit fromFiniteRankFreeModule
. This is because all the basis management is performed at the level of the base module. Indeed, any choice of basis in the base module gives birth uniquely to a basis in each of the tensor modules and exterior power modules. For instance:The components are set and displayed with respect to the basis
e = (e_0, e_1)
of the base moduleM
and its dual basis(e^0, e^1)
:The same feature holds for
ExtPowerDualFreeModule
elements:If we introduce proper bases for the derived modules
ExtPowerFreeModule
,ExtPowerDualFreeModule
andTensorFreeModule
, thent.display()
would become ambiguous: shall we want a display w.r.t. to the default basis ofM
or to the default basis oft.parent()
? Moreover, the storage of components is currently performed with respect to bases of the base module. Introducing bases in the tensor modules shall of course not lead to duplicate storage.If we keep this design (which I would favor at this stage), then, for the sake of clarity,
shall return a
NotImplementedError
and not aTypeError
, with a message like only bases on the base module are implemented.