Pullback silently fails in some cases with multiple charts

Reported by: Owned by: Eric Gourgoulhon major sage-9.4 manifolds pullback Travis Scrimshaw, Michael Jung, Matthias Köppe Eric Gourgoulhon Ricardo Buring N/A aea4554 aea4554d90de3a3cb39c0e3704edc0807d8b4109

In Sage 9.3, we have

```sage: E.<x,y> = EuclideanSpace()
sage: polar.<r,ph> = E.polar_coordinates()
sage: g = E.metric()
sage: M = Manifold(1, 'M')
sage: Ct.<t> = M.chart()
sage: F = M.diff_map(E, coord_functions={(Ct, polar): (1 + cos(t), t)})
sage: gM = F.pullback(g)
sage: gM
Field of symmetric bilinear forms on the 1-dimensional differentiable
manifold M
```

So far so good, but

```sage: gM.display()
ValueError: no basis could be found for computing the components in
the Coordinate frame (M, (d/dt)
```

Actually, `gM` has been initialized as a tensor field object, but its components have not been evaluated in any frame:

```sage: gM._components
{}
```

Forcing the coordinate expression of the map `F` in the Cartesian chart (for instance by a call to `F.display()`) fixes the issue:

```sage: F.display()
M --> E^2
t |--> (x, y) = (cos(t)^2 + cos(t), (cos(t) + 1)*sin(t))
t |--> (r, ph) = (cos(t) + 1, t)
sage: gM = F.pullback(g)
sage: gM.display()
(2*cos(t) + 2) dt*dt
```

However, the expression of `F` in Cartesian coordinates should not be required to compute the pullback of `g` since the latter is known in polar coordinates, where `F` has been defined:

```sage: g.display(polar)
g = dr*dr + r^2 dph*dph
```

This bug has been reported at https://ask.sagemath.org/question/57431/

comment:1 Changed 18 months ago by Eric Gourgoulhon

Description: modified (diff)

comment:2 Changed 18 months ago by Eric Gourgoulhon

Description: modified (diff)

comment:3 Changed 18 months ago by Eric Gourgoulhon

Authors: → Eric Gourgoulhon → public/manifolds/pullback_bug-31904 Travis Scrimshaw Michael Jung Matthias Köppe added → 8455aab6a2b5193539aea0a0c783aa02c43e6bfd new → needs_review

New commits:

 ​8455aab `Fix bug #31904 in pullback`

comment:4 Changed 18 months ago by Eric Gourgoulhon

The fix consisted in making the internal function `_pullback_chart` of the method `pullback` to operate for a single pair of charts (now added as arguments), which is determined in the main part of `pullback`, based on the knowledge of the map's coordinate expressions.

comment:5 follow-up:  7 Changed 18 months ago by Ricardo Buring

The `return partial` statement in the parallel code has seemingly accidentally been indented too far.

comment:6 Changed 18 months ago by git

Commit: 8455aab6a2b5193539aea0a0c783aa02c43e6bfd → aea4554d90de3a3cb39c0e3704edc0807d8b4109

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

 ​aea4554 `#31904: Fix indentation in _pullback_chart`

comment:7 in reply to:  5 Changed 18 months ago by Eric Gourgoulhon

The `return partial` statement in the parallel code has seemingly accidentally been indented too far.

Good catch, thanks! (it was not revealed by the parallel doctest because `local_list_ind` had a single element in that case). This is corrected in the above commit (as well as a pyflakes error reported by the patchbot).

comment:8 Changed 18 months ago by Eric Gourgoulhon

Ricardo, do you agree with the last version?

comment:9 Changed 18 months ago by Ricardo Buring

Reviewers: → Ricardo Buring needs_review → positive_review

Yes, looks good now.

Thank you!

comment:11 Changed 18 months ago by Volker Braun

Branch: public/manifolds/pullback_bug-31904 → aea4554d90de3a3cb39c0e3704edc0807d8b4109 → fixed positive_review → closed
Note: See TracTickets for help on using tickets.