#23429 closed enhancement (fixed)

Multivector fields and the Schouten-Nijenhuis bracket

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-8.1
Component: geometry Keywords: multivector, Schouten-Nijenhuis bracket
Cc: bpym, tscrim Merged in:
Authors: Eric Gourgoulhon Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 18df6e6 (Commits) Commit: 18df6e6efdeb307b3c7abdb15fbccfe191dd5901
Dependencies: #23207 Stopgaps:

Description

This ticket implements multivector fields (i.e. alternating contravariant tensor fields) on differentiable manifolds, via the parent classes

  • MultivectorModule: set Ap(M) of multivector fields of a degree p on a manifold M, considered as a module over the commutative algebra Ck(M) of differentiable scalar fields
  • MultivectorFreeModule: set Ap(M) of multivector fields of a degree p on a parallelizable manifold M, considered as a free module of rank binomial(n,p) over Ck(M) (where n=dimM)

and the element classes

  • MultivectorField: multivector field on a differentiable manifold
  • MultivectorFieldParal: multivector field on a parallelizable differentiable manifold

The classes MultivectorFreeModule and MultivectorFieldParal inherit from respectively ExtPowerFreeModule and AlternatingContrTensor, which have been introduced in #23207.

The classes VectorField and VectorFieldParal inherit now from the new classes MultivectorField and MultivectorFieldParal, since a vector field is a multivector field of degree 1.

The ticket implements the exterior product Ap(M) x Aq(M) ---> Ap+q(M) (method wedge), as well as the interior products

  • Ap(M) x Omegaq(M) ---> Omegaq-p(M)
  • Omegap(M) x Aq(M) ---> Aq-p(M)

for p<=q, where Omegap(M) is the Ck(M)-module of differential forms of degree p on M (method interior_product). The ticket also implements the Schouten-Nijenhuis bracket Ap(M)xAq(M) ---> Ap+q-1(M) (method bracket), extending the Lie bracket of vector fields.

This is a follow up of #23207 within the SageManifolds project (see the metaticket #18528 for an overview).

Change History (16)

comment:1 Changed 17 months ago by egourgoulhon

  • Branch set to public/manifolds/multivector_fields
  • Commit set to 3ef506fefbd77db9a6acbcee247e3b284246f483
  • Status changed from new to needs_review

Last 10 new commits:

4beecb4Merge branch 'public/manifolds/ext_powers' of git://trac.sagemath.org/sage into Sage 8.0.rc1
1c0f037Change the name of modules of differential forms of degree p from Lambda^p(M) to Omega^p(M)
a73170cStart the implementation of multivector fields on manifolds (work in progress)
fd4d5f4More code regarding multivector fields on manifolds (work in progress)
6f8bec4Implement alternating multivector fields on manifolds (interior products in progress)
e2dee33Complete implementation of interior products on manifolds
19abb49Start implementation of Schouten-Nijenhuis bracket (work in progress)
7398cc8Complete implementation of Schouten-Nijenhuis bracket on parallelizable manifolds
42c4106Add doctests and documentation for the Schouten-Nijenhuis bracket
3ef506fComplete doctests and documentation for the Schouten-Nijenhuis bracket

comment:2 Changed 15 months ago by git

  • Commit changed from 3ef506fefbd77db9a6acbcee247e3b284246f483 to 08b5dae48cd9242dbaa758d03ac88b0232d93ddd

Branch pushed to git repo; I updated commit sha1. New commits:

08b5daeSlight improvement in MultivectorModule._element_constructor_

comment:3 Changed 15 months ago by egourgoulhon

Following what has been done in #23623 for tensor field modules, the above commit changes the potentially expensive test

if comp == 0:
    return self.zero() 

to

if isinstance(comp, (int, Integer)) and comp == 0:
    return self.zero()

in _element_constructor_ of classes MultivectorModule and MultivectorFreeModule.

comment:4 Changed 15 months ago by git

  • Commit changed from 08b5dae48cd9242dbaa758d03ac88b0232d93ddd to bff445f1b111b436cdb47cc17a5611cbdc0288f4

Branch pushed to git repo; I updated commit sha1. New commits:

bff445fSolve merge conflict in master references file

