Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit e2c535d

Browse files
committed
Merge branch 'public/manifolds/vector_bundles' of git://trac.sagemath.org/sage into Sage 9.0.beta1
2 parents 0f20b37 + 22e6666 commit e2c535d

22 files changed

+8923
-91
lines changed

src/doc/en/reference/categories/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ Individual Categories
181181
sage/categories/triangular_kac_moody_algebras
182182
sage/categories/unique_factorization_domains
183183
sage/categories/unital_algebras
184+
sage/categories/vector_bundles
184185
sage/categories/vector_spaces
185186
sage/categories/weyl_groups
186187

src/doc/en/reference/manifolds/diff_manifold.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ Differentiable Manifolds
2929
sage/manifolds/differentiable/affine_connection
3030

3131
sage/manifolds/differentiable/differentiable_submanifold
32+
33+
sage/manifolds/differentiable/vector_bundle

src/doc/en/reference/manifolds/manifold.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ Topological Manifolds
1919
continuous_map
2020

2121
sage/manifolds/topological_submanifold
22+
23+
vector_bundle
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Topological Vector Bundles
2+
==========================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
sage/manifolds/vector_bundle
8+
9+
sage/manifolds/vector_bundle_fiber
10+
11+
sage/manifolds/vector_bundle_fiber_element
12+
13+
sage/manifolds/trivialization
14+
15+
sage/manifolds/local_frame
16+
17+
sage/manifolds/section_module
18+
19+
sage/manifolds/section
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
r"""
2+
Vector Bundles
3+
"""
4+
#*****************************************************************************
5+
# Copyright (C) 2019 Michael Jung <micjung at uni-potsdam.de>
6+
#
7+
# Distributed under the terms of the GNU General Public License (GPL)
8+
# http://www.gnu.org/licenses/
9+
#******************************************************************************
10+
11+
from sage.categories.category_types import Category_over_base_ring
12+
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
13+
from sage.misc.cachefunc import cached_method
14+
from sage.categories.sets_cat import Sets
15+
from sage.categories.fields import Fields
16+
17+
class VectorBundles(Category_over_base_ring):
18+
r"""
19+
The category of vector bundles over any base space and base field.
20+
21+
.. SEEALSO:: :class:`~sage.manifolds.vector_bundle.TopologicalVectorBundle`
22+
23+
EXAMPLES::
24+
25+
sage: M = Manifold(2, 'M', structure='top')
26+
sage: from sage.categories.vector_bundles import VectorBundles
27+
sage: C = VectorBundles(M, RR); C
28+
Category of vector bundles over Real Field with 53 bits of precision
29+
with base space 2-dimensional topological manifold M
30+
sage: C.super_categories()
31+
[Category of topological spaces]
32+
33+
TESTS::
34+
35+
sage: TestSuite(C).run(skip="_test_category_over_bases")
36+
37+
"""
38+
def __init__(self, base_space, base_field, name=None):
39+
r"""
40+
Initialize ``self``.
41+
42+
EXAMPLES::
43+
44+
sage: M = Manifold(2, 'M')
45+
sage: from sage.categories.vector_bundles import VectorBundles
46+
sage: C = VectorBundles(M, RR)
47+
sage: TestSuite(C).run(skip="_test_category_over_bases")
48+
49+
"""
50+
if base_field not in Fields().Topological():
51+
raise ValueError("base field must be a topological field")
52+
self._base_space = base_space
53+
Category_over_base_ring.__init__(self, base_field, name)
54+
55+
@cached_method
56+
def super_categories(self):
57+
r"""
58+
EXAMPLES::
59+
60+
sage: M = Manifold(2, 'M')
61+
sage: from sage.categories.vector_bundles import VectorBundles
62+
sage: VectorBundles(M, RR).super_categories()
63+
[Category of topological spaces]
64+
65+
"""
66+
return [Sets().Topological()]
67+
68+
def base_space(self):
69+
r"""
70+
Return the base space of this category.
71+
72+
EXAMPLES::
73+
74+
sage: M = Manifold(2, 'M', structure='top')
75+
sage: from sage.categories.vector_bundles import VectorBundles
76+
sage: VectorBundles(M, RR).base_space()
77+
2-dimensional topological manifold M
78+
79+
"""
80+
return self._base_space
81+
82+
def _repr_object_names(self):
83+
r"""
84+
Return the name of the objects of this category.
85+
86+
.. SEEALSO:: :meth:`Category._repr_object_names`
87+
88+
EXAMPLES::
89+
90+
sage: M = Manifold(2, 'M')
91+
sage: from sage.categories.vector_bundles import VectorBundles
92+
sage: VectorBundles(M, RR)._repr_object_names()
93+
'vector bundles over Real Field with 53 bits of precision with base
94+
space 2-dimensional differentiable manifold M'
95+
96+
"""
97+
base_space = self._base_space
98+
return Category_over_base_ring._repr_object_names(self) + \
99+
" with base space %s"%base_space
100+
101+
class SubcategoryMethods:
102+
@cached_method
103+
def Differentiable(self):
104+
r"""
105+
Return the subcategory of the differentiable objects
106+
of ``self``.
107+
108+
EXAMPLES::
109+
110+
sage: M = Manifold(2, 'M')
111+
sage: from sage.categories.vector_bundles import VectorBundles
112+
sage: VectorBundles(M, RR).Differentiable()
113+
Category of differentiable vector bundles over Real Field with
114+
53 bits of precision with base space 2-dimensional
115+
differentiable manifold M
116+
117+
TESTS::
118+
119+
sage: TestSuite(VectorBundles(M, RR).Differentiable()).run()
120+
sage: VectorBundles(M, RR).Differentiable.__module__
121+
'sage.categories.vector_bundles'
122+
123+
"""
124+
return self._with_axiom('Differentiable')
125+
126+
@cached_method
127+
def Smooth(self):
128+
"""
129+
Return the subcategory of the smooth objects of ``self``.
130+
131+
EXAMPLES::
132+
133+
sage: M = Manifold(2, 'M')
134+
sage: from sage.categories.vector_bundles import VectorBundles
135+
sage: VectorBundles(M, RR).Smooth()
136+
Category of smooth vector bundles over Real Field with 53 bits
137+
of precision with base space 2-dimensional differentiable
138+
manifold M
139+
140+
TESTS::
141+
142+
sage: TestSuite(VectorBundles(M, RR).Smooth()).run()
143+
sage: VectorBundles(M, RR).Smooth.__module__
144+
'sage.categories.vector_bundles'
145+
146+
"""
147+
return self._with_axiom('Smooth')
148+
149+
class Differentiable(CategoryWithAxiom_over_base_ring):
150+
"""
151+
The category of differentiable vector bundles.
152+
153+
A differentiable vector bundle is a differentiable manifold with
154+
differentiable surjective projection on a differentiable base space.
155+
156+
"""
157+
158+
class Smooth(CategoryWithAxiom_over_base_ring):
159+
"""
160+
The category of smooth vector bundles.
161+
162+
A smooth vector bundle is a smooth manifold with
163+
smooth surjective projection on a smooth base space.
164+
165+
"""

