Opened 15 months ago
Closed 4 months ago
#19823 closed enhancement (fixed)
Schouten, Cotton, and CottonYork tensors of a riemannian metric
Reported by:  pang  Owned by:  pang 

Priority:  major  Milestone:  sage7.5 
Component:  geometry  Keywords:  differentiable manifold, Riemannian metric, Cotton tensor, CottonYork 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 )
Add three methods to class PseudoRiemannianMetric
in order to compute Schouten, Cotton, and CottonYork tensors. This is a followup of #19209 within the SageManifolds project (see the metaticket #18528 for an overview).
Attachments (1)
Change History (43)
Changed 15 months ago by
comment:1 Changed 15 months ago by
 Description modified (diff)
comment:2 Changed 15 months ago by
 Branch set to public/manifolds/Schouten_Cotton_York
 Commit set to 5fa71f72b68b916cbca5b6730c06ecbe1a0d02f4
Last 10 new commits:
8be9a45  Merge branch 'public/manifolds/diff_manif_metrics' of git://trac.sagemath.org/sage into #19147 (affine connections on manifolds with unique representation).

8f0659a  PseudoRiemannian metrics on smooth manifolds without unique representation

cb47399  Merge branch 'diff_manif_connections' into diff_manif_metrics to propagate minor changes in affine connections.

58723e9  Revert to UniqueRepresentation for differentiable manifolds: metric

2918953  Diff. manifolds: metrics, with the change in symbolic expression logic induced by #19312 (Sage 6.10.beta7)

aae566d  Improve parallelization in Components and derived classes

98810df  Diff. manifolds: metrics, with improvements in parallelization of Components

bd5d69f  Merge branch 'public/manifolds/sm0.9' of git://trac.sagemath.org/sage into sagemanifolds

14b7b6c  Merge branch 'develop' of git://github.com/sagemath/sage into sagemanifolds

5fa71f7  Add 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 15 months ago by
 Dependencies set to #19209
comment:4 Changed 15 months ago by
 Description modified (diff)
comment:5 Changed 15 months ago by
 Commit changed from 5fa71f72b68b916cbca5b6730c06ecbe1a0d02f4 to 8d3ba1970060132348b8861b74933a9f4efff08f
Branch pushed to git repo; I updated commit sha1. New commits:
8d3ba19  Modifies doctest that threw a deprecation warning

comment:6 followup: ↓ 9 Changed 15 months ago by
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 15 months ago by
 Status changed from new to needs_review
comment:8 Changed 15 months ago by
 Reviewers set to Eric Gourgoulhon
comment:9 in reply to: ↑ 6 Changed 15 months ago by
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 nontrivial examples have to be at least 3dimensional, 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 15 months ago by
 Commit changed from 8d3ba1970060132348b8861b74933a9f4efff08f to 99edbe55fa1793f1db80c11c129716d96794bd08
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
c01048f  Scalar fields with the simplified hierarchy for manifold classes

c866d6c  Morphisms of topological manifolds with the simplified hierarchy for manifold classes

0e04631  Basics of diff. manifolds with the simplified hierarchy for manifold classes

1f226bd  Tensor fields with the simplified hierarchy for manifold classes

9fa77c4  Tangent spaces with the simplified hierarchy for manifold classes

db58a0c  Curves in diff. manifolds with the simplified hierarchy for manifold classes

0eb9d00  Added parallelization to CompFullyAntiSym.__add__

eb0d8b5  Affine connections with the simplified hierarchy for manifold classes

fb043ff  Metrics on diff. manifolds with the simplified hierarchy for manifold classes

99edbe5  Merge branch 'public/manifolds/diff_manif_metrics' into Schouten_Cotton_York.

