Opened 18 months ago

Closed 7 months ago

#19823 closed enhancement (fixed)

Schouten, Cotton, and Cotton-York tensors of a riemannian metric

Reported by: pang Owned by: pang
Priority: major Milestone: sage-7.5
Component: geometry Keywords: differentiable manifold, Riemannian metric, Cotton tensor, Cotton-York tensor, Schouten tensor
Cc: egourgoulhon, mbejger, mmancini Merged in:
Authors: Pablo Angulo Reviewers: Eric Gourgoulhon
Report Upstream: N/A Work issues:
Branch: fdd9051 (Commits) Commit: fdd905151a9cc9705bf0f8066507f20157d949b8
Dependencies: #19209 Stopgaps:

Description (last modified by egourgoulhon)

Add three methods to class PseudoRiemannianMetric in order to compute Schouten, Cotton, and Cotton-York tensors. This is a follow-up of #19209 within the SageManifolds project (see the metaticket #18528 for an overview).

Attachments (1)

cotton.patch (10.4 KB) - added by pang 18 months ago.
First draft

Download all attachments as: .zip

Change History (43)

Changed 18 months ago by pang

First draft

comment:1 Changed 18 months ago by pang

  • Description modified (diff)

comment:2 Changed 18 months ago by pang

  • Branch set to public/manifolds/Schouten_Cotton_York
  • Commit set to 5fa71f72b68b916cbca5b6730c06ecbe1a0d02f4

Last 10 new commits:

8be9a45Merge branch 'public/manifolds/diff_manif_metrics' of git://trac.sagemath.org/sage into #19147 (affine connections on manifolds with unique representation).
8f0659aPseudo-Riemannian metrics on smooth manifolds without unique representation
cb47399Merge branch 'diff_manif_connections' into diff_manif_metrics to propagate minor changes in affine connections.
58723e9Revert to UniqueRepresentation for differentiable manifolds: metric
2918953Diff. manifolds: metrics, with the change in symbolic expression logic induced by #19312 (Sage 6.10.beta7)
aae566dImprove parallelization in Components and derived classes
98810dfDiff. manifolds: metrics, with improvements in parallelization of Components
bd5d69fMerge branch 'public/manifolds/sm-0.9' of git://trac.sagemath.org/sage into sagemanifolds
14b7b6cMerge branch 'develop' of git://github.com/sagemath/sage into sagemanifolds
5fa71f7Add three methods schouten, cotton, cotton_york, toghether with internal variables self._schouten, self._cotton, self._cotton_york that work analogously to the method self.ricci or self.ricci_scalar

comment:3 Changed 18 months ago by pang

  • Dependencies set to #19209

comment:4 Changed 18 months ago by pang

  • Description modified (diff)

comment:5 Changed 18 months ago by git

  • Commit changed from 5fa71f72b68b916cbca5b6730c06ecbe1a0d02f4 to 8d3ba1970060132348b8861b74933a9f4efff08f

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

8d3ba19Modifies doctest that threw a deprecation warning

comment:6 follow-up: Changed 18 months ago by pang

The tests take really long to run on my (rather old) laptop. I can't come up with examples that are meaningful and take less than 5 seconds to compute. How should I proceed?

comment:7 Changed 18 months ago by pang

  • Status changed from new to needs_review

comment:8 Changed 18 months ago by egourgoulhon

  • Reviewers set to Eric Gourgoulhon

comment:9 in reply to: ↑ 6 Changed 18 months ago by egourgoulhon

Replying to pang:

The tests take really long to run on my (rather old) laptop. I can't come up with examples that are meaningful and take less than 5 seconds to compute. How should I proceed?

