......@@ -3,3 +3,4 @@ lazy_import('sage.manifolds.manifold', 'Manifold')
lazy_import('sage.manifolds.differentiable.real_line', 'OpenInterval')
lazy_import('sage.manifolds.differentiable.real_line', 'RealLine')
lazy_import('sage.manifolds.differentiable.euclidean', 'EuclideanSpace')
lazy_import('sage.manifolds.differentiable.metric', 'substitute')
\ No newline at end of file
......@@ -723,7 +723,7 @@ class LeviCivitaConnection(AffineConnection):
g = (2*m/r - 1) dt*dt - 1/(2*m/r - 1) dr*dr + r^2 dth*dth
+ r^2*sin(th)^2 dph*dph
sage: nab = g.connection() ; nab
Levi-Civita connection nabla_g associated with the Lorentzian
Levi-Civita connection nabla_g associated with the Riemannian
metric g on the 4-dimensional differentiable manifold M
sage: ric = nab.ricci() ; ric
Field of symmetric bilinear forms Ric(g) on the 4-dimensional
......
......@@ -3151,7 +3151,8 @@ class DifferentiableManifold(TopologicalManifold):
AffineConnection
return AffineConnection(self, name, latex_name)
def metric(self, name, signature=None, latex_name=None, dest_map=None):
def metric(self, name, signature=None, latex_name=None, dest_map=None, \
comp=None):
r"""
Define a pseudo-Riemannian metric on the manifold.
......@@ -3199,7 +3200,8 @@ class DifferentiableManifold(TopologicalManifold):
"""
vmodule = self.vector_field_module(dest_map)
return vmodule.metric(name, signature=signature, latex_name=latex_name)
return vmodule.metric(name, signature=signature, latex_name=latex_name,\
comp=comp)
def riemannian_metric(self, name, latex_name=None, dest_map=None):
r"""
......@@ -3341,9 +3343,12 @@ class DifferentiableManifold(TopologicalManifold):
dim = vmodule.ambient_domain().dimension()
if signature=='positive':
signat = dim - 2
index = 1
else:
signat = 2 - dim
return vmodule.metric(name, signature=signat, latex_name=latex_name)
index = dim -1
return vmodule.metric(name, signature=signat, latex_name=latex_name, \
comp=index)
def lorentz_metric(self, name, signature='positive', latex_name=None,
dest_map=None):
......
This diff is collapsed.
......@@ -167,7 +167,7 @@ We construct the metric tensor by::
sage: g = M.metric()
sage: g
Lorentzian metric g on the 4-dimensional Lorentzian manifold M
Riemannian metric g on the 4-dimensional Lorentzian manifold M
and initialize it to the Minkowskian value::
......@@ -431,7 +431,7 @@ class PseudoRiemannianManifold(DifferentiableManifold):
<class 'sage.manifolds.differentiable.pseudo_riemannian.PseudoRiemannianManifold_with_category'>
sage: X.<w,x,y,z> = M.chart()
sage: M.metric()
Pseudo-Riemannian metric g on the 4-dimensional pseudo-Riemannian manifold M
Riemannian metric g on the 4-dimensional pseudo-Riemannian manifold M
sage: TestSuite(M).run()
"""
......@@ -564,7 +564,7 @@ class PseudoRiemannianManifold(DifferentiableManifold):
create a Lorentzian metric on ``M``::
sage: h = M.metric('h', signature=1); h
Lorentzian metric h on the 3-dimensional Riemannian manifold M
Riemannian metric h on the 3-dimensional Riemannian manifold M
"""
if name is None or name == self._metric_name:
......
......@@ -1034,7 +1034,7 @@ class VectorFieldModule(UniqueRepresentation, Parent):
# (since new components are initialized to zero)
return elt
def metric(self, name, signature=None, latex_name=None):
def metric(self, name, signature=None, latex_name=None, comp=None):
r"""
Construct a pseudo-Riemannian metric (nondegenerate symmetric bilinear
form) on the current vector field module.
......@@ -2148,7 +2148,7 @@ class VectorFieldFreeModule(FiniteRankFreeModule):
#### End of methods to be redefined by derived classes of FiniteRankFreeModule ####
def metric(self, name, signature=None, latex_name=None):
def metric(self, name, signature=None, latex_name=None, comp=None):
r"""
Construct a pseudo-Riemannian metric (nondegenerate symmetric bilinear
form) on the current vector field module.
......@@ -2181,7 +2181,7 @@ class VectorFieldFreeModule(FiniteRankFreeModule):
sage: XM = M.vector_field_module()
sage: XM.metric('g')
Riemannian metric g on the 2-dimensional differentiable manifold M
sage: XM.metric('g', signature=0)
sage: XM.metric('g', comp=1)
Lorentzian metric g on the 2-dimensional differentiable manifold M
.. SEEALSO::
......@@ -2192,5 +2192,5 @@ class VectorFieldFreeModule(FiniteRankFreeModule):
"""
from sage.manifolds.differentiable.metric import \
PseudoRiemannianMetricParal
return PseudoRiemannianMetricParal(self, name, signature=signature,
latex_name=latex_name)
return PseudoRiemannianMetricParal(self, name,
latex_name=latex_name, comp=comp)