sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.34k stars 453 forks source link

Fix computation of inverse metric on parallelizable manifolds #22667

Closed egourgoulhon closed 7 years ago

egourgoulhon commented 7 years ago

The following is a bug:

sage: S1 = Manifold(1, 'S^1') # the circle
sage: U = S1.open_subset('U') # the complement of one point
sage: Xt.<t> =  U.chart('t:(0,2*pi)') # the standard angle coordinate
sage: V = S1.open_subset('V') # the complement of the point t=pi
sage: Xu.<u> = V.chart('u:(0,2*pi)') # the angle t-pi
sage: S1.declare_union(U, V)
sage: e = S1.vector_frame('e') # a global vector frame (makes S^1 parallelizable)
sage: g = S1.metric('g')
sage: g[e,0,0] = 1
sage: g[[e,0,0]].display()
S^1 --> R
on U: t |--> 1
on V: u |--> 1
sage: g.inverse()[[e,0,0]].display()
S^1 --> R
on U: t |--> 1

The last output should be

S^1 --> R
on U: t |--> 1
on V: u |--> 1

since the component g00 of the inverse metric in the global frame e is the constant scalar field 1, which must have a representation on both open subsets U and V. The current ticket fixes this.

Depends on #22637

CC: @tscrim

Component: geometry

Keywords: metric

Author: Eric Gourgoulhon

Branch/Commit: fc04276

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/22667

egourgoulhon commented 7 years ago

Branch: public/manifolds/bug-inverse-metric-22667

egourgoulhon commented 7 years ago
comment:1

This should be the last of the manifold bug fixes relative to Sage 7.5.1 ;-)


New commits:

96f814dFix treatment of pullback on parallelizable manifolds
6ab5f63Change the name of first argument to 'self' in nested method _pullback_chart of DiffMap
02add83Revert to previous version of nested function _pullback_chart in DiffMap.pullback
d0de237Merge branch 'public/manifolds/bug-pullback-parallelizable' of git://trac.sagemath.org/sage into Sage 7.6.rc0
9a9ee5bFix treatment of restrictions of tensor fields with parallelizable domains
7363815Fix computation of inverse metric on parallelizable manifolds (#22667)
egourgoulhon commented 7 years ago

Commit: 7363815

tscrim commented 7 years ago
comment:2

One little thing: you should put the try/except block on the minimal number of lines as it makes for easier maintenance/debugging. So I think it should just include the assignment of gmat. Otherwise LGTM.

tscrim commented 7 years ago

Reviewer: Travis Scrimshaw

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

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

fc04276Better treatment of exceptions in inverse metric computation
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 7363815 to fc04276

egourgoulhon commented 7 years ago
comment:4

Replying to @tscrim:

One little thing: you should put the try/except block on the minimal number of lines as it makes for easier maintenance/debugging. So I think it should just include the assignment of gmat.

Done (I've also included the computation of the matrix inverse in the try block).

tscrim commented 7 years ago
comment:5

Thanks.

vbraun commented 7 years ago

Changed branch from public/manifolds/bug-inverse-metric-22667 to fc04276