forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector_bundle.py
More file actions
1729 lines (1413 loc) · 68.1 KB
/
Copy pathvector_bundle.py
File metadata and controls
1729 lines (1413 loc) · 68.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
r"""
Differentiable Vector Bundles
Let `K` be a topological field. A `C^k`-differentiable *vector bundle* of rank
`n` over the field `K` and over a `C^k`-differentiable manifold `M` (base
space) is a `C^k`-differentiable manifold `E` (total space) together with a
`C^k` differentiable and surjective map `\pi: E \to M` such that for
every point `x \in M`:
- the set `E_x=\pi^{-1}(x)` has the vector space structure of `K^n`,
- there is a neighborhood `U \subset M` of `x` and a `C^k`-diffeomorphism
`\varphi: \pi^{-1}(x) \to U \times K^n` such that
`v \mapsto \varphi^{-1}(y,v)` is a linear isomorphism for any `y \in U`.
An important case of a differentiable vector bundle over a differentiable
manifold is the tensor bundle (see :class:`TensorBundle`)
AUTHORS:
- Michael Jung (2019) : initial version
"""
# ****************************************************************************
# Copyright (C) 2019 Michael Jung <micjung at uni-potsdam.de>
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************
from sage.categories.vector_bundles import VectorBundles
from sage.manifolds.vector_bundle import TopologicalVectorBundle
from sage.misc.superseded import deprecated_function_alias
from sage.rings.cc import CC
from sage.rings.infinity import infinity
from sage.rings.rational_field import QQ
from sage.rings.real_mpfr import RR
class DifferentiableVectorBundle(TopologicalVectorBundle):
r"""
An instance of this class represents a differentiable vector bundle
`E \to M`
INPUT:
- ``rank`` -- positive integer; rank of the vector bundle
- ``name`` -- string representation given to the total space
- ``base_space`` -- the base space (differentiable manifold) `M` over which
the vector bundle is defined
- ``field`` -- field `K` which gives the fibers the structure of a
vector space over `K`; allowed values are
- ``'real'`` or an object of type ``RealField`` (e.g., ``RR``) for
a vector bundle over `\RR`
- ``'complex'`` or an object of type ``ComplexField`` (e.g., ``CC``)
for a vector bundle over `\CC`
- an object in the category of topological fields (see
:class:`~sage.categories.fields.Fields` and
:class:`~sage.categories.topological_spaces.TopologicalSpaces`)
for other types of topological fields
- ``latex_name`` -- (default: ``None``) LaTeX representation given to the
total space
- ``category`` -- (default: ``None``) to specify the category; if
``None``, ``VectorBundles(base_space, c_field).Differentiable()`` is
assumed (see the category
:class:`~sage.categories.vector_bundles.VectorBundles`)
EXAMPLES:
A differentiable vector bundle of rank 2 over a 3-dimensional
differentiable manifold::
sage: M = Manifold(3, 'M')
sage: E = M.vector_bundle(2, 'E', field='complex'); E
Differentiable complex vector bundle E -> M of rank 2 over the base
space 3-dimensional differentiable manifold M
sage: E.category()
Category of smooth vector bundles over Complex Field with 53 bits of
precision with base space 3-dimensional differentiable manifold M
At this stage, the differentiable vector bundle has the same
differentiability degree as the base manifold::
sage: M.diff_degree() == E.diff_degree()
True
"""
def __init__(self, rank, name, base_space, field='real', latex_name=None,
category=None, unique_tag=None):
r"""
Construct a differentiable vector bundle.
TESTS::
sage: M = Manifold(2, 'M')
sage: from sage.manifolds.differentiable.vector_bundle import DifferentiableVectorBundle
sage: DifferentiableVectorBundle(2, 'E', M)
Differentiable real vector bundle E -> M of rank 2 over the base
space 2-dimensional differentiable manifold M
"""
diff_degree = base_space._diff_degree
if category is None:
if field == 'real':
field_c = RR
elif field == 'complex':
field_c = CC
else:
field_c = field
if diff_degree == infinity:
category = VectorBundles(base_space, field_c).Smooth()
else:
category = VectorBundles(base_space, field_c).Differentiable()
TopologicalVectorBundle.__init__(self, rank, name, base_space,
field=field,
latex_name=latex_name,
category=category)
self._diff_degree = diff_degree # Override diff degree
def _repr_(self):
r"""
String representation of ``self``.
TESTS::
sage: M = Manifold(2, 'M')
sage: E = M.vector_bundle(1, 'E')
sage: E._repr_()
'Differentiable real vector bundle E -> M of rank 1 over the base
space 2-dimensional differentiable manifold M'
"""
desc = "Differentiable "
return desc + TopologicalVectorBundle._repr_object_name(self)
def bundle_connection(self, name, latex_name=None):
r"""
Return a bundle connection on ``self``.
OUTPUT:
- a bundle connection on ``self`` as an instance of
:class:`~sage.manifolds.differentiable.bundle_connection.BundleConnection`
EXAMPLES::
sage: M = Manifold(3, 'M', start_index=1)
sage: X.<x,y,z> = M.chart()
sage: E = M.vector_bundle(2, 'E')
sage: e = E.local_frame('e') # standard frame for E
sage: nab = E.bundle_connection('nabla', latex_name=r'\nabla'); nab
Bundle connection nabla on the Differentiable real vector bundle
E -> M of rank 2 over the base space 3-dimensional differentiable
manifold M
.. SEEALSO::
Further examples can be found in
:class:`~sage.manifolds.differentiable.bundle_connection.BundleConnection`.
"""
from sage.manifolds.differentiable.bundle_connection import BundleConnection
return BundleConnection(self, name, latex_name)
def characteristic_cohomology_class_ring(self, base=QQ):
r"""
Return the characteristic cohomology class ring of ``self`` over
a given base.
INPUT:
- ``base`` -- (default: ``QQ``) base over which the ring should be
constructed; typically that would be `\ZZ`, `\QQ`, `\RR` or the
symbolic ring
EXAMPLES::
sage: M = Manifold(4, 'M', start_index=1)
sage: R = M.tangent_bundle().characteristic_cohomology_class_ring()
sage: R
Algebra of characteristic cohomology classes of the Tangent bundle
TM over the 4-dimensional differentiable manifold M
sage: p1 = R.gen(0); p1
Characteristic cohomology class (p_1)(TM) of the Tangent bundle TM
over the 4-dimensional differentiable manifold M
sage: 1 + p1
Characteristic cohomology class (1 + p_1)(TM) of the Tangent bundle
TM over the 4-dimensional differentiable manifold M
"""
from sage.manifolds.differentiable.characteristic_cohomology_class import (
CharacteristicCohomologyClassRing,
)
return CharacteristicCohomologyClassRing(base, self)
def characteristic_cohomology_class(self, *args, **kwargs):
r"""
Return a characteristic cohomology class associated with the input
data.
INPUT:
- ``val`` -- the input data associated with the characteristic class
using the Chern-Weil homomorphism; this argument can be either a
symbolic expression, a polynomial or one of the following predefined
classes:
- ``'Chern'`` -- total Chern class,
- ``'ChernChar'`` -- Chern character,
- ``'Todd'`` -- Todd class,
- ``'Pontryagin'`` -- total Pontryagin class,
- ``'Hirzebruch'`` -- Hirzebruch class,
- ``'AHat'`` -- `\hat{A}` class,
- ``'Euler'`` -- Euler class.
- ``base_ring`` -- (default: ``QQ``) base ring over which the
characteristic cohomology class ring shall be defined
- ``name`` -- (default: ``None``) string representation given to the
characteristic cohomology class; if ``None`` the default algebra
representation or predefined name is used
- ``latex_name`` -- (default: ``None``) LaTeX name given to the
characteristic class; if ``None`` the value of ``name`` is used
- ``class_type`` -- (default: ``None``) class type of the characteristic
cohomology class; the following options are possible:
- ``'multiplicative'`` -- returns a class of multiplicative type
- ``'additive'`` -- returns a class of additive type
- ``'Pfaffian'`` -- returns a class of Pfaffian type
This argument must be stated if ``val`` is a polynomial or symbolic
expression.
EXAMPLES:
Pontryagin class on the Minkowski space::
sage: M = Manifold(4, 'M', structure='Lorentzian', start_index=1)
sage: X.<t,x,y,z> = M.chart()
sage: g = M.metric()
sage: g[1,1] = -1
sage: g[2,2] = 1
sage: g[3,3] = 1
sage: g[4,4] = 1
sage: g.display()
g = -dt⊗dt + dx⊗dx + dy⊗dy + dz⊗dz
Let us introduce the corresponding Levi-Civita connection::
sage: nab = g.connection(); nab
Levi-Civita connection nabla_g associated with the Lorentzian
metric g on the 4-dimensional Lorentzian manifold M
sage: nab.set_immutable() # make nab immutable
Of course, `\nabla_g` is flat::
sage: nab.display()
Let us check the total Pontryagin class which must be the one
element in the corresponding cohomology ring in this case::
sage: TM = M.tangent_bundle(); TM
Tangent bundle TM over the 4-dimensional Lorentzian manifold M
sage: p = TM.characteristic_cohomology_class('Pontryagin'); p
Characteristic cohomology class p(TM) of the Tangent bundle TM over
the 4-dimensional Lorentzian manifold M
sage: p_form = p.get_form(nab); p_form.display_expansion()
p(TM, nabla_g) = 1
.. SEEALSO::
More examples can be found in
:class:`~sage.manifolds.differentiable.characteristic_class.CharacteristicClass`.
"""
base_ring = kwargs.get('base_ring', QQ)
R = self.characteristic_cohomology_class_ring(base_ring)
return R(*args, **kwargs)
characteristic_class = deprecated_function_alias(29581, characteristic_cohomology_class)
def diff_degree(self):
r"""
Return the vector bundle's degree of differentiability.
The degree of differentiability is the integer `k` (possibly
`k=\infty`) such that the vector bundle is of class `C^k` over
its base field. The degree always corresponds to the degree of
differentiability of it's base space.
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: E = M.vector_bundle(2, 'E')
sage: E.diff_degree()
+Infinity
sage: M = Manifold(2, 'M', structure='differentiable',
....: diff_degree=3)
sage: E = M.vector_bundle(2, 'E')
sage: E.diff_degree()
3
"""
return self._diff_degree
def total_space(self):
r"""
Return the total space of ``self``.
.. NOTE::
At this stage, the total space does not come with induced charts.
OUTPUT:
- the total space of ``self`` as an instance of
:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`
EXAMPLES::
sage: M = Manifold(3, 'M')
sage: E = M.vector_bundle(2, 'E')
sage: E.total_space()
5-dimensional differentiable manifold E
"""
if self._total_space is None:
from sage.manifolds.manifold import Manifold
base_space = self._base_space
dim = base_space._dim + self._rank
sindex = base_space.start_index()
self._total_space = Manifold(
dim, self._name,
latex_name=self._latex_name,
field=self._field, structure='differentiable',
diff_degree=self._diff_degree,
start_index=sindex
)
# TODO: if update_atlas: introduce charts via self._atlas
return self._total_space
# *****************************************************************************
class TensorBundle(DifferentiableVectorBundle):
r"""
Tensor bundle over a differentiable manifold along a differentiable map.
An instance of this class represents the pullback tensor bundle
`\Phi^* T^{(k,l)}N` along a differentiable map (called *destination map*)
.. MATH::
\Phi: M \longrightarrow N
between two differentiable manifolds `M` and `N` over the topological field
`K`.
More precisely, `\Phi^* T^{(k,l)}N` consists of all pairs
`(p,t) \in M \times T^{(k,l)}N` such that `t \in T_q^{(k,l)}N` for
`q = \Phi(p)`, namely
.. MATH::
t:\ \underbrace{T_q^*N\times\cdots\times T_q^*N}_{k\ \; \text{times}}
\times \underbrace{T_q N\times\cdots\times T_q N}_{l\ \; \text{times}}
\longrightarrow K
(`k` is called the *contravariant* and `l` the *covariant* rank of the
tensor bundle).
The trivializations are directly given by charts on the codomain (called
*ambient domain*) of `\Phi`.
In particular, let `(V, \varphi)` be a chart of `N` with components
`(x^1, \dots, x^n)` such that `q=\Phi(p) \in V`. Then, the matrix entries
of `t \in T_q^{(k,l)}N` are given by
.. MATH::
t^{a_1 \ldots a_k}_{\phantom{a_1 \ldots a_k} \, b_1 \ldots b_l} =
t \left( \left.\frac{\partial}{\partial x^{a_1}}\right|_q, \dots,
\left.\frac{\partial}{\partial x^{a_k}}\right|_q,
\left.\mathrm{d}x^{b_1}\right|_q, \dots,
\left.\mathrm{d}x^{b_l}\right|_q \right) \in K
and a trivialization over `U=\Phi^{-1}(V) \subset M` is obtained via
.. MATH::
(p,t) \mapsto \left(p, t^{1 \ldots 1}_{\phantom{1 \ldots 1} \, 1 \ldots 1},
\dots, t^{n \ldots n}_{\phantom{n \ldots n} \, n \ldots n} \right)
\in U \times K^{n^{(k+l)}}.
The standard case of a tensor bundle over a differentiable manifold
corresponds to `M=N` and `\Phi = \mathrm{Id}_M`. Other common cases are
`\Phi` being an immersion and `\Phi` being a curve in `N` (`M` is then an
open interval of `\RR`).
INPUT:
- ``base_space`` -- the base space (differentiable manifold) `M` over which
the tensor bundle is defined
- ``k`` -- the contravariant rank of the corresponding tensor bundle
- ``l`` -- the covariant rank of the corresponding tensor bundle
- ``dest_map`` -- (default: ``None``) destination map
`\Phi:\ M \rightarrow N`
(type: :class:`~sage.manifolds.differentiable.diff_map.DiffMap`); if
``None``, it is assumed that `M=M` and `\Phi` is the identity map of
`M` (case of the standard tensor bundle over `M`)
EXAMPLES:
Pullback tangent bundle of `R^2` along a curve `\Phi`::
sage: M = Manifold(2, 'M')
sage: c_cart.<x,y> = M.chart()
sage: R = Manifold(1, 'R')
sage: T.<t> = R.chart() # canonical chart on R
sage: Phi = R.diff_map(M, [cos(t), sin(t)], name='Phi') ; Phi
Differentiable map Phi from the 1-dimensional differentiable manifold R
to the 2-dimensional differentiable manifold M
sage: Phi.display()
Phi: R → M
t ↦ (x, y) = (cos(t), sin(t))
sage: PhiTM = R.tangent_bundle(dest_map=Phi); PhiTM
Tangent bundle Phi^*TM over the 1-dimensional differentiable manifold R
along the Differentiable map Phi from the 1-dimensional differentiable
manifold R to the 2-dimensional differentiable manifold M
The section module is the corresponding tensor field module::
sage: R_tensor_module = R.tensor_field_module((1,0), dest_map=Phi)
sage: R_tensor_module is PhiTM.section_module()
True
"""
def __init__(self, base_space, k, l, dest_map=None):
r"""
Construct a tensor bundle.
TESTS::
sage: M = Manifold(2, 'M')
sage: N = Manifold(2, 'N')
sage: Phi = M.diff_map(N, name='Phi')
sage: from sage.manifolds.differentiable.vector_bundle import TensorBundle
sage: TensorBundle(M, 1, 2, dest_map=Phi)
Tensor bundle Phi^*T^(1,2)N over the 2-dimensional differentiable
manifold M along the Differentiable map Phi from the 2-dimensional
differentiable manifold M to the 2-dimensional differentiable
manifold N
"""
if dest_map is None:
self._dest_map = base_space.identity_map()
else:
self._dest_map = dest_map
self._ambient_domain = self._dest_map._codomain
self._tensor_type = (k, l)
# Set total space name:
if not self._dest_map.is_identity():
if self._dest_map._name is None:
name = "(unnamed map)^*"
else:
name = self._dest_map._name + "^*"
if self._dest_map._latex_name is None:
latex_name = r'\text{(unnamed map)}^* '
else:
latex_name = self._dest_map._latex_name + r'^* '
else:
name = ""
latex_name = ""
if self._tensor_type == (1, 0):
name += "T{}".format(self._ambient_domain._name)
latex_name += r'T{}'.format(self._ambient_domain._latex_name)
elif self._tensor_type == (0, 1):
name += "T*{}".format(self._ambient_domain._name)
latex_name += r'T^*{}'.format(self._ambient_domain._latex_name)
else:
name += "T^({},{}){}".format(k, l, self._ambient_domain._name)
latex_name += r'T^{(' + str(k) + r',' + str(l) + r')}' + \
self._ambient_domain._latex_name
# Initialize differentiable vector bundle:
rank = self._ambient_domain.dim() ** (k + l)
DifferentiableVectorBundle.__init__(self, rank, name, base_space,
field=base_space._field,
latex_name=latex_name)
def _init_derived(self):
r"""
Initialize the derived quantities.
TESTS::
sage: M = Manifold(2, 'M')
sage: TM = M.tangent_bundle()
sage: TM._init_derived()
"""
self._def_frame = None
def _repr_(self):
r"""
String representation of ``self``.
TESTS::
sage: M = Manifold(2, 'M')
sage: TM = M.tangent_bundle()
sage: TM # indirect doctest
Tangent bundle TM over the 2-dimensional differentiable manifold M
sage: repr(TM) # indirect doctest
'Tangent bundle TM over the 2-dimensional differentiable manifold M'
sage: TM._repr_()
'Tangent bundle TM over the 2-dimensional differentiable manifold M'
sage: cTM = M.cotangent_bundle()
sage: cTM._repr_()
'Cotangent bundle T*M over the 2-dimensional differentiable
manifold M'
sage: T12M = M.tensor_bundle(1, 2)
sage: T12M._repr_()
'Tensor bundle T^(1,2)M over the 2-dimensional differentiable
manifold M'
"""
if self._tensor_type == (1, 0):
desc = "Tangent bundle "
elif self._tensor_type == (0, 1):
desc = "Cotangent bundle "
else:
desc = "Tensor bundle "
desc += self._name + " over the {}".format(self._base_space)
if not self._dest_map.is_identity():
desc += " along the {}".format(self._dest_map)
return desc
def fiber(self, point):
r"""
Return the tensor bundle fiber over a point.
INPUT:
- ``point`` -- :class:`~sage.manifolds.point.ManifoldPoint`;
point `p` of the base manifold of ``self``
OUTPUT:
- an instance of :class:`~sage.tensor.modules.finite_rank_free_module.FiniteRankFreeModule`
representing the tensor bundle fiber over `p`
EXAMPLES::
sage: M = Manifold(3, 'M')
sage: X.<x,y,z> = M.chart()
sage: p = M((0,2,1), name='p'); p
Point p on the 3-dimensional differentiable manifold M
sage: TM = M.tangent_bundle(); TM
Tangent bundle TM over the 3-dimensional differentiable manifold M
sage: TM.fiber(p)
Tangent space at Point p on the 3-dimensional differentiable
manifold M
sage: TM.fiber(p) is M.tangent_space(p)
True
::
sage: T11M = M.tensor_bundle(1,1); T11M
Tensor bundle T^(1,1)M over the 3-dimensional differentiable
manifold M
sage: T11M.fiber(p)
Free module of type-(1,1) tensors on the Tangent space at Point p
on the 3-dimensional differentiable manifold M
sage: T11M.fiber(p) is M.tangent_space(p).tensor_module(1,1)
True
"""
amb_point = self._dest_map(point)
return self._ambient_domain.tangent_space(amb_point).tensor_module(*self._tensor_type)
def atlas(self):
r"""
Return the list of charts that have been defined on the codomain of the
destination map.
.. NOTE::
Since an atlas of charts gives rise to an atlas of trivializations,
this method directly invokes
:meth:`~sage.manifolds.manifold.TopologicalManifold.atlas`
of the class
:class:`~sage.manifolds.manifold.TopologicalManifold`.
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: TM = M.tangent_bundle()
sage: TM.atlas()
[Chart (M, (x, y)), Chart (M, (u, v))]
"""
return self._base_space.atlas()
def section_module(self, domain=None):
r"""
Return the section module on ``domain``, namely the corresponding
tensor field module, of ``self`` on ``domain``.
.. NOTE::
This method directly invokes
:meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.tensor_field_module`
of the class
:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`.
INPUT:
- ``domain`` -- (default: ``None``) the domain of the corresponding
section module; if ``None``, the base space is assumed
OUTPUT:
- a
:class:`~sage.manifolds.differentiable.tensorfield_module.TensorFieldModule`
(or if `N` is parallelizable, a
:class:`~sage.manifolds.differentiable.tensorfield_module.TensorFieldFreeModule`)
representing the module `\mathcal{T}^{(k,l)}(U,\Phi)` of type-`(k,l)`
tensor fields on the domain `U \subset M` taking values on
`\Phi(U) \subset N`
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: U = M.open_subset('U')
sage: TM = M.tangent_bundle()
sage: TUM = TM.section_module(domain=U); TUM
Module X(U) of vector fields on the Open subset U of the
2-dimensional differentiable manifold M
sage: TUM is U.tensor_field_module((1,0))
True
"""
if domain is None:
base_space = self.base_space()
return base_space.tensor_field_module(self._tensor_type,
dest_map=self._dest_map)
return domain.tensor_field_module(
self._tensor_type,
dest_map=self._dest_map.restrict(domain)
)
def section(self, *args, **kwargs):
r"""
Return a section of ``self`` on ``domain``, namely a tensor field on
the subset ``domain`` of the base space.
.. NOTE::
This method directly invokes
:meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.tensor_field`
of the class
:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`.
INPUT:
- ``comp`` -- (optional) either the components of the tensor field
with respect to the vector frame specified by the argument
``frame`` or a dictionary of components, the keys of which are vector
frames or pairs ``(f, c)`` where ``f`` is a vector frame and ``c``
the chart in which the components are expressed
- ``frame`` -- (default: ``None``; unused if ``comp`` is not given or
is a dictionary) vector frame in which the components are given; if
``None``, the default vector frame of ``self`` is assumed
- ``chart`` -- (default: ``None``; unused if ``comp`` is not given or
is a dictionary) coordinate chart in which the components are
expressed; if ``None``, the default chart on the domain of ``frame``
is assumed
- ``domain`` -- (default: ``None``) domain of the section; if ``None``,
``self.base_space()`` is assumed
- ``name`` -- (default: ``None``) name given to the tensor field
- ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
tensor field; if ``None``, the LaTeX symbol is set to ``name``
- ``sym`` -- (default: ``None``) a symmetry or a list of symmetries
among the tensor arguments: each symmetry is described by a tuple
containing the positions of the involved arguments, with the
convention ``position=0`` for the first argument; for instance:
* ``sym = (0,1)`` for a symmetry between the 1st and 2nd arguments
* ``sym = [(0,2), (1,3,4)]`` for a symmetry between the 1st and 3rd
arguments and a symmetry between the 2nd, 4th and 5th arguments
- ``antisym`` -- (default: ``None``) antisymmetry or list of
antisymmetries among the arguments, with the same convention as for
``sym``
OUTPUT:
- a :class:`~sage.manifolds.differentiable.tensorfield.TensorField`
(or if `N` is parallelizable, a
:class:`~sage.manifolds.differentiable.tensorfield_paral.TensorFieldParal`)
representing the defined tensor field on the domain `U \subset M`
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: U = M.open_subset('U') ; V = M.open_subset('V')
sage: M.declare_union(U,V) # M is the union of U and V
sage: c_xy.<x,y> = U.chart() ; c_uv.<u,v> = V.chart()
sage: transf = c_xy.transition_map(c_uv, (x+y, x-y),
....: intersection_name='W',
....: restrictions1= x>0,
....: restrictions2= u+v>0)
sage: inv = transf.inverse()
sage: W = U.intersection(V)
sage: eU = c_xy.frame() ; eV = c_uv.frame()
sage: T11M = M.tensor_bundle(1, 1); T11M
Tensor bundle T^(1,1)M over the 2-dimensional differentiable
manifold M
sage: t = T11M.section({eU: [[1, x], [0, 2]]}, name='t'); t
Tensor field t of type (1,1) on the 2-dimensional differentiable
manifold M
sage: t.display()
t = ∂/∂x⊗dx + x ∂/∂x⊗dy + 2 ∂/∂y⊗dy
An example of use with the arguments ``comp`` and ``domain``::
sage: TM = M.tangent_bundle()
sage: w = TM.section([-y, x], domain=U); w
Vector field on the Open subset U of the 2-dimensional
differentiable manifold M
sage: w.display()
-y ∂/∂x + x ∂/∂y
"""
nargs = [self._tensor_type[0], self._tensor_type[1]]
nargs.extend(args)
domain = kwargs.pop('domain', self._base_space)
kwargs['dest_map'] = self._dest_map.restrict(domain)
return domain.tensor_field(*nargs, **kwargs)
def set_change_of_frame(self, frame1, frame2, change_of_frame,
compute_inverse=True):
r"""
Relate two vector frames by an automorphism.
This updates the internal dictionary ``self._frame_changes`` of the
base space `M`.
.. SEEALSO::
For further details on frames on ``self`` see
:meth:`local_frame`.
.. NOTE::
Since frames on ``self`` are directly induced by vector frames on
the base space, this method directly invokes
:meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.set_change_of_frame`
of the class
:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`.
INPUT:
- ``frame1`` -- frame 1, denoted `(e_i)` below
- ``frame2`` -- frame 2, denoted `(f_i)` below
- ``change_of_frame`` -- instance of class
:class:`~sage.tensor.modules.free_module_automorphism.FreeModuleAutomorphism`
describing the automorphism `P` that relates the basis `(e_i)` to
the basis `(f_i)` according to `f_i = P(e_i)`
- ``compute_inverse`` -- boolean (default: ``True``); if set to ``True``, the inverse
automorphism is computed and the change from basis `(f_i)` to `(e_i)`
is set to it in the internal dictionary ``self._frame_changes``
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: c_xy.<x,y> = M.chart()
sage: e = M.vector_frame('e')
sage: f = M.vector_frame('f')
sage: a = M.automorphism_field()
sage: a[e,:] = [[1,2],[0,3]]
sage: TM = M.tangent_bundle()
sage: TM.set_change_of_frame(e, f, a)
sage: f[0].display(e)
f_0 = e_0
sage: f[1].display(e)
f_1 = 2 e_0 + 3 e_1
sage: e[0].display(f)
e_0 = f_0
sage: e[1].display(f)
e_1 = -2/3 f_0 + 1/3 f_1
sage: TM.change_of_frame(e,f)[e,:]
[1 2]
[0 3]
"""
if not frame1._domain.is_subset(self._ambient_domain):
raise ValueError("the frames must be defined on a subset of "
"the {}".format(self._ambient_domain))
frame1._domain.set_change_of_frame(frame1=frame1, frame2=frame2,
change_of_frame=change_of_frame,
compute_inverse=compute_inverse)
def change_of_frame(self, frame1, frame2):
r"""
Return a change of vector frames defined on the base space of ``self``.
.. SEEALSO::
For further details on frames on ``self`` see
:meth:`local_frame`.
.. NOTE::
Since frames on ``self`` are directly induced by vector frames on
the base space, this method directly invokes
:meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.change_of_frame`
of the class
:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`.
INPUT:
- ``frame1`` -- local frame 1
- ``frame2`` -- local frame 2
OUTPUT:
- a :class:`~sage.tensor.modules.free_module_automorphism.FreeModuleAutomorphism`
representing, at each point, the vector space automorphism `P` that
relates frame 1, `(e_i)` say, to frame 2, `(f_i)` say, according to
`f_i = P(e_i)`
EXAMPLES::
sage: M = Manifold(2, 'M')
sage: c_xy.<x,y> = M.chart()
sage: c_uv.<u,v> = M.chart()
sage: c_xy.transition_map(c_uv, (x+y, x-y))
Change of coordinates from Chart (M, (x, y)) to Chart (M, (u, v))
sage: TM = M.tangent_bundle()
sage: TM.change_of_frame(c_xy.frame(), c_uv.frame())
Field of tangent-space automorphisms on the 2-dimensional
differentiable manifold M
sage: TM.change_of_frame(c_xy.frame(), c_uv.frame())[:]
[ 1/2 1/2]
[ 1/2 -1/2]
sage: TM.change_of_frame(c_uv.frame(), c_xy.frame())
Field of tangent-space automorphisms on the 2-dimensional
differentiable manifold M
sage: TM.change_of_frame(c_uv.frame(), c_xy.frame())[:]
[ 1 1]
[ 1 -1]
sage: TM.change_of_frame(c_uv.frame(), c_xy.frame()) == \
....: M.change_of_frame(c_xy.frame(), c_uv.frame()).inverse()
True
"""
return self._base_space.change_of_frame(frame1=frame1, frame2=frame2)
def changes_of_frame(self):
r"""
Return the changes of vector frames defined on the base space of
``self`` with respect to the destination map.
.. SEEALSO::
For further details on frames on ``self`` see
:meth:`local_frame`.
OUTPUT:
- dictionary of automorphisms on the tangent bundle representing
the changes of frames, the keys being the pair of frames
EXAMPLES:
Let us consider a first vector frame on a 2-dimensional
differentiable manifold::
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: TM = M.tangent_bundle()
sage: e = X.frame(); e
Coordinate frame (M, (∂/∂x,∂/∂y))
At this stage, the dictionary of changes of frame is empty::
sage: TM.changes_of_frame()
{}
We introduce a second frame on the manifold, relating it to
frame ``e`` by a field of tangent space automorphisms::
sage: a = M.automorphism_field(name='a')
sage: a[:] = [[-y, x], [1, 2]]
sage: f = e.new_frame(a, 'f'); f
Vector frame (M, (f_0,f_1))
Then we have::
sage: TM.changes_of_frame() # random (dictionary output)
{(Coordinate frame (M, (∂/∂x,∂/∂y)),
Vector frame (M, (f_0,f_1))): Field of tangent-space
automorphisms on the 2-dimensional differentiable manifold M,
(Vector frame (M, (f_0,f_1)),
Coordinate frame (M, (∂/∂x,∂/∂y))): Field of tangent-space
automorphisms on the 2-dimensional differentiable manifold M}
Some checks::
sage: TM.changes_of_frame()[(e,f)] == a
True
sage: TM.changes_of_frame()[(f,e)] == a^(-1)
True
"""
base_cof = self._base_space.changes_of_frame()
# Filter out all frames with respect to dest_map:
cof = {}
for frames in base_cof:
if frames[0]._dest_map == self._dest_map:
cof[(frames[0], frames[1])] = base_cof[frames]
return cof
def frames(self):
r"""
Return the list of all vector frames defined on the base space of
``self`` with respect to the destination map.
.. SEEALSO::
For further details on frames on ``self`` see
:meth:`local_frame`.
OUTPUT: list of local frames defined on ``self``
EXAMPLES:
Vector frames on subsets of `\RR^2`::
sage: M = Manifold(2, 'R^2')
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
sage: TM = M.tangent_bundle()
sage: TM.frames()
[Coordinate frame (R^2, (∂/∂x,∂/∂y))]
sage: e = TM.vector_frame('e')
sage: TM.frames()
[Coordinate frame (R^2, (∂/∂x,∂/∂y)),
Vector frame (R^2, (e_0,e_1))]
sage: U = M.open_subset('U', coord_def={c_cart: x^2+y^2<1})
sage: TU = U.tangent_bundle()
sage: TU.frames()
[Coordinate frame (U, (∂/∂x,∂/∂y))]
sage: TM.frames()
[Coordinate frame (R^2, (∂/∂x,∂/∂y)),
Vector frame (R^2, (e_0,e_1)),
Coordinate frame (U, (∂/∂x,∂/∂y))]
List of vector frames of a tensor bundle of type `(1 ,1)` along a
curve::
sage: M = Manifold(2, 'M')
sage: c_cart.<x,y> = M.chart()
sage: e_cart = c_cart.frame() # standard basis
sage: R = Manifold(1, 'R')
sage: T.<t> = R.chart() # canonical chart on R
sage: Phi = R.diff_map(M, [cos(t), sin(t)], name='Phi') ; Phi
Differentiable map Phi from the 1-dimensional differentiable
manifold R to the 2-dimensional differentiable manifold M
sage: Phi.display()
Phi: R → M
t ↦ (x, y) = (cos(t), sin(t))
sage: PhiT11 = R.tensor_bundle(1, 1, dest_map=Phi); PhiT11
Tensor bundle Phi^*T^(1,1)M over the 1-dimensional differentiable
manifold R along the Differentiable map Phi from the 1-dimensional
differentiable manifold R to the 2-dimensional differentiable
manifold M
sage: f = PhiT11.local_frame(); f
Vector frame (R, (∂/∂x,∂/∂y)) with values on the 2-dimensional
differentiable manifold M
sage: PhiT11.frames()
[Vector frame (R, (∂/∂x,∂/∂y)) with values on the 2-dimensional
differentiable manifold M]
"""
if self._dest_map.is_identity():
return self._base_space.frames()
else:
# Filter out all frames with respect to dest_map:
frames = []
for frame in self._base_space.frames():
if frame._dest_map == self._dest_map:
frames.append(frame)
return frames
def coframes(self):
r"""
Return the list of coframes defined on the base manifold of ``self``
with respect to the destination map.
.. SEEALSO::
For further details on frames on ``self`` see
:meth:`local_frame`.
OUTPUT: list of coframes defined on ``self``
EXAMPLES:
Coframes on subsets of `\RR^2`::
sage: M = Manifold(2, 'R^2')
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2