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

Commit fdd9051

Browse files
committed
Fix the treatment of bases initialization in tangent space construction
1 parent 178c1ca commit fdd9051

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

src/sage/manifolds/differentiable/tangent_space.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -197,34 +197,39 @@ def __init__(self, point):
197197
# Initialization of bases of the tangent space from existing vector
198198
# frames around the point:
199199

200-
# dictionary of bases of the tangent vector derived from vector
201-
# frames (keys: vector frames)
200+
# dictionary of bases of the tangent space derived from vector
201+
# frames around the point (keys: vector frames)
202202
self._frame_bases = {}
203203
for frame in point.parent()._top_frames:
204-
if point in frame._domain:
205-
basis = self.basis(symbol=frame._symbol,
206-
latex_symbol=frame._latex_symbol)
207-
# Names of basis vectors set to those of the frame vector
208-
# fields:
209-
for i,v in enumerate(frame._vec):
210-
basis._vec[i]._name = v._name
211-
basis._vec[i]._latex_name = v._latex_name
212-
basis._name = "({})".format(",".join(v._name for v in basis._vec))
213-
basis._latex_name = r"\left({}\right)".format(
214-
",".join(v._latex_name for v in basis._vec))
215-
basis._symbol = basis._name
216-
basis._latex_symbol = basis._latex_name
217-
# Names of cobasis linear forms set to those of the coframe
218-
# 1-forms:
219-
coframe = frame.coframe()
220-
cobasis = basis.dual_basis()
221-
for i,f in enumerate(coframe._form):
222-
cobasis._form[i]._name = f._name
223-
cobasis._form[i]._latex_name = f._latex_name
224-
cobasis._name = "({})".format(",".join(f._name for f in cobasis._form))
225-
cobasis._latex_name = r"\left({}\right)".format(
226-
",".join(f._latex_name for f in cobasis._form))
227-
self._frame_bases[frame] = basis
204+
# the frame is used to construct a basis of the tangent space
205+
# only if it is a frame on the current manifold:
206+
if frame.destination_map().is_identity():
207+
if point in frame._domain:
208+
basis = self.basis(symbol=frame._symbol,
209+
latex_symbol=frame._latex_symbol)
210+
# Names of basis vectors set to those of the frame vector
211+
# fields:
212+
for i,v in enumerate(frame._vec):
213+
basis._vec[i]._name = v._name
214+
basis._vec[i]._latex_name = v._latex_name
215+
basis._name = "({})".format(
216+
",".join(v._name for v in basis._vec))
217+
basis._latex_name = r"\left({}\right)".format(
218+
",".join(v._latex_name for v in basis._vec))
219+
basis._symbol = basis._name
220+
basis._latex_symbol = basis._latex_name
221+
# Names of cobasis linear forms set to those of the coframe
222+
# 1-forms:
223+
coframe = frame.coframe()
224+
cobasis = basis.dual_basis()
225+
for i,f in enumerate(coframe._form):
226+
cobasis._form[i]._name = f._name
227+
cobasis._form[i]._latex_name = f._latex_name
228+
cobasis._name = "({})".format(
229+
",".join(f._name for f in cobasis._form))
230+
cobasis._latex_name = r"\left({}\right)".format(
231+
",".join(f._latex_name for f in cobasis._form))
232+
self._frame_bases[frame] = basis
228233
# The basis induced by the default frame of the manifold subset
229234
# in which the point has been created is declared the default
230235
# basis of self:

0 commit comments

Comments
 (0)