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

Commit

Permalink
TensorFreeModule.tensor_factors: Go through methods tensor_type, base…
Browse files Browse the repository at this point in the history
…_module
  • Loading branch information
mkoeppe committed Nov 12, 2022
1 parent 676772c commit 610545e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sage/tensor/modules/tensor_free_module.py
Expand Up @@ -382,12 +382,14 @@ def tensor_factors(self):
Dual of the Rank-3 free module M over the Integer Ring,
Dual of the Rank-3 free module M over the Integer Ring]
"""
if self._tensor_type == (0,1): # case of the dual
tensor_type = self.tensor_type()
if tensor_type == (0,1): # case of the dual
raise NotImplementedError
factors = [self._fmodule] * self._tensor_type[0]
dmodule = self._fmodule.dual()
if self._tensor_type[1]:
factors += [dmodule] * self._tensor_type[1]
bmodule = self.base_module()
factors = [bmodule] * tensor_type[0]
dmodule = bmodule.dual()
if tensor_type[1]:
factors += [dmodule] * tensor_type[1]
return factors

#### Parent Methods
Expand Down

0 comments on commit 610545e

Please sign in to comment.