-
-
Notifications
You must be signed in to change notification settings - Fork 656
Open
Description
SymPy's TensorSymmetry
(https://docs.sympy.org/latest/modules/tensor/tensor.html) uses a trick to represent (monoterm) tensor symmetries and antisymmetries as permutation groups: Two extra elements (in the example below, 3 and 4) keep track of the sign
sage: TensorSymmetry.fully_symmetric(3)
TensorSymmetry((0, 1), ((4)(0 1), (4)(1 2)))
sage: TensorSymmetry.fully_symmetric(-3) # fully antisymmetric 3 indices
TensorSymmetry((0, 1), ((0 1)(3 4), (1 2)(3 4)))
The 2-cycle (3 4) represents the antisymmetry. What is displayed there is the "base and strong generating system".
This trick can of course be generalized to Mathematica's "phased permutation groups" (#30276) by using longer cycles.
We define a class TensorSymmetryGroup
- which can be initialized from
sage.tensor
sym
andantisym
lists - can convert to/from
sympy.tensor.tensor.TensorSymmetry
- defines
_get_action_
for acting on tensor modules / components
CC: @tscrim @egourgoulhon @dimpase @honglizhaobob @spaghettisalat
Component: linear algebra
Branch/Commit: u/mkoeppe/action_of_a_sympy_tensorsymmetry @ 3629386
Issue created by migration from https://trac.sagemath.org/ticket/32029