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

Commit da06d12

Browse files
committed
Small improvement in treatment of symbol attributes of free module bases
1 parent 799066b commit da06d12

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/sage/manifolds/differentiable/tangent_space.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,13 @@ def __init__(self, point):
205205
# only if it is a frame on the current manifold:
206206
if frame.destination_map().is_identity():
207207
if point in frame._domain:
208+
coframe = frame.coframe()
208209
basis = self.basis(frame._symbol,
209210
latex_symbol=frame._latex_symbol,
210211
indices=frame._indices,
211212
latex_indices=frame._latex_indices,
212-
symbol_dual=frame._symbol_dual,
213-
latex_symbol_dual=frame._latex_symbol_dual)
213+
symbol_dual=coframe._symbol,
214+
latex_symbol_dual=coframe._latex_symbol)
214215
self._frame_bases[frame] = basis
215216
# The basis induced by the default frame of the manifold subset
216217
# in which the point has been created is declared the default

src/sage/tensor/modules/free_module_basis.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ def set_name(self, symbol, latex_symbol=None, indices=None,
268268
pos = "^"
269269
if latex_symbol is None:
270270
latex_symbol = symbol
271+
self._symbol = symbol
272+
self._latex_symbol = latex_symbol
273+
self._indices = indices
274+
self._latex_indices = latex_indices
271275
# Text symbols:
272276
if isinstance(symbol, (list, tuple)):
273277
if len(symbol) != n:
@@ -576,9 +580,6 @@ def __init__(self, fmodule, symbol, latex_symbol=None, indices=None,
576580
Basis_abstract.__init__(self, fmodule, symbol, latex_symbol, indices,
577581
latex_indices)
578582
# The basis is added to the module list of bases
579-
for other in fmodule._known_bases:
580-
if symbol == other._symbol:
581-
raise ValueError("the {} already exist on the {}".format(other, fmodule))
582583
fmodule._known_bases.append(self)
583584
# The individual vectors:
584585
vl = list()
@@ -696,9 +697,6 @@ def _new_instance(self, symbol, latex_symbol=None, indices=None,
696697
Dual basis (E^x,E^y,E^z) on the Rank-3 free module M over the Integer Ring
697698
698699
"""
699-
if isinstance(symbol, list):
700-
symbol = tuple(symbol) # must be a tuple for unique representation
701-
# of FreeModuleBasis
702700
return FreeModuleBasis(self._fmodule, symbol, latex_symbol=latex_symbol,
703701
indices=indices, latex_indices=latex_indices,
704702
symbol_dual=symbol_dual,

0 commit comments

Comments
 (0)