Skip to content

Commit 3f80b5d

Browse files
author
Release Manager
committed
gh-40249: fix dimension of total space of vector bundle as observed in https://ask.sagemath.org/question/83047/total_space-dimension/ ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. URL: #40249 Reported by: Frédéric Chapoton Reviewer(s): Eric Gourgoulhon
2 parents 9944efa + 9e197d0 commit 3f80b5d

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

src/sage/manifolds/differentiable/vector_bundle.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
- Michael Jung (2019) : initial version
2121
"""
2222

23-
#******************************************************************************
23+
# ****************************************************************************
2424
# Copyright (C) 2019 Michael Jung <micjung at uni-potsdam.de>
2525
#
2626
# Distributed under the terms of the GNU General Public License (GPL)
2727
# as published by the Free Software Foundation; either version 2 of
2828
# the License, or (at your option) any later version.
2929
# https://www.gnu.org/licenses/
30-
#******************************************************************************
30+
# ****************************************************************************
3131

3232
from sage.categories.vector_bundles import VectorBundles
3333
from sage.manifolds.vector_bundle import TopologicalVectorBundle
@@ -317,18 +317,20 @@ def total_space(self):
317317
sage: M = Manifold(3, 'M')
318318
sage: E = M.vector_bundle(2, 'E')
319319
sage: E.total_space()
320-
6-dimensional differentiable manifold E
320+
5-dimensional differentiable manifold E
321321
"""
322322
if self._total_space is None:
323323
from sage.manifolds.manifold import Manifold
324324
base_space = self._base_space
325-
dim = base_space._dim * self._rank
325+
dim = base_space._dim + self._rank
326326
sindex = base_space.start_index()
327-
self._total_space = Manifold(dim, self._name,
328-
latex_name=self._latex_name,
329-
field=self._field, structure='differentiable',
330-
diff_degree=self._diff_degree,
331-
start_index=sindex)
327+
self._total_space = Manifold(
328+
dim, self._name,
329+
latex_name=self._latex_name,
330+
field=self._field, structure='differentiable',
331+
diff_degree=self._diff_degree,
332+
start_index=sindex
333+
)
332334

333335
# TODO: if update_atlas: introduce charts via self._atlas
334336

@@ -634,9 +636,10 @@ def section_module(self, domain=None):
634636
base_space = self.base_space()
635637
return base_space.tensor_field_module(self._tensor_type,
636638
dest_map=self._dest_map)
637-
else:
638-
return domain.tensor_field_module(self._tensor_type,
639-
dest_map=self._dest_map.restrict(domain))
639+
return domain.tensor_field_module(
640+
self._tensor_type,
641+
dest_map=self._dest_map.restrict(domain)
642+
)
640643

641644
def section(self, *args, **kwargs):
642645
r"""

src/sage/manifolds/vector_bundle.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
- [Mil1974]_
2424
"""
2525

26-
#******************************************************************************
26+
# ****************************************************************************
2727
# Copyright (C) 2019 Michael Jung <[email protected]>
2828
#
2929
# Distributed under the terms of the GNU General Public License (GPL)
3030
# as published by the Free Software Foundation; either version 2 of
3131
# the License, or (at your option) any later version.
3232
# https://www.gnu.org/licenses/
33-
#******************************************************************************
33+
# ****************************************************************************
3434

3535
import sage.rings.abc
3636
from sage.categories.vector_bundles import VectorBundles
@@ -265,16 +265,19 @@ def _init_attributes(self):
265265
sage: E = M.vector_bundle(2, 'E')
266266
sage: E._init_attributes()
267267
"""
268-
self._section_modules = {} # dict of section modules with domains as
269-
# keys
268+
self._section_modules = {}
269+
# dict of section modules with domains as keys
270+
270271
self._atlas = [] # list of trivializations defined on self
271-
self._transitions = {} # dictionary of transition maps (key: pair of
272-
# of trivializations)
272+
self._transitions = {}
273+
# dictionary of transition maps (key: pair of trivializations)
274+
273275
self._frames = [] # list of local frames for self
274276
self._frame_changes = {} # dictionary of changes of frames
275-
self._coframes = [] # list of local coframes for self
276-
self._trivial_parts = set() # subsets of base space on which self is
277-
# trivial
277+
self._coframes = [] # list of local coframes for self
278+
self._trivial_parts = set()
279+
# subsets of base space on which self is trivial
280+
278281
self._def_frame = None
279282

280283
def base_space(self):
@@ -526,7 +529,7 @@ def atlas(self):
526529
Trivialization (phi_V, E|_V),
527530
Trivialization (phi_M, E|_M)]
528531
"""
529-
return list(self._atlas) # Make a (shallow) copy
532+
return list(self._atlas) # Make a (shallow) copy
530533

531534
def is_manifestly_trivial(self):
532535
r"""
@@ -869,17 +872,19 @@ def total_space(self):
869872
sage: M = Manifold(3, 'M', structure='top')
870873
sage: E = M.vector_bundle(2, 'E')
871874
sage: E.total_space()
872-
6-dimensional topological manifold E
875+
5-dimensional topological manifold E
873876
"""
874877
if self._total_space is None:
875878
from sage.manifolds.manifold import Manifold
876879
base_space = self._base_space
877-
dim = base_space._dim * self._rank
880+
dim = base_space._dim + self._rank
878881
sindex = base_space.start_index()
879-
self._total_space = Manifold(dim, self._name,
880-
latex_name=self._latex_name,
881-
field=self._field, structure='topological',
882-
start_index=sindex)
882+
self._total_space = Manifold(
883+
dim, self._name,
884+
latex_name=self._latex_name,
885+
field=self._field, structure='topological',
886+
start_index=sindex
887+
)
883888

884889
# TODO: if update_atlas: introduce charts via self._atlas
885890

@@ -934,7 +939,7 @@ def set_change_of_frame(self, frame1, frame2, change_of_frame,
934939
"section module")
935940
if isinstance(change_of_frame, FreeModuleAutomorphism):
936941
auto = change_of_frame
937-
else: # Otherwise try to coerce the input
942+
else: # Otherwise try to coerce the input
938943
auto_group = sec_module.general_linear_group()
939944
auto = auto_group(change_of_frame, basis=frame1)
940945
sec_module.set_change_of_basis(frame1, frame2, auto,

0 commit comments

Comments
 (0)