comment:11 Changed 15 months ago by
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 followup: ↓ 13 Changed 15 months ago by
 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. methodricci
) and the Ricci scalar should be denoted by 'r', not by 's' (cf. methodricci_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 linecot = nabla(s).antisymmetrize(0,2)
must be replaced bycot = 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 byC_{ijk} = (n2) ( \nabla_k S_{ij}  \nabla_j S_{ik} )
i.e. it differs from your definition by a factor n2, 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 ?
 CottonYork tensor:
Since in the rest of the documentation, $\epsilon$ stands for the LeviCivita
tensor (cf. the method
volume_form
), there should be no $\sqrt{\det g}$ in the LaTeX formula defining the CottonYork tensor. Moreover, the indices seem illplaced; 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 lignecy = cot.contract(0,2,eps,0,1)
must be replaced bycy = (1/2) * eps.contract(0, 1, cot, 2, 1)
Besides, the testif n < 3:
must be replaced byif n != 3:
comment:13 in reply to: ↑ 12 Changed 14 months ago by
It's true, your suggestions are in agreement with the literature.
comment:14 followup: ↓ 15 Changed 14 months ago by
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 14 months ago by
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 14 months ago by
 Commit changed from 99edbe55fa1793f1db80c11c129716d96794bd08 to ceb53cc7060d9a692591d7a5683b6988ff7e53ee
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
b8af25e  Merge branch 'public/manifolds/diff_manif_metrics' of git://trac.sagemath.org/sage into Schouten_Cotton_York

a6aba0e  rename PseudoRiemannianMetric.DERIVED_OBJECTS > PseudoRiemannianMetric._derived_objects

287236a  fix documentation of PseudoRiemannianMetric.schouten (http://trac.sagemath.org/ticket/19823#comment:12)

d5d43ab  fix Cotton tensor, accept http://trac.sagemath.org/ticket/19823#comment:12

accdc70  fix CottonYork tensor, accept http://trac.sagemath.org/ticket/19823#comment:12

8330670  Merge git://trac.sagemath.org/sage into Schouten_Cotton_York

db7b47f  Merge commit '833067007e45133b0004271aac8cbdbdbb99a4f2' into public/manifolds/Schouten_Cotton_York

454949a  fix text fot the cotton_york doctest

c645bd3  minor change in the Cotton formula

ceb53cc  a much shorter example/test for g.schouten

comment:17 Changed 14 months ago by
 Status changed from needs_work to needs_review
comment:18 Changed 14 months ago by
 Commit changed from ceb53cc7060d9a692591d7a5683b6988ff7e53ee to 9c89ed8dbd377d069f57a8c10b33e195ed01ea95
Branch pushed to git repo; I updated commit sha1. New commits:
8e17d54  Merge into the latest version of #18529; improve treatment of composite functions in ExpressionNice

f00be00  Topological manifold morphisms: solved merge conflict with Sage 7.1.beta1

21b3968  Basics of diff. manifolds: solve merge conflict with Sage 7.1.beta1

8ba4b91  Tensor fields: solve merge conflict with Sage 7.1.beta1

2fad9db  Correct doctest in class DiffFormParal

b47f55f  Tangent spaces: solve merge conflict with Sage 7.1.beta1

9a74549  Curves in diff. manifolds: solve merge conflict with Sage 7.1.beta1

ba8ca47  Affine connections: solve merge conflict with Sage 7.1.beta1

7c39bbb  Metrics on diff. manifolds: solve merge conflict with Sage 7.1.beta1

9c89ed8  Schouten and Cotton tensors: solve merge conflict with Sage 7.1.beta1

comment:19 Changed 14 months ago by
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 14 months ago by
 Commit changed from 9c89ed8dbd377d069f57a8c10b33e195ed01ea95 to 57f5fce051d91f89c8a7bc59e1dbafea5dce5f11
Branch pushed to git repo; I updated commit sha1. New commits:
57f5fce  Minor improvements in doc of Schouten and Cotton tensors

comment:21 followup: ↓ 23 Changed 14 months ago by
 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 14 months ago by
 Milestone set to sage7.1
 Priority changed from trivial to major
 Status changed from positive_review to needs_info
Author name please
comment:23 in reply to: ↑ 21 ; followup: ↓ 25 Changed 14 months ago by
comment:24 Changed 14 months ago by
comment:25 in reply to: ↑ 23 Changed 14 months ago by
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.
comment:26 Changed 14 months ago by
Can we set this back to "positive review" ?
comment:27 Changed 14 months ago by
I don't object.
comment:28 Changed 14 months ago by
 Status changed from needs_info to positive_review
comment:29 followup: ↓ 31 Changed 11 months ago by
 Milestone changed from sage7.1 to sage7.2
 Status changed from positive_review to needs_work
Please fix the formatting of the references, see #20496.
comment:30 Changed 11 months ago by
 Commit changed from 57f5fce051d91f89c8a7bc59e1dbafea5dce5f11 to b6b74013e41506a21f5a7e2777b968fc15a61da1
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
d190b37  Morphisms of topological manifolds with coordinate functions as algebra elements

2577fc5  Fixing a (essentially trivial) doctest failure.

7125e29  Python3 format for print in morphims of topological manifolds

bd2f35a  Diff. manifolds with coordinate functions as algebra elements

73b4a03  Tensor fields with with coordinate functions as algebra elements

37521ae  Tangent spaces with coordinate functions as algebra elements

bdb91df  Curves in diff. manifolds with coordinate functions as algebra elements

0250072  Affine connections with coordinate functions as algebra elements

f527408  PseudoRiemannian metrics with coordinate functions as algebra elements

b6b7401  Schouten and Cotton tensors with coordinate functions as algebra elements

comment:31 in reply to: ↑ 29 Changed 11 months ago by
 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 11 months ago by
 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:
cfecb18  Reviewer changes and tweaks for continuous maps ticket.

efcb618  Modify authorship for continuous maps.

84051b0  Merge branch 'public/manifolds/diff_manif_basics' of trac.sagemath.org:sage into public/manifolds/diff_manif_basics

97172dd  Basics of differentiable manifolds with changes in morphisms of topological manifolds

29832ec  Use @cached_method for VectorFieldModule.identity_map() and AutomorphismFieldGroup.one()

159afb4  Tangent spaces upon latest version of tensor fields

1b79561  Update of OpenInterval._Hom_

aa552cb  Affine connections on the latest #19124

a34b35d  PseudoRiemannian metrics on the latest #19147

39a1325  Schouten and Cotton tensors on the latest #19209

comment:33 Changed 11 months ago by
 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 8 months ago by
 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:
3b1b794  Fix doctests in tangent spaces after the merge of #20770 in sage 7.3.beta3

c70792e  Update tangent spaces to the latest version of #18843 (vector fields)

0d6f47e  Merge branch 'public/manifolds/diff_manif_tangent_spaces' of trac.sagemath.org:sage into public/manifolds/lie_algebras20771

96f09ab  Added information about the vector field module being a Lie algebroid.

72396dd  Merge with latest #19092 to fix doctests after the merge of #20770 in sage 7.3.beta3

835b293  Update Lie algebroids to the latest version of #18843 (vector fields)

edde604  Update curves to the latest version of #18843 (vector fields)

e8e433c  Update affine connections to the latest version of #18843 (vector fields)

61e3791  Update metrics to the latest version of vector fields (#18843)

7dac1ad  Update of Schouten and Cotton tensors to the latest #18843 (vector fields)

comment:35 Changed 8 months ago by
 Milestone changed from sage7.2 to sage7.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 5 months ago by
 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:
785300b  Bibliographic references for tangent spaces moved to the master file created by #21454

a5ab39a  Update Lie algebroids to the latest version of the dependency ticket #19092

6af8ad2  Bibliographic references for vector field modules as Lie algebroids moved to the master file created by #21454

cd27531  Update curves to the latest version of the dependency ticket #19092

cdb3f28  Bibliographic references for curves on manifolds moved to the master file created by #21454

21b468f  Update affine connections to the latest version of the dependency ticket #19092

2113197  Bibliographic references for affine connections moved to the master file created by #21454

41c027f  Update metrics to the latest version of the dependency ticket (#19147) + Py3 preparation

f5dd9d5  Bibliographic references for pseudoRiemannian metrics moved to the master file created by #21454

a641f90  Bibliographic references for Schouten and Cotton tensors moved to the master file created by #21454

comment:37 Changed 5 months ago by
 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 4 months ago by
 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:
906c030  Update affine connections to the latest version of the dependency ticket #19092

c622eb9  Update metrics on manifolds to the latest version of the dependency ticket #19147

178c1ca  Update Schouten and Cotton tensors to the latest version of the dependency ticket #19209

comment:39 Changed 4 months ago by
 Milestone changed from sage7.4 to sage7.5
 Status changed from needs_review to positive_review
 Summary changed from Addcode for computation of the Schouten, Cotton, and CottonYork tensors of a riemannian metric to Schouten, Cotton, and CottonYork 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 4 months ago by
 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:
fdd9051  Fix the treatment of bases initialization in tangent space construction

comment:41 Changed 4 months ago by
 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 4 months ago by
 Branch changed from public/manifolds/Schouten_Cotton_York to fdd905151a9cc9705bf0f8066507f20157d949b8
 Resolution set to fixed
 Status changed from positive_review to closed
First draft