Opened 5 years ago

Closed 5 years ago

# Fix computation of inverse metric on parallelizable manifolds

Reported by: Owned by: egourgoulhon major sage-8.0 geometry metric, manifold tscrim Eric Gourgoulhon Travis Scrimshaw N/A fc04276 fc042765144026ad59876ad8680f538c6e274ebc #22637

### Description

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.

### comment:1 Changed 5 years ago by egourgoulhon

• Branch set to public/manifolds/bug-inverse-metric-22667
• Cc tscrim added
• Commit set to 73638157694451c7bebc4575b38aa525c457b9ab
• Status changed from new to needs_review

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

New commits:

 ​96f814d `Fix treatment of pullback on parallelizable manifolds` ​6ab5f63 `Change the name of first argument to 'self' in nested method _pullback_chart of DiffMap` ​02add83 `Revert to previous version of nested function _pullback_chart in DiffMap.pullback` ​d0de237 `Merge branch 'public/manifolds/bug-pullback-parallelizable' of git://trac.sagemath.org/sage into Sage 7.6.rc0` ​9a9ee5b `Fix treatment of restrictions of tensor fields with parallelizable domains` ​7363815 `Fix computation of inverse metric on parallelizable manifolds (#22667)`

### comment:2 follow-up: ↓ 4 Changed 5 years ago by tscrim

• Reviewers set to Travis Scrimshaw

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.

### comment:3 Changed 5 years ago by git

• Commit changed from 73638157694451c7bebc4575b38aa525c457b9ab to fc042765144026ad59876ad8680f538c6e274ebc

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

 ​fc04276 `Better treatment of exceptions in inverse metric computation`

### comment:4 in reply to: ↑ 2 Changed 5 years ago by egourgoulhon

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).

### comment:5 Changed 5 years ago by tscrim

• Status changed from needs_review to positive_review

Thanks.

### comment:6 Changed 5 years ago by vbraun

• Branch changed from public/manifolds/bug-inverse-metric-22667 to fc042765144026ad59876ad8680f538c6e274ebc
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.