@@ -221,8 +221,8 @@ class PseudoRiemannianSubmanifold(PseudoRiemannianManifold,
221221 - ``ambient`` -- (default: ``None``) pseudo-Riemannian manifold `M` in
222222 which the submanifold is embedded (or immersed). If ``None``, it is set
223223 to ``self``
224- - ``metric_name`` -- (default: ``'g' ``) string; name (symbol) given to the
225- submanifold's metric
224+ - ``metric_name`` -- (default: ``None ``) string; name (symbol) given to the
225+ metric; if ``None``, ``'gamma'`` is used
226226 - ``signature`` -- (default: ``None``) signature `S` of the metric as a
227227 single integer: `S = n_+ - n_-`, where `n_+` (resp. `n_-`) is the
228228 number of positive terms (resp. number of negative terms) in any
@@ -236,7 +236,8 @@ class PseudoRiemannianSubmanifold(PseudoRiemannianManifold,
236236 - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to
237237 denote the submanifold; if none is provided, it is set to ``name``
238238 - ``metric_latex_name`` -- (default: ``None``) string; LaTeX symbol to
239- denote the metric; if none is provided, it is set to ``metric_name``
239+ denote the metric; if none is provided, it is set to ``metric_name`` if
240+ the latter is not ``None`` and to ``r'\gamma'`` otherwise
240241 - ``start_index`` -- (default: 0) integer; lower value of the range of
241242 indices used for "indexed objects" on the submanifold, e.g. coordinates
242243 in a chart
@@ -300,10 +301,10 @@ class PseudoRiemannianSubmanifold(PseudoRiemannianManifold,
300301 :mod:`~sage.manifolds.differentiable.differentiable_submanifold`
301302
302303 """
303- def __init__ (self , n , name , ambient = None , metric_name = 'g' , signature = None ,
304- base_manifold = None , diff_degree = infinity , latex_name = None ,
305- metric_latex_name = None , start_index = 0 , category = None ,
306- unique_tag = None ):
304+ def __init__ (self , n , name , ambient = None , metric_name = None ,
305+ signature = None , base_manifold = None , diff_degree = infinity ,
306+ latex_name = None , metric_latex_name = None , start_index = 0 ,
307+ category = None , unique_tag = None ):
307308 r"""
308309 Construct a pseudo-Riemannian submanifold.
309310
@@ -337,6 +338,9 @@ def __init__(self, n, name, ambient=None, metric_name='g', signature=None,
337338 5-dimensional pseudo-Riemannian manifold M
338339
339340 """
341+ if metric_name is None :
342+ metric_name = 'gamma'
343+ metric_latex_name = r'\gamma'
340344 PseudoRiemannianManifold .__init__ (self , n , name = name ,
341345 metric_name = metric_name ,
342346 signature = signature ,
@@ -513,7 +517,7 @@ def first_fundamental_form(self):
513517 A sphere embedded in Euclidean space::
514518
515519 sage: M.<x,y,z> = EuclideanSpace()
516- sage: N = Manifold(2, 'N', ambient=M, structure=" Riemannian" )
520+ sage: N = Manifold(2, 'N', ambient=M, structure=' Riemannian' )
517521 sage: C.<th,ph> = N.chart(r'th:(0,pi):\theta ph:(-pi,pi):\phi')
518522 sage: r = var('r', domain='real')
519523 sage: assume(r>0)
@@ -535,16 +539,105 @@ def first_fundamental_form(self):
535539 [ r^2 0]
536540 [ 0 r^2*sin(th)^2]
537541
542+ By default, the first fundamental form is named ``gamma``, but this
543+ can be customized by means of the argument ``metric_name`` when
544+ declaring the submanifold::
545+
546+ sage: P = Manifold(1, 'P', ambient=M, structure='Riemannian',
547+ ....: metric_name='g')
548+ sage: CP.<t> = P.chart()
549+ sage: F = P.diff_map(M, [t, 2*t, 3*t])
550+ sage: P.set_embedding(F)
551+ sage: P.induced_metric()
552+ Riemannian metric g on the 1-dimensional Riemannian submanifold P
553+ embedded in the Euclidean space E^3
554+ sage: P.induced_metric().display()
555+ g = 14 dt⊗dt
556+
538557 """
539558 if self ._first_fundamental_form is None :
540- self ._first_fundamental_form = self .metric ()
559+ self ._first_fundamental_form = super () .metric ()
541560 self ._first_fundamental_form .set (
542561 self ._immersion .pullback (self .ambient_metric ()))
543- self ._first_fundamental_form .set_name ("gamma" , r"\gamma" )
544562 return self ._first_fundamental_form
545563
546564 induced_metric = first_fundamental_form
547565
566+ def metric (self , name = None , signature = None , latex_name = None ,
567+ dest_map = None ):
568+ r"""
569+ Return the induced metric (first fundamental form) or define a new
570+ metric tensor on the submanifold.
571+
572+ A new (uninitialzed) metric is returned only if the argument ``name``
573+ is provided and differs from the metric name declared at the
574+ construction of the submanifold; otherwise, the first fundamental
575+ form is returned.
576+
577+ INPUT:
578+
579+ - ``name`` -- (default: ``None``) name given to the metric; if ``name``
580+ is ``None`` or equals the metric name declared when constructing
581+ the submanifold, the first fundamental form is returned (see
582+ :meth:`first_fundamental_form`)
583+ - ``signature`` -- (default: ``None``; ignored if ``name`` is ``None``)
584+ signature `S` of the metric as a single integer: `S = n_+ - n_-`,
585+ where `n_+` (resp. `n_-`) is the number of positive terms (resp.
586+ number of negative terms) in any diagonal writing of the metric
587+ components; if ``signature`` is not provided, `S` is set to the
588+ submanifold's dimension (Riemannian signature)
589+ - ``latex_name`` -- (default: ``None``; ignored if ``name`` is ``None``)
590+ LaTeX symbol to denote the metric; if ``None``, it is formed from
591+ ``name``
592+ - ``dest_map`` -- (default: ``None``; ignored if ``name`` is ``None``)
593+ instance of
594+ class :class:`~sage.manifolds.differentiable.diff_map.DiffMap`
595+ representing the destination map `\Phi:\ U \rightarrow M`, where `U`
596+ is the current submanifold; if ``None``, the identity map is assumed
597+ (case of a metric tensor field *on* `U`)
598+
599+ OUTPUT:
600+
601+ - instance of
602+ :class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric`
603+
604+ EXAMPLES:
605+
606+ Induced metric on a straight line of the Euclidean plane::
607+
608+ sage: M.<x,y> = EuclideanSpace()
609+ sage: N = Manifold(1, 'N', ambient=M, structure='Riemannian')
610+ sage: CN.<t> = N.chart()
611+ sage: F = N.diff_map(M, [t, 2*t])
612+ sage: N.set_embedding(F)
613+ sage: N.metric()
614+ Riemannian metric gamma on the 1-dimensional Riemannian
615+ submanifold N embedded in the Euclidean plane E^2
616+ sage: N.metric().display()
617+ gamma = 5 dt⊗dt
618+
619+ Setting the argument ``name`` to that declared while constructing
620+ the submanifold (default = ``'gamma'``) yields the same result::
621+
622+ sage: N.metric(name='gamma') is N.metric()
623+ True
624+
625+ while using a different name allows one to define a new metric on the
626+ submanifold::
627+
628+ sage: h = N.metric(name='h'); h
629+ Riemannian metric h on the 1-dimensional Riemannian submanifold N
630+ embedded in the Euclidean plane E^2
631+ sage: h[0, 0] = 1 # initialization
632+ sage: h.display()
633+ h = dt⊗dt
634+
635+ """
636+ if name is None or name == self ._metric_name :
637+ return self .first_fundamental_form ()
638+ return super ().metric (name = name , signature = signature ,
639+ latex_name = latex_name , dest_map = dest_map )
640+
548641 @cached_method
549642 def difft (self ):
550643 r"""
@@ -1162,7 +1255,7 @@ def second_fundamental_form(self):
11621255 + " hypersurfaces" )
11631256 if self ._second_fundamental_form is None :
11641257 resu = self .vector_field_module ().tensor ((0 , 2 ), name = 'K' ,
1165- sym = [(0 , 1 )])
1258+ sym = [(0 , 1 )])
11661259 if self ._dim_foliation != 0 :
11671260 inverse_subs = {v : k for k , v in self ._subs [0 ].items ()}
11681261 asff = self .ambient_second_fundamental_form ()
0 commit comments