sagemath / sage

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

Refine categories of Chart objects, add method codomain #31894

Open mkoeppe opened 3 years ago

mkoeppe commented 3 years ago

Currently:

sage: M = Manifold(2, 'R^2', structure='topological')
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
sage: c_cart.category()
Category of objects

A Chart instance (with non-periodic coordinates) is a continuous map from its domain to R^n. This should be reflected in the category.

With this ticket:

sage: M = Manifold(2, 'R^2', structure='topological') 
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2 
sage: c_cart.category() 
Category of elements of 
 Set of Morphisms 
  from 2-dimensional topological manifold R^2 
  to Vector space of dimension 2 over Real Field with 53 bits of precision 
  in Category of sets

Also:

sage: M = Manifold(2, 'M', field='complex', structure='topological') 
sage: X.<x,y> = M.chart(coord_restrictions=lambda x,y: [abs(x)<1, y!=0]) 
sage: X.codomain()                                                                                                                                                                                   
{ (x, y) ∈ Vector space of dimension 2 over Complex Field with 53 bits of precision : abs(x) < 1, y != 0 }

To put the map in a better category than Sets will need some follow-up tickets.

Depends on #32009 Depends on #32116 Depends on #32089 Depends on #32102 Depends on #25644

CC: @egourgoulhon @tscrim @mjungmath

Component: manifolds

Author: Matthias Koeppe

Branch/Commit: u/mkoeppe/refine_categories_of_chart_objects__add_method_codomain @ 89039b2

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

mkoeppe commented 3 years ago
comment:42

Should ManifoldPoint.add_coordinates canonicalize the coordinates? Or should ManifoldPoint.coordinates do this?

mjungmath commented 3 years ago
comment:45

Replying to @egourgoulhon:

Just a word of context about periodic charts: they have been introduced because they are useful when computing a geodesic with some numerical integrator. Typically, when the geodesic is an orbit around some center, the azimuthal coordinate returned by the integrator increases without any bound, instead of being confined to [0, 2\pi). Here are some examples in Kerr spacetime.

I'm sorry. What is the punchline here?

mjungmath commented 3 years ago
comment:46

Just forget what I just said. It didn't make sense. Sorry.

mjungmath commented 3 years ago
comment:47

Replying to @egourgoulhon:

W.l.o.g. we can always choose the minimum/maximum the chart maps to?

What do you mean?

What we can do is that the user has to state the fundamental domain (which currently happens up to boundary only). Or we provide which boundary component belongs to the fundamental domain (I opt for the lower bound). Then it is clear which points the section map has to map to.

For the 1-sphere this could be for example the clopen interval [-pi,pi). Then it becomes clear that the point on the 1-sphere determined by pi is mapped to -pi via the (section) chart. Similarly then for any other point.

The only obstruction I see right now is that the symbolic ring doesn't provide any modulo operation in the spirit of x - y*floor(x/y). Or does it?

mkoeppe commented 3 years ago
comment:48

Replying to @mjungmath:

the symbolic ring doesn't provide any modulo operation in the spirit of x - y*floor(x/y).

That's right - this is #25644

mkoeppe commented 3 years ago
comment:49

Setting a new milestone for this ticket based on a cursory review.

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

Changed commit from c21f884 to 89039b2

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

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

ea08261Merge #32009
3d1c44dMerge tag '9.4.beta5' into t/32116/chart__parse_coordinates
cf3abdaMerge #32116
c218828Merge #32116
89039b2Merge #32102
egourgoulhon commented 3 years ago
comment:51

Replying to @mjungmath:

Replying to @egourgoulhon:

Just a word of context about periodic charts: they have been introduced because they are useful when computing a geodesic with some numerical integrator. Typically, when the geodesic is an orbit around some center, the azimuthal coordinate returned by the integrator increases without any bound, instead of being confined to [0, 2\pi). Here are some examples in Kerr spacetime.

I'm sorry. What is the punchline here?

Periodic charts are useful in practice. Otherwise, we could have lived without them, sticking to the standard definition of a chart on a manifold.

mjungmath commented 3 years ago
comment:52

I guess then, this ticket depends on #25644...

mjungmath commented 3 years ago

Changed dependencies from #32009, #32116, #32089, #32102 to #32009, #32116, #32089, #32102, #25644

mjungmath commented 3 years ago
comment:54

Replying to @egourgoulhon:

I'm sorry. What is the punchline here?

Periodic charts are useful in practice. Otherwise, we could have lived without them, sticking to the standard definition of a chart on a manifold.

Thank you. It's clear now. It was my fault yesterday...