Skip to content

Action of a sympy TensorSymmetry #32029

@mkoeppe

Description

@mkoeppe

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 and antisym 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions