Sage: Ticket #30714: Tensor Arithmetics on Minimal Amount of Domains
https://trac.sagemath.org/ticket/30714
<p>
If I get the code correctly, operations between two tensor fields on non-parallelizable manifolds are performed as follows:
</p>
<ol><li>get common domains from the <code>_restrictions</code> dictionary,
</li><li>perform the corresponding operation on each of those domains.
</li></ol><p>
However, in most cases not all domains are necessary to fully determine the result. It is enough to find a minimal set of common domains which cover the manifold and perform the computation on those. The wanted restrictions of the result can then be computed on demand.
</p>
<p>
Allow me an example:
</p>
<pre class="wiki">sage: M = Manifold(2, 'S^2') # the 2-dimensional sphere S^2
sage: U = M.open_subset('U') # complement of the North pole
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
sage: V = M.open_subset('V') # complement of the South pole
sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole
sage: M.declare_union(U,V) # S^2 is the union of U and V
sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)),
....: intersection_name='W',
....: restrictions1=x^2+y^2!=0,
....: restrictions2=u^2+v^2!=0)
sage: uv_to_xy = xy_to_uv.inverse()
sage: W = U.intersection(V)
sage: eU = c_xy.frame()
sage: eV = c_uv.frame()
sage: v = M.vector_field(name='v')
sage: v[eU,:] = [1, -2]
sage: v.add_comp_by_continuation(eV, W, chart=c_uv)
sage: v._restrictions
{Open subset U of the 2-dimensional differentiable manifold S^2: Vector field v on the Open subset U of the 2-dimensional differentiable manifold S^2,
Open subset W of the 2-dimensional differentiable manifold S^2: Vector field v on the Open subset W of the 2-dimensional differentiable manifold S^2,
Open subset V of the 2-dimensional differentiable manifold S^2: Vector field v on the Open subset V of the 2-dimensional differentiable manifold S^2}
</pre><p>
Now, if you add <code>v</code> and another vector field defined similarly, the addition would be performed on <code>U</code>, <code>V</code> and <code>W</code>. Even though the computation on <code>W</code> is not necessary.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/30714
Trac 1.2Matthias KöppeSat, 03 Oct 2020 22:54:44 GMT
https://trac.sagemath.org/ticket/30714#comment:1
https://trac.sagemath.org/ticket/30714#comment:1
<p>
This is an NP-hard optimization problem.
</p>
TicketEric GourgoulhonSun, 04 Oct 2020 08:04:10 GMT
https://trac.sagemath.org/ticket/30714#comment:2
https://trac.sagemath.org/ticket/30714#comment:2
<p>
Maybe one shall introduce the concept of "top restrictions", i.e. restrictions that are not restrictions of a larger restriction on a parallelizable domain (there are already similar concepts in <code>TopologicalManifold._top_charts</code> and <code>DifferentiableManifold._top_frames</code>). Then the method <code>TensorField._common_subdomains()</code>, which is invoked by <code>_add_()</code>, could deal only with these top restrictions.
</p>
TicketMichael JungSun, 04 Oct 2020 08:26:58 GMT
https://trac.sagemath.org/ticket/30714#comment:3
https://trac.sagemath.org/ticket/30714#comment:3
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/30714#comment:1" title="Comment 1">mkoeppe</a>:
</p>
<blockquote class="citation">
<p>
This is an NP-hard optimization problem.
</p>
</blockquote>
<p>
I'm sorry, I don't know what you mean. Can you explain please?
</p>
TicketMichael JungSun, 04 Oct 2020 08:45:53 GMT
https://trac.sagemath.org/ticket/30714#comment:4
https://trac.sagemath.org/ticket/30714#comment:4
<p>
Just for the records, I have introduced a method called <code>_get_min_covering</code> for characteristic forms and orientations (you can find it in <code>manifold.py</code>), which returns the minimal amount of objects necessary to cover the manifold. Maybe this is something we can use? I don't know how speedy it is compared to the computational cost we might save.
</p>
TicketMichael JungSun, 04 Oct 2020 08:50:22 GMT
https://trac.sagemath.org/ticket/30714#comment:5
https://trac.sagemath.org/ticket/30714#comment:5
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/30714#comment:2" title="Comment 2">egourgoulhon</a>:
</p>
<blockquote class="citation">
<p>
Maybe one shall introduce the concept of "top restrictions", i.e. restrictions that are not restrictions of a larger restriction on a parallelizable domain (there are already similar concepts in <code>TopologicalManifold._top_charts</code> and <code>DifferentiableManifold._top_frames</code>). Then the method <code>TensorField._common_subdomains()</code>, which is invoked by <code>_add_()</code>, could deal only with these top restrictions.
</p>
</blockquote>
<p>
This sounds like a great idea to me. I'm eager to hear what Matthias and Travis think about it.
</p>
TicketMatthias KöppeSat, 24 Oct 2020 20:15:01 GMTmilestone changed
https://trac.sagemath.org/ticket/30714#comment:6
https://trac.sagemath.org/ticket/30714#comment:6
<ul>
<li><strong>milestone</strong>
changed from <em>sage-9.2</em> to <em>sage-9.3</em>
</li>
</ul>
TicketMatthias KöppeSat, 13 Feb 2021 20:51:01 GMTmilestone changed
https://trac.sagemath.org/ticket/30714#comment:7
https://trac.sagemath.org/ticket/30714#comment:7
<ul>
<li><strong>milestone</strong>
changed from <em>sage-9.3</em> to <em>sage-9.4</em>
</li>
</ul>
<p>
Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
</p>
TicketMichael JungSat, 01 May 2021 10:17:13 GMT
https://trac.sagemath.org/ticket/30714#comment:8
https://trac.sagemath.org/ticket/30714#comment:8
<p>
Possibly related: <a class="new ticket" href="https://trac.sagemath.org/ticket/31740" title="#31740: task: Meta-ticket: Families, posets, complexes of manifold subsets (new)">#31740</a>, <a class="needs_info ticket" href="https://trac.sagemath.org/ticket/31703" title="#31703: enhancement: Sheaves on manifolds (needs_info)">#31703</a>.
</p>
TicketMichael JungSat, 01 May 2021 10:18:23 GMTcc changed
https://trac.sagemath.org/ticket/30714#comment:9
https://trac.sagemath.org/ticket/30714#comment:9
<ul>
<li><strong>cc</strong>
<em>Matthias Köppe</em> added
</li>
</ul>
TicketMatthias KöppeMon, 03 May 2021 15:35:45 GMT
https://trac.sagemath.org/ticket/30714#comment:10
https://trac.sagemath.org/ticket/30714#comment:10
<p>
A first step in line with <a class="new ticket" href="https://trac.sagemath.org/ticket/31740" title="#31740: task: Meta-ticket: Families, posets, complexes of manifold subsets (new)">#31740</a> could be to introduce methods <code>TensorField.restriction_digraph</code>, <code>.restriction_poset</code> etc. in analogy to <code>ManifoldSubset.subset_{digraph,subset}</code> (most recent version in <a class="closed ticket" href="https://trac.sagemath.org/ticket/31736" title="#31736: enhancement: ManifoldSubset: New methods declare_equal, equal_subsets, ... (closed: fixed)">#31736</a>).
A generator of the top elements of the poset then comes for free - see <a class="new ticket" href="https://trac.sagemath.org/ticket/31766" title="#31766: enhancement: ManifoldSubset: Replace use of _top_subsets by a generator (new)">#31766</a>.
</p>
TicketMichael JungMon, 03 May 2021 15:45:24 GMT
https://trac.sagemath.org/ticket/30714#comment:11
https://trac.sagemath.org/ticket/30714#comment:11
<p>
Perhaps it is a good idea to implement that behavior into sheaves (<a class="needs_info ticket" href="https://trac.sagemath.org/ticket/31703" title="#31703: enhancement: Sheaves on manifolds (needs_info)">#31703</a>) first and then wrap this over tensors and vb sections etc.
</p>
TicketMatthias KöppeMon, 19 Jul 2021 02:58:13 GMTmilestone changed
https://trac.sagemath.org/ticket/30714#comment:12
https://trac.sagemath.org/ticket/30714#comment:12
<ul>
<li><strong>milestone</strong>
changed from <em>sage-9.4</em> to <em>sage-9.5</em>
</li>
</ul>
TicketMatthias KöppeSat, 18 Dec 2021 19:41:23 GMTmilestone changed
https://trac.sagemath.org/ticket/30714#comment:13
https://trac.sagemath.org/ticket/30714#comment:13
<ul>
<li><strong>milestone</strong>
changed from <em>sage-9.5</em> to <em>sage-9.6</em>
</li>
</ul>
TicketMatthias KöppeFri, 01 Apr 2022 21:16:35 GMTmilestone changed
https://trac.sagemath.org/ticket/30714#comment:14
https://trac.sagemath.org/ticket/30714#comment:14
<ul>
<li><strong>milestone</strong>
changed from <em>sage-9.6</em> to <em>sage-9.7</em>
</li>
</ul>
TicketMatthias KöppeWed, 31 Aug 2022 02:51:13 GMTmilestone changed
https://trac.sagemath.org/ticket/30714#comment:15
https://trac.sagemath.org/ticket/30714#comment:15
<ul>
<li><strong>milestone</strong>
changed from <em>sage-9.7</em> to <em>sage-9.8</em>
</li>
</ul>
Ticket