comment:5 Changed 15 months ago by egourgoulhon

The above commit (cf. comment:4) solves a merge conflict with Sage 8.1.beta5 in the master file for references (src/doc/en/reference/references/index.rst).

comment:6 follow-up: Changed 15 months ago by tscrim

A few minor comments:

Typo (appears twice):

- ``other`` -- a multivector field, `b` say

No comma here:

- ``other`` -- a multivector field, of degree `p`

Could you remove a few of these extra blanklines:

+    The Lie derivative of a 2-vector field is a 2-vector field::
+
+        sage: ab.lie_der(a)
+        2-vector field on the 3-dimensional differentiable manifold R3
+
+
+
+    """
+    def __init__(self, vector_field_module, degree, name=None,
+                 latex_name=None):

It is a little easier to read

-       resu_name = None ; resu_latex_name = None
+       resu_name = None
+       resu_latex_name = None

Do you need to use Sage's Set? It is quite a bit slower than the Python set.

For things like this:

                resu._restrictions[dom] = \
                                     dom.tensor_field_module((p,0))(rst)

it is better on 1 line and go over the 80 char/line for maintenance and readability. This is more a judgment call about the lesser of two evils.

comment:7 Changed 15 months ago by git

  • Commit changed from bff445f1b111b436cdb47cc17a5611cbdc0288f4 to b9670952c258c69d6350e91a8d926916ccce3399

Branch pushed to git repo; I updated commit sha1. New commits:

b967095Minor corrections regarding multivector fields

comment:8 in reply to: ↑ 6 ; follow-up: Changed 15 months ago by egourgoulhon

Replying to tscrim:

Thanks for your comments; the above commit takes them into account.

Do you need to use Sage's Set?

Yes, because I need the method subsets, which does not exist for Python set.

comment:9 Changed 15 months ago by git

  • Commit changed from b9670952c258c69d6350e91a8d926916ccce3399 to fc4ef8e0eeecf09da501d9816b6ba401c0c2b016

Branch pushed to git repo; I updated commit sha1. New commits:

fc4ef8eCorrect typo in TensorField.__call__

comment:10 Changed 15 months ago by egourgoulhon

I've just noticed a typo in the __call__ method of TensorField, as well as a redundant import in vectorfield_module.py. The above commit corrects this.

comment:11 in reply to: ↑ 8 ; follow-up: Changed 15 months ago by tscrim

Replying to egourgoulhon:

Replying to tscrim:

Do you need to use Sage's Set?

Yes, because I need the method subsets, which does not exist for Python set.

I am pretty sure you can use:

sage: import itertools
sage: list(itertools.combinations([1,2,3], 2))
[(1, 2), (1, 3), (2, 3)]

to iterate over all subsets of a fixed size. (There is also from sage.misc.misc import powerset for an iterator over all subsets.) I don't even think you need to convert the subsets, which are tuples, to Python sets.

comment:12 Changed 15 months ago by git

  • Commit changed from fc4ef8e0eeecf09da501d9816b6ba401c0c2b016 to 18df6e6efdeb307b3c7abdb15fbccfe191dd5901

Branch pushed to git repo; I updated commit sha1. New commits:

18df6e6Use Python's set instead of Sage's Set in the Schouten-Nijenhuis bracket

comment:13 in reply to: ↑ 11 Changed 15 months ago by egourgoulhon

Replying to tscrim:

I am pretty sure you can use:

sage: import itertools
sage: list(itertools.combinations([1,2,3], 2))
[(1, 2), (1, 3), (2, 3)]

to iterate over all subsets of a fixed size. (There is also from sage.misc.misc import powerset for an iterator over all subsets.) I don't even think you need to convert the subsets, which are tuples, to Python sets.

Thanks for the tip. The above commit implements this. I've quickly checked that this is supported by Python 3 as well. Do you confirm?

comment:14 Changed 15 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

Yep, all looks good. Thanks.

comment:15 Changed 15 months ago by egourgoulhon

Thank you very much for the review!

comment:16 Changed 14 months ago by vbraun

  • Branch changed from public/manifolds/multivector_fields to 18df6e6efdeb307b3c7abdb15fbccfe191dd5901
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.