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

Commit

Permalink
Merge #34486
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 6, 2022
2 parents b5c666c + 0d2539a commit f06fc5e
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions src/sage/manifolds/differentiable/vectorfield_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,14 @@ def tensor_module(self, k, l):
for more examples and documentation.
"""
from sage.manifolds.differentiable.tensorfield_module import \
try:
return self._tensor_modules[(k,l)]
except KeyError:
from sage.manifolds.differentiable.tensorfield_module import \
TensorFieldModule
if (k,l) not in self._tensor_modules:
self._tensor_modules[(k,l)] = TensorFieldModule(self, (k,l))
return self._tensor_modules[(k,l)]
T = TensorFieldModule(self, (k,l))
self._tensor_modules[(k,l)] = T
return T

def exterior_power(self, p):
r"""
Expand Down Expand Up @@ -600,13 +603,17 @@ def exterior_power(self, p):
for more examples and documentation.
"""
from sage.manifolds.differentiable.multivector_module import \
try:
return self._exterior_powers[p]
except KeyError:
if p == 0:
L = self._ring
else:
from sage.manifolds.differentiable.multivector_module import \
MultivectorModule
if p == 0:
return self._ring
if p not in self._exterior_powers:
self._exterior_powers[p] = MultivectorModule(self, p)
return self._exterior_powers[p]
L = MultivectorModule(self, p)
self._exterior_powers[p] = L
return L

def dual_exterior_power(self, p):
r"""
Expand Down Expand Up @@ -654,13 +661,17 @@ def dual_exterior_power(self, p):
for more examples and documentation.
"""
from sage.manifolds.differentiable.diff_form_module import \
try:
return self._dual_exterior_powers[p]
except KeyError:
if p == 0:
L = self._ring
else:
from sage.manifolds.differentiable.diff_form_module import \
DiffFormModule
if p == 0:
return self._ring
if p not in self._dual_exterior_powers:
self._dual_exterior_powers[p] = DiffFormModule(self, p)
return self._dual_exterior_powers[p]
L = DiffFormModule(self, p)
self._dual_exterior_powers[p] = L
return L

def dual(self):
r"""
Expand Down

0 comments on commit f06fc5e

Please sign in to comment.