Opened 2 years ago
Last modified 4 weeks ago
#30714 new enhancement
Tensor Arithmetics on Minimal Amount of Domains
Reported by: | Michael Jung | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.8 |
Component: | manifolds | Keywords: | |
Cc: | Eric Gourgoulhon, Travis Scrimshaw, Matthias Köppe | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
If I get the code correctly, operations between two tensor fields on non-parallelizable manifolds are performed as follows:
- get common domains from the
_restrictions
dictionary, - perform the corresponding operation on each of those domains.
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.
Allow me an example:
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}
Now, if you add v
and another vector field defined similarly, the addition would be performed on U
, V
and W
. Even though the computation on W
is not necessary.
Change History (15)
comment:1 follow-up: 3 Changed 2 years ago by
comment:2 follow-ups: 4 5 Changed 2 years ago by
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 TopologicalManifold._top_charts
and DifferentiableManifold._top_frames
). Then the method TensorField._common_subdomains()
, which is invoked by _add_()
, could deal only with these top restrictions.
comment:3 Changed 2 years ago by
Replying to mkoeppe:
This is an NP-hard optimization problem.
I'm sorry, I don't know what you mean. Can you explain please?
comment:4 Changed 2 years ago by
Just for the records, I have introduced a method called _get_min_covering
for characteristic forms and orientations (you can find it in manifold.py
), 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 save.
comment:5 Changed 2 years ago by
Replying to egourgoulhon:
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
TopologicalManifold._top_charts
andDifferentiableManifold._top_frames
). Then the methodTensorField._common_subdomains()
, which is invoked by_add_()
, could deal only with these top restrictions.
This sounds like a great idea to me. I'm eager to hear what Matthias and Travis think about it.
comment:6 Changed 2 years ago by
Milestone: | sage-9.2 → sage-9.3 |
---|
comment:7 Changed 20 months ago by
Milestone: | sage-9.3 → sage-9.4 |
---|
Setting new milestone based on a cursory review of ticket status, priority, and last modification date.
comment:9 Changed 17 months ago by
Cc: | Matthias Köppe added |
---|
comment:10 Changed 17 months ago by
comment:11 Changed 17 months ago by
Perhaps it is a good idea to implement that behavior into sheaves (#31703) first and then wrap this over tensors and vb sections etc.
comment:12 Changed 14 months ago by
Milestone: | sage-9.4 → sage-9.5 |
---|
comment:13 Changed 9 months ago by
Milestone: | sage-9.5 → sage-9.6 |
---|
comment:14 Changed 6 months ago by
Milestone: | sage-9.6 → sage-9.7 |
---|
comment:15 Changed 4 weeks ago by
Milestone: | sage-9.7 → sage-9.8 |
---|
This is an NP-hard optimization problem.