Since the minimal non-trivial examples have to be at least 3-dimensional, it seems quite difficult to shorten signifcantly your examples. Moreover, the time taken by them (around 10 to 20 s for each of the 3 tensors) is similar to that taken in other parts of SageManifolds, e.g. in affine connections (ticket #19147). So for the moment, I would leave it as it is...

comment:10 Changed 18 months ago by git

  • Commit changed from 8d3ba1970060132348b8861b74933a9f4efff08f to 99edbe55fa1793f1db80c11c129716d96794bd08

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

c01048fScalar fields with the simplified hierarchy for manifold classes
c866d6cMorphisms of topological manifolds with the simplified hierarchy for manifold classes
0e04631Basics of diff. manifolds with the simplified hierarchy for manifold classes
1f226bdTensor fields with the simplified hierarchy for manifold classes
9fa77c4Tangent spaces with the simplified hierarchy for manifold classes
db58a0cCurves in diff. manifolds with the simplified hierarchy for manifold classes
0eb9d00Added parallelization to CompFullyAntiSym.__add__
eb0d8b5Affine connections with the simplified hierarchy for manifold classes
fb043ffMetrics on diff. manifolds with the simplified hierarchy for manifold classes
99edbe5Merge branch 'public/manifolds/diff_manif_metrics' into Schouten_Cotton_York.

comment:11 Changed 18 months ago by egourgoulhon

In the above commit, I have simply merge the latest version of the dependency ticket #19209 (updated today) into the branch of this ticket. There is no change in your code.

comment:12 follow-up: Changed 18 months ago by egourgoulhon

  • Status changed from needs_review to needs_work

The introduction of a class attribute for the derived objects is a good idea! However, I would suggest that its name is changed from DERIVED_OBJECTS to _derived_objects. Indeed, it seems that in Sage, capital letters are not used for attributes. Moreover, the heading underscore indicates a "private" attribute, not exposed to a tab search. Otherwise, a user searching for some derivative via g.der + TAB, might find this attribute.

Here are some remarks about each of the three tensors:

  • Schouten tensor: The LaTeX formula defining the Schouten tensor in the documentation should use the same notations than in the rest of the documentation of class PseudoRiemannianMetric: Ricci should be denoted by 'Ric' (cf. method ricci) and the Ricci scalar should be denoted by 'r', not by 's' (cf. method ricci_scalar)
  • Cotton tensor: The LaTeX formula defining the Cotton tensor in the documentation is not correct: it should be
     C_{ijk} = \nabla_k S_{ij} - \nabla_j S_{ik}
    
    (the Cotton tensor is antisymmetric in its last two indices). Besides, in the code, the line
    cot = nabla(s).antisymmetrize(0,2)
    
    must be replaced by
    cot = 2 * nabla(s).antisymmetrize(1,2)
    
    Indeed, the convention for the index positions of a covariant derivative is (nabla(s))_{ijk} = \nabla_k s_{ij}, i.e. the derivation index is the last one, cf. the note at http://sagemanifolds.obspm.fr/doc/19209/reference/manifolds/sage/manifolds/differentiable/affine_connection.html . Note also the factor 2 to compensate for the 1/2 factor introduced by the antisymmetrization. Besides, I have the impression that in the literature, the Cotton tensor is generaly defined by
    C_{ijk} = (n-2) ( \nabla_k S_{ij} - \nabla_j S_{ik} )
    
    i.e. it differs from your definition by a factor n-2, cf. for instance https://en.wikipedia.org/wiki/Cotton_tensor. Of course in dimension 3, both definitions coincide, but could you please check the literature for n > 3 ?
  • Cotton-York tensor: Since in the rest of the documentation, $\epsilon$ stands for the Levi-Civita tensor (cf. the method volume_form), there should be no $\sqrt{\det g}$ in the LaTeX formula defining the Cotton-York tensor. Moreover, the indices seem ill-placed; the correct formula is (cf. Eq. (4) in York's paper, Phys. Rev. Lett. 26, 1656 (1971) or https://en.wikipedia.org/wiki/Cotton_tensor)
     CY_{ij} = \frac{1}{2} \epsilon^{kl}_{\quad i} C_{jlk} 
             = \epsilon^{kl}_{\quad i} \nabla_k S_{lj}
    
    Accordingly, in the code, the ligne
    cy = -cot.contract(0,2,eps,0,1)
    
    must be replaced by
    cy = (1/2) * eps.contract(0, 1, cot, 2, 1)
    
    Besides, the test
     if n < 3:
    
    must be replaced by
     if n != 3:
    

comment:13 in reply to: ↑ 12 Changed 17 months ago by pang

It's true, your suggestions are in agreement with the literature.

comment:14 follow-up: Changed 17 months ago by pang

One minor thing. I realized it is not possible to change the name of the tensor after the first call. Is this relevant? Should I consider this with respect to the #19209?

comment:15 in reply to: ↑ 14 Changed 17 months ago by egourgoulhon

Replying to pang:

One minor thing. I realized it is not possible to change the name of the tensor after the first call.

Can't you change the name by means of the method set_name ?

comment:16 Changed 17 months ago by git

  • Commit changed from 99edbe55fa1793f1db80c11c129716d96794bd08 to ceb53cc7060d9a692591d7a5683b6988ff7e53ee

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

b8af25eMerge branch 'public/manifolds/diff_manif_metrics' of git://trac.sagemath.org/sage into Schouten_Cotton_York
a6aba0erename PseudoRiemannianMetric.DERIVED_OBJECTS -> PseudoRiemannianMetric._derived_objects
287236afix documentation of PseudoRiemannianMetric.schouten (http://trac.sagemath.org/ticket/19823#comment:12)
d5d43abfix Cotton tensor, accept http://trac.sagemath.org/ticket/19823#comment:12
accdc70fix Cotton-York tensor, accept http://trac.sagemath.org/ticket/19823#comment:12
8330670Merge git://trac.sagemath.org/sage into Schouten_Cotton_York
db7b47fMerge commit '833067007e45133b0004271aac8cbdbdbb99a4f2' into public/manifolds/Schouten_Cotton_York
454949afix text fot the cotton_york doctest
c645bd3minor change in the Cotton formula
ceb53cca much shorter example/test for g.schouten

comment:17 Changed 17 months ago by pang

  • Status changed from needs_work to needs_review

comment:18 Changed 17 months ago by git

  • Commit changed from ceb53cc7060d9a692591d7a5683b6988ff7e53ee to 9c89ed8dbd377d069f57a8c10b33e195ed01ea95

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

8e17d54Merge into the latest version of #18529; improve treatment of composite functions in ExpressionNice
f00be00Topological manifold morphisms: solved merge conflict with Sage 7.1.beta1
21b3968Basics of diff. manifolds: solve merge conflict with Sage 7.1.beta1
8ba4b91Tensor fields: solve merge conflict with Sage 7.1.beta1
2fad9dbCorrect doctest in class DiffFormParal
b47f55fTangent spaces: solve merge conflict with Sage 7.1.beta1
9a74549Curves in diff. manifolds: solve merge conflict with Sage 7.1.beta1
ba8ca47Affine connections: solve merge conflict with Sage 7.1.beta1
7c39bbbMetrics on diff. manifolds: solve merge conflict with Sage 7.1.beta1
9c89ed8Schouten and Cotton tensors: solve merge conflict with Sage 7.1.beta1

comment:19 Changed 17 months ago by egourgoulhon

The above commit is merely to solve a merge conflict with Sage 7.1.beta1 (there is no change in your code). This conflict was due to the merge of the latest version of #18529 into Sage 7.1.beta1.

comment:20 Changed 17 months ago by git

  • Commit changed from 9c89ed8dbd377d069f57a8c10b33e195ed01ea95 to 57f5fce051d91f89c8a7bc59e1dbafea5dce5f11

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

57f5fceMinor improvements in doc of Schouten and Cotton tensors

comment:21 follow-up: Changed 17 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

Thanks for your work on this! Your code is very nice. I am setting the ticket to 'positive review', but the merge in main Sage will have to wait for the merge of the dependency ticket #19209.

comment:22 Changed 17 months ago by jdemeyer

  • Authors pang deleted
  • Milestone set to sage-7.1
  • Priority changed from trivial to major
  • Status changed from positive_review to needs_info

Author name please

comment:23 in reply to: ↑ 21 ; follow-up: Changed 17 months ago by jdemeyer

Replying to egourgoulhon:

the merge in main Sage will have to wait for the merge of the dependency ticket #19209.

...and #18640 and #18725 and #18783 and #18843 and #19092 and #19147. Such a deep dependency tree is scary.

comment:24 Changed 17 months ago by egourgoulhon

  • Authors set to Pablo Angulo

comment:25 in reply to: ↑ 23 Changed 17 months ago by egourgoulhon

Replying to jdemeyer:

Replying to egourgoulhon:

the merge in main Sage will have to wait for the merge of the dependency ticket #19209.

...and #18640 and #18725 and #18783 and #18843 and #19092 and #19147.

Yes, each ticket depends on the preceding one.

Such a deep dependency tree is scary.

This results from the split of SageManifolds into small tickets, to ease the review process. Note that the dependency tree is linear: each ticket depends only on the preceding one, the top being now #18640. The full tree is sketched on the metaticket #18528.

Last edited 17 months ago by egourgoulhon (previous) (diff)

comment:26 Changed 17 months ago by egourgoulhon

Can we set this back to "positive review" ?

comment:27 Changed 17 months ago by jdemeyer

I don't object.

comment:28 Changed 17 months ago by jdemeyer

  • Status changed from needs_info to positive_review

comment:29 follow-up: Changed 14 months ago by jdemeyer

  • Milestone changed from sage-7.1 to sage-7.2
  • Status changed from positive_review to needs_work

Please fix the formatting of the references, see #20496.

comment:30 Changed 14 months ago by git

  • Commit changed from 57f5fce051d91f89c8a7bc59e1dbafea5dce5f11 to b6b74013e41506a21f5a7e2777b968fc15a61da1

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

d190b37Morphisms of topological manifolds with coordinate functions as algebra elements
2577fc5Fixing a (essentially trivial) doctest failure.
7125e29Python3 format for print in morphims of topological manifolds
bd2f35aDiff. manifolds with coordinate functions as algebra elements
73b4a03Tensor fields with with coordinate functions as algebra elements
37521aeTangent spaces with coordinate functions as algebra elements
bdb91dfCurves in diff. manifolds with coordinate functions as algebra elements
0250072Affine connections with coordinate functions as algebra elements
f527408Pseudo-Riemannian metrics with coordinate functions as algebra elements
b6b7401Schouten and Cotton tensors with coordinate functions as algebra elements

comment:31 in reply to: ↑ 29 Changed 14 months ago by egourgoulhon

  • Status changed from needs_work to positive_review

Replying to jdemeyer:

Please fix the formatting of the references, see #20496.

This is done in the latest commit, along with some updates to take into account changes in #18640. I am therefore setting the ticket back to positive review, with the understanding that it can be merged in Sage only after the dependency #19209 has been merged.

comment:32 Changed 14 months ago by git

  • Commit changed from b6b74013e41506a21f5a7e2777b968fc15a61da1 to 39a1325b17cdd62f6c1a1d5240af3855d9ff7dda
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. Last 10 new commits:

cfecb18Reviewer changes and tweaks for continuous maps ticket.
efcb618Modify authorship for continuous maps.
84051b0Merge branch 'public/manifolds/diff_manif_basics' of trac.sagemath.org:sage into public/manifolds/diff_manif_basics
97172ddBasics of differentiable manifolds with changes in morphisms of topological manifolds
29832ecUse @cached_method for VectorFieldModule.identity_map() and AutomorphismFieldGroup.one()
159afb4Tangent spaces upon latest version of tensor fields
1b79561Update of OpenInterval._Hom_
aa552cbAffine connections on the latest #19124
a34b35dPseudo-Riemannian metrics on the latest #19147
39a1325Schouten and Cotton tensors on the latest #19209

comment:33 Changed 14 months ago by egourgoulhon

  • Description modified (diff)
  • Status changed from needs_review to positive_review

The above commit is just an update taking into account changes in the preceding tickets.

comment:34 Changed 10 months ago by git

  • Commit changed from 39a1325b17cdd62f6c1a1d5240af3855d9ff7dda to 7dac1adf35a3ade4bfb2cef1e14a76a93398945f
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. Last 10 new commits:

3b1b794Fix doctests in tangent spaces after the merge of #20770 in sage 7.3.beta3
c70792eUpdate tangent spaces to the latest version of #18843 (vector fields)
0d6f47eMerge branch 'public/manifolds/diff_manif_tangent_spaces' of trac.sagemath.org:sage into public/manifolds/lie_algebras-20771
96f09abAdded information about the vector field module being a Lie algebroid.
72396ddMerge with latest #19092 to fix doctests after the merge of #20770 in sage 7.3.beta3
835b293Update Lie algebroids to the latest version of #18843 (vector fields)
edde604Update curves to the latest version of #18843 (vector fields)
e8e433cUpdate affine connections to the latest version of #18843 (vector fields)
61e3791Update metrics to the latest version of vector fields (#18843)
7dac1adUpdate of Schouten and Cotton tensors to the latest #18843 (vector fields)

comment:35 Changed 10 months ago by egourgoulhon

  • Milestone changed from sage-7.2 to sage-7.4
  • Status changed from needs_review to positive_review

Back to positive review since the update merely progates changes in the preceding tickets.

comment:36 Changed 8 months ago by git

  • Commit changed from 7dac1adf35a3ade4bfb2cef1e14a76a93398945f to a641f90aa09ee34188eb2ac1582774f0e82fcc65
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. Last 10 new commits:

785300bBibliographic references for tangent spaces moved to the master file created by #21454
a5ab39aUpdate Lie algebroids to the latest version of the dependency ticket #19092
6af8ad2Bibliographic references for vector field modules as Lie algebroids moved to the master file created by #21454
cd27531Update curves to the latest version of the dependency ticket #19092
cdb3f28Bibliographic references for curves on manifolds moved to the master file created by #21454
21b468fUpdate affine connections to the latest version of the dependency ticket #19092
2113197Bibliographic references for affine connections moved to the master file created by #21454
41c027fUpdate metrics to the latest version of the dependency ticket (#19147) + Py3 preparation
f5dd9d5Bibliographic references for pseudo-Riemannian metrics moved to the master file created by #21454
a641f90Bibliographic references for Schouten and Cotton tensors moved to the master file created by #21454

comment:37 Changed 8 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

Setting back to positive review, since the latest commit simply solves a merge conflict with #21454.

comment:38 Changed 7 months ago by git

  • Commit changed from a641f90aa09ee34188eb2ac1582774f0e82fcc65 to 178c1ca814ef7c5184e0c851a175271be1e34144
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

906c030Update affine connections to the latest version of the dependency ticket #19092
c622eb9Update metrics on manifolds to the latest version of the dependency ticket #19147
178c1caUpdate Schouten and Cotton tensors to the latest version of the dependency ticket #19209

comment:39 Changed 7 months ago by egourgoulhon

  • Milestone changed from sage-7.4 to sage-7.5
  • Status changed from needs_review to positive_review
  • Summary changed from Addcode for computation of the Schouten, Cotton, and Cotton-York tensors of a riemannian metric to Schouten, Cotton, and Cotton-York tensors of a riemannian metric

Setting back to positive review, since the latest commit merely solves a trivial merge conflict with Sage 7.5.beta3.

comment:40 Changed 7 months ago by git

  • Commit changed from 178c1ca814ef7c5184e0c851a175271be1e34144 to fdd905151a9cc9705bf0f8066507f20157d949b8
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

fdd9051Fix the treatment of bases initialization in tangent space construction

comment:41 Changed 7 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

Setting back to positive review since the latest commit is a trivial fix of some uncommon case in tangent space construction.

comment:42 Changed 7 months ago by vbraun

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