Opened 5 months ago

Closed 4 months ago

#31904 closed defect (fixed)

Pullback silently fails in some cases with multiple charts

Reported by: egourgoulhon Owned by:
Priority: major Milestone: sage-9.4
Component: manifolds Keywords: pullback
Cc: tscrim, gh-mjungmath, mkoeppe Merged in:
Authors: Eric Gourgoulhon Reviewers: Ricardo Buring
Report Upstream: N/A Work issues:
Branch: aea4554 (Commits, GitHub, GitLab) Commit: aea4554d90de3a3cb39c0e3704edc0807d8b4109
Dependencies: Stopgaps:

Status badges

Description (last modified by egourgoulhon)

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/

Change History (11)

comment:1 Changed 5 months ago by egourgoulhon

  • Description modified (diff)

comment:2 Changed 5 months ago by egourgoulhon

  • Description modified (diff)

comment:3 Changed 5 months ago by egourgoulhon

  • Authors set to Eric Gourgoulhon
  • Branch set to public/manifolds/pullback_bug-31904
  • Cc tscrim gh-mjungmath mkoeppe added
  • Commit set to 8455aab6a2b5193539aea0a0c783aa02c43e6bfd
  • Status changed from new to needs_review

New commits:

8455aabFix bug #31904 in pullback

comment:4 Changed 5 months ago by egourgoulhon

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: Changed 5 months ago by rburing

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

comment:6 Changed 4 months ago by git

  • Commit changed from 8455aab6a2b5193539aea0a0c783aa02c43e6bfd to 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 4 months ago by egourgoulhon

Replying to rburing:

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 4 months ago by egourgoulhon

Ricardo, do you agree with the last version?

comment:9 Changed 4 months ago by rburing

  • Reviewers set to Ricardo Buring
  • Status changed from needs_review to positive_review

Yes, looks good now.

comment:10 Changed 4 months ago by egourgoulhon

Thank you!

comment:11 Changed 4 months ago by vbraun

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