src/sage/manifolds/chart_func.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,26 @@ def is_trivial_zero(self):
855855
curr = self._calc_method._current
856856
return self._calc_method.is_trivial_zero(self.expr(curr))
857857

858+
def is_unit(self):
859+
r"""
860+
Return ``True`` iff ``self`` is not identically zero since most chart
861+
functions are invertible and an actual computation would take too much
862+
time.
863+
864+
EXAMPLES::
865+
866+
sage: M = Manifold(2, 'M', structure='topological')
867+
sage: X.<x,y> = M.chart()
868+
sage: f = X.function(x^2+3*y+1)
869+
sage: f.is_unit()
870+
True
871+
sage: zero = X.function(0)
872+
sage: zero.is_unit()
873+
False
874+
875+
"""
876+
return not self.is_zero()
877+
858878
def copy(self):
859879
r"""
860880
Return an exact copy of the object.
@@ -2645,7 +2665,7 @@ def _repr_(self):
26452665
"""
26462666
return "Ring of chart functions on {}".format(self._chart)
26472667

2648-
def is_integral_domain(self):
2668+
def is_integral_domain(self, proof=True):
26492669
"""
26502670
Return ``False`` as ``self`` is not an integral domain.
26512671

src/sage/manifolds/differentiable/automorphismfield.py

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -984,84 +984,6 @@ def __call__(self, *arg):
984984
else:
985985
raise TypeError("wrong number of arguments")
986986

987-
def __invert__(self):
988-
r"""
989-
Return the inverse automorphism of ``self``.
990-
991-
EXAMPLES::
992-
993-
sage: M = Manifold(2, 'M')
994-
sage: X.<x,y> = M.chart()
995-
sage: a = M.automorphism_field([[0, 2], [-1, 0]], name='a')
996-
sage: b = a.inverse(); b
997-
Field of tangent-space automorphisms a^(-1) on the 2-dimensional
998-
differentiable manifold M
999-
sage: b[:]
1000-
[ 0 -1]
1001-
[1/2 0]
1002-
sage: a[:]
1003-
[ 0 2]
1004-
[-1 0]
1005-
1006-
The result is cached::
1007-
1008-
sage: a.inverse() is b
1009-
True
1010-
1011-
Instead of ``inverse()``, one can use the power minus one to get the
1012-
inverse::
1013-
1014-
sage: b is a^(-1)
1015-
True
1016-
1017-
or the operator ``~``::
1018-
1019-
sage: b is ~a
1020-
True
1021-
1022-
"""
1023-
from sage.matrix.constructor import matrix
1024-
from sage.tensor.modules.comp import Components
1025-
from sage.manifolds.differentiable.vectorframe import CoordFrame
1026-
if self._is_identity:
1027-
return self
1028-
if self._inverse is None:
1029-
if self._name is None:
1030-
inv_name = None
1031-
else:
1032-
inv_name = self._name + '^(-1)'
1033-
if self._latex_name is None:
1034-
inv_latex_name = None
1035-
else:
1036-
inv_latex_name = self._latex_name + r'^{-1}'
1037-
fmodule = self._fmodule
1038-
si = fmodule._sindex ; nsi = fmodule._rank + si
1039-
self._inverse = fmodule.automorphism(name=inv_name,
1040-
latex_name=inv_latex_name)
1041-
for frame in self._components:
1042-
if isinstance(frame, CoordFrame):
1043-
chart = frame._chart
1044-
else:
1045-
chart = self._domain._def_chart #!# to be improved
1046-
try:
1047-
# TODO: do the computation without the 'SR' enforcement
1048-
mat_self = matrix(
1049-
[[self.comp(frame)[i, j, chart].expr(method='SR')
1050-
for j in range(si, nsi)] for i in range(si, nsi)])
1051-
except (KeyError, ValueError):
1052-
continue
1053-
mat_inv = mat_self.inverse()
1054-
cinv = Components(fmodule._ring, frame, 2, start_index=si,
1055-
output_formatter=fmodule._output_formatter)
1056-
for i in range(si, nsi):
1057-
for j in range(si, nsi):
1058-
val = chart.simplify(mat_inv[i-si,j-si], method='SR')
1059-
cinv[i, j] = {chart: val}
1060-
self._inverse._components[frame] = cinv
1061-
return self._inverse
1062-
1063-
inverse = __invert__
1064-
1065987
def restrict(self, subdomain, dest_map=None):
1066988
r"""
1067989
Return the restriction of ``self`` to some subset of its domain.

0 commit comments

Comments
 (0)