Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

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

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

1013

1014

1015

1016

1017

1018

1019

1020

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1034

1035

1036

1037

1038

1039

1040

1041

1042

1043

1044

1045

1046

1047

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061

1062

1063

1064

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089

1090

1091

1092

1093

1094

1095

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121

1122

1123

1124

1125

1126

1127

1128

1129

1130

1131

1132

1133

1134

1135

1136

1137

1138

1139

1140

1141

1142

1143

1144

1145

1146

1147

1148

1149

1150

1151

1152

1153

1154

1155

1156

1157

1158

1159

1160

1161

1162

1163

1164

1165

1166

1167

1168

1169

1170

1171

1172

1173

1174

1175

1176

1177

1178

1179

1180

1181

1182

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195

1196

1197

1198

1199

1200

1201

1202

1203

1204

1205

1206

1207

1208

1209

1210

1211

1212

1213

1214

1215

1216

1217

1218

1219

1220

1221

1222

1223

1224

1225

1226

1227

1228

1229

1230

1231

1232

1233

1234

1235

1236

r""" 

Tangent-Space Automorphism Fields 

 

The class :class:`AutomorphismField` implements fields of automorphisms of 

tangent spaces to a generic (a priori not parallelizable) differentiable 

manifold, while the class :class:`AutomorphismFieldParal` 

is devoted to fields of automorphisms of tangent spaces to a parallelizable 

manifold. The latter play the important role of transitions between vector 

frames sharing the same domain on a differentiable manifold. 

 

AUTHORS: 

 

- Eric Gourgoulhon (2015): initial version 

- Travis Scrimshaw (2016): review tweaks 

 

""" 

 

#****************************************************************************** 

# Copyright (C) 2015 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr> 

# Copyright (C) 2016 Travis Scrimshaw <tscrimsh@umn.edu> 

# 

# 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. 

# http://www.gnu.org/licenses/ 

#****************************************************************************** 

 

from sage.tensor.modules.free_module_tensor import FreeModuleTensor 

from sage.tensor.modules.free_module_automorphism import FreeModuleAutomorphism 

from sage.manifolds.differentiable.tensorfield import TensorField 

from sage.manifolds.differentiable.tensorfield_paral import TensorFieldParal 

 

class AutomorphismField(TensorField): 

r""" 

Field of automorphisms of tangent spaces to a generic (a priori 

not parallelizable) differentiable manifold. 

 

Given a differentiable manifold `U` and a differentiable map 

`\Phi: U \rightarrow M` to a differentiable manifold `M`, 

a *field of tangent-space automorphisms along* `U` *with values on* 

`M \supset\Phi(U)` is a differentiable map 

 

.. MATH:: 

 

a:\ U \longrightarrow T^{(1,1)} M, 

 

with `T^{(1,1)} M` being the tensor bundle of type `(1,1)` over `M`, 

such that 

 

.. MATH:: 

 

\forall p \in U,\ a(p) \in \mathrm{Aut}(T_{\Phi(p)} M), 

 

i.e. `a(p)` is an automorphism of the tangent space to `M` at the 

point `\Phi(p)`. 

 

The standard case of a field of tangent-space automorphisms *on* a 

manifold corresponds to `U = M` and `\Phi = \mathrm{Id}_M`. Other 

common cases are `\Phi` being an immersion and `\Phi` being a curve 

in `M` (`U` is then an open interval of `\RR`). 

 

.. NOTE:: 

 

If `M` is parallelizable, then :class:`AutomorphismFieldParal` 

*must* be used instead. 

 

INPUT: 

 

- ``vector_field_module`` -- module `\mathfrak{X}(U,\Phi)` of vector 

fields along `U` with values on `M` via the map `\Phi` 

- ``name`` -- (default: ``None``) name given to the field 

- ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the field; 

if none is provided, the LaTeX symbol is set to ``name`` 

- ``is_identity`` -- (default: ``False``) determines whether the 

constructed object is a field of identity automorphisms 

 

EXAMPLES: 

 

Field of tangent-space automorphisms on a non-parallelizable 

2-dimensional manifold:: 

 

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: a = M.automorphism_field('a') ; a 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold M 

sage: a.parent() 

General linear group of the Module X(M) of vector fields on the 

2-dimensional differentiable manifold M 

 

We first define the components of `a` with respect to the 

coordinate frame on `U`:: 

 

sage: eU = c_xy.frame() ; eV = c_uv.frame() 

sage: a[eU,:] = [[1,x], [0,2]] 

 

We then set the components with respect to the coordinate frame 

on `V` by extending the expressions of the components in the 

corresponding subframe on `W = U \cap V`:: 

 

sage: W = U.intersection(V) 

sage: a.add_comp_by_continuation(eV, W, c_uv) 

 

At this stage, the automorphism field `a` is fully defined:: 

 

sage: a.display(eU) 

a = d/dx*dx + x d/dx*dy + 2 d/dy*dy 

sage: a.display(eV) 

a = (1/4*u + 1/4*v + 3/2) d/du*du + (-1/4*u - 1/4*v - 1/2) d/du*dv 

+ (1/4*u + 1/4*v - 1/2) d/dv*du + (-1/4*u - 1/4*v + 3/2) d/dv*dv 

 

In particular, we may ask for its inverse on the whole manifold `M`:: 

 

sage: ia = a.inverse() ; ia 

Field of tangent-space automorphisms a^(-1) on the 2-dimensional 

differentiable manifold M 

sage: ia.display(eU) 

a^(-1) = d/dx*dx - 1/2*x d/dx*dy + 1/2 d/dy*dy 

sage: ia.display(eV) 

a^(-1) = (-1/8*u - 1/8*v + 3/4) d/du*du + (1/8*u + 1/8*v + 1/4) d/du*dv 

+ (-1/8*u - 1/8*v + 1/4) d/dv*du + (1/8*u + 1/8*v + 3/4) d/dv*dv 

 

Equivalently, one can use the power minus one to get the inverse:: 

 

sage: ia is a^(-1) 

True 

 

or the operator ``~``:: 

 

sage: ia is ~a 

True 

 

""" 

def __init__(self, vector_field_module, name=None, latex_name=None, 

is_identity=False): 

r""" 

Construct a field of tangent-space automorphisms on a 

non-parallelizable manifold. 

 

TESTS: 

 

Construction via ``parent.element_class``, and not via a direct call 

to ``AutomorphismField``, to fit with the category framework:: 

 

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: XM = M.vector_field_module() 

sage: GL = XM.general_linear_group() 

sage: a = GL.element_class(XM, name='a'); a 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold M 

sage: a[c_xy.frame(), :] = [[1+x^2, 0], [0, 1+y^2]] 

sage: a.add_comp_by_continuation(c_uv.frame(), U.intersection(V), c_uv) 

sage: TestSuite(a).run(skip='_test_pickling') 

 

Construction of the identity field:: 

 

sage: b = GL.element_class(XM, is_identity=True); b 

Field of tangent-space identity maps on the 2-dimensional 

differentiable manifold M 

sage: TestSuite(b).run(skip='_test_pickling') 

 

Construction with ``DifferentiableManifold.automorphism_field``:: 

 

sage: a1 = M.automorphism_field(name='a'); a1 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold M 

sage: type(a1) == type(a) 

True 

 

.. TODO:: 

 

Fix ``_test_pickling`` (in the superclass :class:`TensorField`). 

 

""" 

if is_identity: 

if name is None: 

name = 'Id' 

if latex_name is None and name == 'Id': 

latex_name = r'\mathrm{Id}' 

TensorField.__init__(self, vector_field_module, (1,1), name=name, 

latex_name=latex_name, 

parent=vector_field_module.general_linear_group()) 

self._is_identity = is_identity 

self._init_derived() # initialization of derived quantities 

# Specific initializations for the field of identity maps: 

if self._is_identity: 

self._inverse = self 

for dom in self._domain._subsets: 

if dom.is_manifestly_parallelizable(): 

fmodule = dom.vector_field_module() 

self._restrictions[dom] = fmodule.identity_map(name=name, 

latex_name=latex_name) 

 

def _repr_(self): 

r""" 

Return a string representation of ``self``. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') 

sage: a = M.automorphism_field(name='a') 

sage: a._repr_() 

'Field of tangent-space automorphisms a on the 2-dimensional differentiable manifold M' 

sage: repr(a) # indirect doctest 

'Field of tangent-space automorphisms a on the 2-dimensional differentiable manifold M' 

sage: a # indirect doctest 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold M 

 

""" 

description = "Field of tangent-space " 

if self._is_identity: 

description += "identity maps " 

else: 

description += "automorphisms " 

if self._name is not None: 

description += self._name + " " 

return self._final_repr(description) 

 

def _init_derived(self): 

r""" 

Initialize the derived quantities. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') 

sage: a = M.automorphism_field(name='a') 

sage: a._init_derived() 

 

""" 

TensorField._init_derived(self) 

self._inverse = None # inverse not set yet 

 

def _del_derived(self): 

r""" 

Delete the derived quantities. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') 

sage: a = M.automorphism_field(name='a') 

sage: a._del_derived() 

 

""" 

# First delete the derived quantities pertaining to the mother class: 

TensorField._del_derived(self) 

# then deletes the inverse automorphism: 

self._inverse = None 

 

def _new_instance(self): 

r""" 

Create an instance of the same class as ``self`` on the same 

vector field module. 

 

TESTS:: 

 

sage: M = Manifold(5, 'M') 

sage: a = M.automorphism_field(name='a') 

sage: a._new_instance() 

Field of tangent-space automorphisms on the 5-dimensional 

differentiable manifold M 

sage: a._new_instance().parent() is a.parent() 

True 

 

""" 

return type(self)(self._vmodule) 

 

def __call__(self, *arg): 

r""" 

Redefinition of 

:meth:`~sage.manifolds.differentiable.tensorfield.TensorField.__call__` 

to allow for a proper treatment of the identity map and of the call 

with a single argument 

 

TESTS: 

 

Field of identity maps on the 2-sphere:: 

 

sage: M = Manifold(2, 'M') # the 2-dimensional sphere S^2 

sage: U = M.open_subset('U') # complement of the North pole 

sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole 

sage: V = M.open_subset('V') # complement of the South pole 

sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole 

sage: M.declare_union(U,V) # S^2 is the union of U and V 

sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), 

....: intersection_name='W', restrictions1= x^2+y^2!=0, 

....: restrictions2= u^2+v^2!=0) 

sage: uv_to_xy = xy_to_uv.inverse() 

sage: e_xy = c_xy.frame(); e_uv = c_uv.frame() 

sage: w = M.vector_field(name='w') 

sage: w[e_xy, :] = [3, 1] 

sage: w.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: z = M.one_form(name='z') 

sage: z[e_xy, :] = [-y, x] 

sage: z.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: Id = M.tangent_identity_field() 

sage: s = Id(w); s 

Vector field w on the 2-dimensional differentiable manifold M 

sage: s == w 

True 

sage: s = Id(z, w); s 

Scalar field z(w) on the 2-dimensional differentiable manifold M 

sage: s == z(w) 

True 

 

Field of automorphisms on the 2-sphere:: 

 

sage: a = M.automorphism_field(name='a') 

sage: a[e_xy, :] = [[-1, 0], [0, 1]] 

sage: a.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

 

Call with a single argument:: 

 

sage: s = a(w); s 

Vector field a(w) on the 2-dimensional differentiable manifold M 

sage: s.display(e_xy) 

a(w) = -3 d/dx + d/dy 

sage: s.display(e_uv) 

a(w) = (3*u^2 - 2*u*v - 3*v^2) d/du + (u^2 + 6*u*v - v^2) d/dv 

sage: s.restrict(U) == a.restrict(U)(w.restrict(U)) 

True 

sage: s.restrict(V) == a.restrict(V)(w.restrict(V)) 

True 

sage: s.restrict(U) == a(w.restrict(U)) 

True 

sage: s.restrict(U) == a.restrict(U)(w) 

True 

 

Call with two arguments:: 

 

sage: s = a(z, w); s 

Scalar field a(z,w) on the 2-dimensional differentiable manifold M 

sage: s.display() 

a(z,w): M --> R 

on U: (x, y) |--> x + 3*y 

on V: (u, v) |--> (u + 3*v)/(u^2 + v^2) 

sage: s.restrict(U) == a.restrict(U)(z.restrict(U), w.restrict(U)) 

True 

sage: s.restrict(V) == a.restrict(V)(z.restrict(V), w.restrict(V)) 

True 

sage: s.restrict(U) == a(z.restrict(U), w.restrict(U)) 

True 

sage: s.restrict(U) == a(z, w.restrict(U)) 

True 

 

""" 

if self._is_identity: 

if len(arg) == 1: 

# The identity map acting as such, on a vector field: 

vector = arg[0] 

if vector._tensor_type != (1,0): 

raise TypeError("the argument must be a vector field") 

dom = self._domain.intersection(vector._domain) 

return vector.restrict(dom) 

elif len(arg) == 2: 

# self acting as a type-(1,1) tensor on a pair 

# (1-form, vector field), returning a scalar field: 

oneform = arg[0] 

vector = arg[1] 

dom = self._domain.intersection( 

oneform._domain).intersection(vector._domain) 

return oneform.restrict(dom)(vector.restrict(dom)) 

else: 

raise TypeError("wrong number of arguments") 

# Generic case 

if len(arg) == 1: 

# The field of automorphisms acting on a vector field: 

vector = arg[0] 

if vector._tensor_type != (1,0): 

raise TypeError("the argument must be a vector field") 

dom = self._domain.intersection(vector._domain) 

vector_dom = vector.restrict(dom) 

if dom != self._domain: 

return self.restrict(dom)(vector_dom) 

resu = dom.vector_field() 

if self._name is not None and vector._name is not None: 

resu._name = self._name + "(" + vector._name + ")" 

if self._latex_name is not None and vector._latex_name is not None: 

resu._latex_name = self._latex_name + r"\left(" + \ 

vector._latex_name + r"\right)" 

for sdom, automorph in self._restrictions.items(): 

resu._restrictions[sdom] = automorph(vector_dom.restrict(sdom)) 

return resu 

# Case of 2 arguments: 

return TensorField.__call__(self, *arg) 

 

 

#### MultiplicativeGroupElement methods #### 

 

def __invert__(self): 

r""" 

Return the inverse automorphism of ``self``. 

 

EXAMPLES: 

 

Inverse of a field of tangent-space automorphisms on a 

non-parallelizable 2-dimensional manifold:: 

 

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: a = M.automorphism_field('a') 

sage: eU = c_xy.frame() ; eV = c_uv.frame() 

sage: a[eU,:] = [[1,x], [0,2]] 

sage: W = U.intersection(V) 

sage: a.add_comp_by_continuation(eV, W, c_uv) 

sage: ia = a.inverse() ; ia 

Field of tangent-space automorphisms a^(-1) on the 2-dimensional 

differentiable manifold M 

sage: a[eU,:], ia[eU,:] 

( 

[1 x] [ 1 -1/2*x] 

[0 2], [ 0 1/2] 

) 

sage: a[eV,:], ia[eV,:] 

( 

[ 1/4*u + 1/4*v + 3/2 -1/4*u - 1/4*v - 1/2] 

[ 1/4*u + 1/4*v - 1/2 -1/4*u - 1/4*v + 3/2], 

[-1/8*u - 1/8*v + 3/4 1/8*u + 1/8*v + 1/4] 

[-1/8*u - 1/8*v + 1/4 1/8*u + 1/8*v + 3/4] 

) 

 

Let us check that ia is indeed the inverse of a:: 

 

sage: s = a.contract(ia) 

sage: s[eU,:], s[eV,:] 

( 

[1 0] [1 0] 

[0 1], [0 1] 

) 

sage: s = ia.contract(a) 

sage: s[eU,:], s[eV,:] 

( 

[1 0] [1 0] 

[0 1], [0 1] 

) 

 

The result is cached:: 

 

sage: a.inverse() is ia 

True 

 

Instead of ``inverse()``, one can use the power minus one to get the 

inverse:: 

 

sage: ia is a^(-1) 

True 

 

or the operator ``~``:: 

 

sage: ia is ~a 

True 

 

""" 

if self._is_identity: 

return self 

if self._inverse is None: 

if self._name is None: 

inv_name = None 

else: 

inv_name = self._name + '^(-1)' 

if self._latex_name is None: 

inv_latex_name = None 

else: 

inv_latex_name = self._latex_name + r'^{-1}' 

self._inverse = self._vmodule.automorphism(name=inv_name, 

latex_name=inv_latex_name) 

for dom, rst in self._restrictions.items(): 

self._inverse._restrictions[dom] = rst.inverse() 

return self._inverse 

 

inverse = __invert__ 

 

def _mul_(self, other): 

r""" 

Automorphism composition. 

 

This implements the group law of `GL(X(U,\Phi))`, with `X(U,\Phi)` 

being the module of ``self``. 

 

INPUT: 

 

- ``other`` -- an automorphism of the same module as ``self`` 

 

OUTPUT: 

 

- the automorphism resulting from the composition of ``other`` and 

``self`` 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') # the 2-dimensional sphere S^2 

sage: U = M.open_subset('U') # complement of the North pole 

sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole 

sage: V = M.open_subset('V') # complement of the South pole 

sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole 

sage: M.declare_union(U,V) # S^2 is the union of U and V 

sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), 

....: intersection_name='W', restrictions1= x^2+y^2!=0, 

....: restrictions2= u^2+v^2!=0) 

sage: uv_to_xy = xy_to_uv.inverse() 

sage: e_xy = c_xy.frame(); e_uv = c_uv.frame() 

sage: a = M.automorphism_field(name='a') 

sage: a[e_xy, :] = [[-1, 0], [0, 1]] 

sage: a.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: b = M.automorphism_field(name='b') 

sage: b[e_uv, :] = [[1, 0], [0, -2]] 

sage: b.add_comp_by_continuation(e_xy, U.intersection(V), c_xy) 

sage: s = a._mul_(b); s 

Field of tangent-space automorphisms on the 2-dimensional 

differentiable manifold M 

sage: s.display(e_xy) 

-(x^4 - 10*x^2*y^2 + y^4)/(x^4 + 2*x^2*y^2 + y^4) d/dx*dx 

- 6*(x^3*y - x*y^3)/(x^4 + 2*x^2*y^2 + y^4) d/dx*dy 

+ 6*(x^3*y - x*y^3)/(x^4 + 2*x^2*y^2 + y^4) d/dy*dx 

- 2*(x^4 - 4*x^2*y^2 + y^4)/(x^4 + 2*x^2*y^2 + y^4) d/dy*dy 

sage: s.display(e_uv) 

-(u^4 - 6*u^2*v^2 + v^4)/(u^4 + 2*u^2*v^2 + v^4) d/du*du 

+ 8*(u^3*v - u*v^3)/(u^4 + 2*u^2*v^2 + v^4) d/du*dv 

- 4*(u^3*v - u*v^3)/(u^4 + 2*u^2*v^2 + v^4) d/dv*du 

- 2*(u^4 - 6*u^2*v^2 + v^4)/(u^4 + 2*u^2*v^2 + v^4) d/dv*dv 

sage: w = M.vector_field(name='w') 

sage: w[e_xy, :] = [3, 1] 

sage: w.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: s(w) == a(b(w)) # long time 

True 

 

""" 

# No need for consistency check since self and other are guaranteed 

# to have the same parent. In particular, they are defined on the same 

# module. 

# 

# Special cases: 

if self._is_identity: 

return other 

if other._is_identity: 

return self 

if other is self._inverse or self is other._inverse: 

return self.parent().one() 

# General case: 

resu = type(self)(self._vmodule) 

for dom in self._common_subdomains(other): 

resu._restrictions[dom] = (self._restrictions[dom] 

* other._restrictions[dom]) 

return resu 

 

#### End of MultiplicativeGroupElement methods #### 

 

def __mul__(self, other): 

r""" 

Redefinition of 

:meth:`~sage.manifolds.differentiable.tensorfield.TensorField.__mul__` 

so that ``*`` dispatches either to automorphism composition or 

to the tensor product. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') # the 2-dimensional sphere S^2 

sage: U = M.open_subset('U') # complement of the North pole 

sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole 

sage: V = M.open_subset('V') # complement of the South pole 

sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole 

sage: M.declare_union(U,V) # S^2 is the union of U and V 

sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), 

....: intersection_name='W', restrictions1= x^2+y^2!=0, 

....: restrictions2= u^2+v^2!=0) 

sage: uv_to_xy = xy_to_uv.inverse() 

sage: e_xy = c_xy.frame(); e_uv = c_uv.frame() 

sage: a = M.automorphism_field(name='a') 

sage: a[e_xy, :] = [[-1, 0], [0, 1]] 

sage: a.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: b = M.automorphism_field(name='b') 

sage: b[e_uv, :] = [[1, 0], [0, -2]] 

sage: b.add_comp_by_continuation(e_xy, U.intersection(V), c_xy) 

sage: w = M.vector_field(name='w') 

sage: w[e_xy, :] = [3, 1] 

sage: w.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: s = a.__mul__(b); s # automorphism composition 

Field of tangent-space automorphisms on the 2-dimensional differentiable manifold M 

sage: s(w) == a(b(w)) # long time 

True 

sage: s = a.__mul__(w); s # tensor product 

Tensor field of type (2,1) on the 2-dimensional differentiable manifold M 

 

""" 

if isinstance(other, AutomorphismField): 

return self._mul_(other) # general linear group law 

else: 

return TensorField.__mul__(self, other) # tensor product 

 

def __imul__(self, other): 

r""" 

Redefinition of 

:meth:`~sage.manifolds.differentiable.tensorfield.TensorField.__imul__` 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') # the 2-dimensional sphere S^2 

sage: U = M.open_subset('U') # complement of the North pole 

sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole 

sage: V = M.open_subset('V') # complement of the South pole 

sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole 

sage: M.declare_union(U,V) # S^2 is the union of U and V 

sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), 

....: intersection_name='W', restrictions1= x^2+y^2!=0, 

....: restrictions2= u^2+v^2!=0) 

sage: uv_to_xy = xy_to_uv.inverse() 

sage: e_xy = c_xy.frame(); e_uv = c_uv.frame() 

sage: a = M.automorphism_field(name='a') 

sage: a[e_xy, :] = [[-1, 0], [0, 1]] 

sage: a.add_comp_by_continuation(e_uv, U.intersection(V), c_uv) 

sage: b = M.automorphism_field(name='b') 

sage: b[e_uv, :] = [[1, 0], [0, -2]] 

sage: b.add_comp_by_continuation(e_xy, U.intersection(V), c_xy) 

sage: a.__imul__(b) 

Field of tangent-space automorphisms on the 2-dimensional differentiable manifold M 

sage: s = a*b 

sage: a *= b 

sage: a == s 

True 

 

""" 

return self.__mul__(other) 

 

def restrict(self, subdomain, dest_map=None): 

r""" 

Return the restriction of ``self`` to some subdomain. 

 

This is a redefinition of 

:meth:`sage.manifolds.differentiable.tensorfield.TensorField.restrict` 

to take into account the identity map. 

 

INPUT: 

 

- ``subdomain`` -- 

:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold` 

open subset `V` of ``self._domain`` 

- ``dest_map`` -- (default: ``None``) 

:class:`~sage.manifolds.differentiable.diff_map.DiffMap`; 

destination map `\Phi:\ V \rightarrow N`, where `N` is a 

subdomain of ``self._codomain``; if ``None``, the restriction 

of ``self.base_module().destination_map()`` to `V` is used 

 

OUTPUT: 

 

- a :class:`AutomorphismField` representing the restriction 

 

EXAMPLES: 

 

Restrictions of an automorphism field on the 2-sphere:: 

 

sage: M = Manifold(2, 'S^2', start_index=1) 

sage: U = M.open_subset('U') # the complement of the North pole 

sage: stereoN.<x,y> = U.chart() # stereographic coordinates from the North pole 

sage: eN = stereoN.frame() # the associated vector frame 

sage: V = M.open_subset('V') # the complement of the South pole 

sage: stereoS.<u,v> = V.chart() # stereographic coordinates from the South pole 

sage: eS = stereoS.frame() # the associated vector frame 

sage: transf = stereoN.transition_map(stereoS, (x/(x^2+y^2), y/(x^2+y^2)), intersection_name='W', \ 

restrictions1= x^2+y^2!=0, restrictions2= u^2+v^2!=0) 

sage: inv = transf.inverse() # transformation from stereoS to stereoN 

sage: W = U.intersection(V) # the complement of the North and South poles 

sage: stereoN_W = W.atlas()[0] # restriction of stereographic coord. from North pole to W 

sage: stereoS_W = W.atlas()[1] # restriction of stereographic coord. from South pole to W 

sage: eN_W = stereoN_W.frame() ; eS_W = stereoS_W.frame() 

sage: a = M.automorphism_field(name='a') ; a 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold S^2 

sage: a[eN,:] = [[1, atan(x^2+y^2)], [0,3]] 

sage: a.add_comp_by_continuation(eS, W, chart=stereoS) 

sage: a.restrict(U) 

Field of tangent-space automorphisms a on the Open subset U of the 

2-dimensional differentiable manifold S^2 

sage: a.restrict(U)[eN,:] 

[ 1 arctan(x^2 + y^2)] 

[ 0 3] 

sage: a.restrict(V) 

Field of tangent-space automorphisms a on the Open subset V of the 

2-dimensional differentiable manifold S^2 

sage: a.restrict(V)[eS,:] 

[ (u^4 + 10*u^2*v^2 + v^4 + 2*(u^3*v - u*v^3)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4) -(4*u^3*v - 4*u*v^3 + (u^4 - 2*u^2*v^2 + v^4)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4)] 

[ 4*(u^2*v^2*arctan(1/(u^2 + v^2)) - u^3*v + u*v^3)/(u^4 + 2*u^2*v^2 + v^4) (3*u^4 - 2*u^2*v^2 + 3*v^4 - 2*(u^3*v - u*v^3)*arctan(1/(u^2 + v^2)))/(u^4 + 2*u^2*v^2 + v^4)] 

sage: a.restrict(W) 

Field of tangent-space automorphisms a on the Open subset W of the 

2-dimensional differentiable manifold S^2 

sage: a.restrict(W)[eN_W,:] 

[ 1 arctan(x^2 + y^2)] 

[ 0 3] 

 

Restrictions of the field of tangent-space identity maps:: 

 

sage: id = M.tangent_identity_field() ; id 

Field of tangent-space identity maps on the 2-dimensional 

differentiable manifold S^2 

sage: id.restrict(U) 

Field of tangent-space identity maps on the Open subset U of the 

2-dimensional differentiable manifold S^2 

sage: id.restrict(U)[eN,:] 

[1 0] 

[0 1] 

sage: id.restrict(V) 

Field of tangent-space identity maps on the Open subset V of the 

2-dimensional differentiable manifold S^2 

sage: id.restrict(V)[eS,:] 

[1 0] 

[0 1] 

sage: id.restrict(W)[eN_W,:] 

[1 0] 

[0 1] 

sage: id.restrict(W)[eS_W,:] 

[1 0] 

[0 1] 

 

""" 

if subdomain == self._domain: 

return self 

if subdomain not in self._restrictions: 

if not self._is_identity: 

return TensorField.restrict(self, subdomain, dest_map=dest_map) 

# Special case of the identity map: 

if not subdomain.is_subset(self._domain): 

raise ValueError("the provided domain is not a subset of " + 

"the field's domain") 

if dest_map is None: 

dest_map = self._vmodule._dest_map.restrict(subdomain) 

elif not dest_map._codomain.is_subset(self._ambient_domain): 

raise ValueError("the argument 'dest_map' is not compatible " + 

"with the ambient domain of " + 

"the {}".format(self)) 

smodule = subdomain.vector_field_module(dest_map=dest_map) 

self._restrictions[subdomain] = smodule.identity_map() 

return self._restrictions[subdomain] 

 

 

#****************************************************************************** 

 

class AutomorphismFieldParal(FreeModuleAutomorphism, TensorFieldParal): 

r""" 

Field of tangent-space automorphisms with values on a parallelizable 

manifold. 

 

Given a differentiable manifold `U` and a differentiable map 

`\Phi: U \rightarrow M` to a parallelizable manifold `M`, 

a *field of tangent-space automorphisms along* `U` *with values on* 

`M\supset\Phi(U)` is a differentiable map 

 

.. MATH:: 

 

a:\ U \longrightarrow T^{(1,1)}M 

 

(`T^{(1,1)}M` being the tensor bundle of type `(1,1)` over `M`) such 

that 

 

.. MATH:: 

 

\forall p \in U,\ a(p) \in \mathrm{Aut}(T_{\Phi(p)} M) 

 

i.e. `a(p)` is an automorphism of the tangent space to `M` at the point 

`\Phi(p)`. 

 

The standard case of a field of tangent-space automorphisms *on* a 

manifold corresponds to `U=M` and `\Phi = \mathrm{Id}_M`. Other 

common cases are `\Phi` being an immersion and `\Phi` being a curve in `M` 

(`U` is then an open interval of `\RR`). 

 

.. NOTE:: 

 

If `M` is not parallelizable, the class :class:`AutomorphismField` 

*must* be used instead. 

 

INPUT: 

 

- ``vector_field_module`` -- free module `\mathfrak{X}(U,\Phi)` of vector 

fields along `U` with values on `M` via the map `\Phi` 

- ``name`` -- (default: ``None``) name given to the field 

- ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the field; 

if none is provided, the LaTeX symbol is set to ``name`` 

- ``is_identity`` -- (default: ``False``) determines whether the 

constructed object is a field of identity automorphisms 

 

EXAMPLES: 

 

A `\pi/3`-rotation in the Euclidean 2-plane:: 

 

sage: M = Manifold(2,'R^2') 

sage: c_xy.<x,y> = M.chart() 

sage: rot = M.automorphism_field('R') ; rot 

Field of tangent-space automorphisms R on the 2-dimensional 

differentiable manifold R^2 

sage: rot[:] = [[sqrt(3)/2, -1/2], [1/2, sqrt(3)/2]] 

sage: rot.parent() 

General linear group of the Free module X(R^2) of vector fields on the 

2-dimensional differentiable manifold R^2 

 

The inverse automorphism is obtained via the method :meth:`inverse`:: 

 

sage: inv = rot.inverse() ; inv 

Field of tangent-space automorphisms R^(-1) on the 2-dimensional 

differentiable manifold R^2 

sage: latex(inv) 

R^{-1} 

sage: inv[:] 

[1/2*sqrt(3) 1/2] 

[ -1/2 1/2*sqrt(3)] 

sage: rot[:] 

[1/2*sqrt(3) -1/2] 

[ 1/2 1/2*sqrt(3)] 

sage: inv[:] * rot[:] # check 

[1 0] 

[0 1] 

 

Equivalently, one can use the power minus one to get the inverse:: 

 

sage: inv is rot^(-1) 

True 

 

or the operator ``~``:: 

 

sage: inv is ~rot 

True 

 

""" 

def __init__(self, vector_field_module, name=None, latex_name=None, 

is_identity=False): 

r""" 

Construct a field of tangent-space automorphisms. 

 

TESTS: 

 

Construction via ``parent.element_class``, and not via a direct call 

to ``AutomorphismFieldParal``, to fit with the category framework:: 

 

sage: M = Manifold(2, 'M') 

sage: X.<x,y> = M.chart() # makes M parallelizable 

sage: XM = M.vector_field_module() 

sage: GL = XM.general_linear_group() 

sage: a = GL.element_class(XM, name='a'); a 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold M 

sage: a[:] = [[1+x^2, x*y], [0, 1+y^2]] 

sage: a.parent() 

General linear group of the Free module X(M) of vector fields on 

the 2-dimensional differentiable manifold M 

sage: a.parent() is M.automorphism_field_group() 

True 

sage: TestSuite(a).run() 

 

Construction of the field of identity maps:: 

 

sage: b = GL.element_class(XM, is_identity=True); b 

Field of tangent-space identity maps on the 2-dimensional 

differentiable manifold M 

sage: b[:] 

[1 0] 

[0 1] 

sage: TestSuite(b).run() 

 

""" 

FreeModuleAutomorphism.__init__(self, vector_field_module, 

name=name, latex_name=latex_name, 

is_identity=is_identity) 

# TensorFieldParal attributes: 

self._vmodule = vector_field_module 

self._domain = vector_field_module._domain 

self._ambient_domain = vector_field_module._ambient_domain 

# Initialization of derived quantities: 

TensorFieldParal._init_derived(self) 

 

def _repr_(self): 

r""" 

Return a string representation of ``self``. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') 

sage: X.<x,y> = M.chart() 

sage: a = M.automorphism_field(name='a') 

sage: a._repr_() 

'Field of tangent-space automorphisms a on the 2-dimensional differentiable manifold M' 

sage: repr(a) # indirect doctest 

'Field of tangent-space automorphisms a on the 2-dimensional differentiable manifold M' 

sage: a # indirect doctest 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold M 

 

""" 

description = "Field of tangent-space " 

if self._is_identity: 

description += "identity maps " 

else: 

description += "automorphisms " 

if self._name is not None: 

description += self._name + " " 

return self._final_repr(description) 

 

def _del_derived(self, del_restrictions=True): 

r""" 

Delete the derived quantities. 

 

INPUT: 

 

- ``del_restrictions`` -- (default: ``True``) determines whether the 

restrictions of ``self`` to subdomains are deleted. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') 

sage: X.<x,y> = M.chart() 

sage: a = M.automorphism_field(name='a') 

sage: a._del_derived() 

 

""" 

# Delete the derived quantities pertaining to the mother classes: 

FreeModuleAutomorphism._del_derived(self) 

TensorFieldParal._del_derived(self, del_restrictions=del_restrictions) 

 

# Method _new_instance() is defined in mother class FreeModuleAutomorphism 

 

def __call__(self, *arg): 

r""" 

Redefinition of 

:meth:`~sage.tensor.modules.free_module_automorphism.FreeModuleAutomorphism.__call__` 

to allow for domain treatment. 

 

TESTS:: 

 

sage: M = Manifold(2, 'M') 

sage: X.<x,y> = M.chart() 

sage: a = M.automorphism_field(name='a') 

sage: a[:] = [[0, 1], [-1, 0]] 

sage: v = M.vector_field(name='v') 

sage: v[:] = [-y, x] 

sage: z = M.one_form(name='z') 

sage: z[:] = [1+y^2, x*y] 

sage: s = a.__call__(v); s 

Vector field a(v) on the 2-dimensional differentiable manifold M 

sage: s.display() 

a(v) = x d/dx + y d/dy 

sage: s = a.__call__(z, v); s 

Scalar field a(z,v) on the 2-dimensional differentiable manifold M 

sage: s.display() 

a(z,v): M --> R 

(x, y) |--> 2*x*y^2 + x 

sage: U = M.open_subset('U', coord_def={X: x>0}) 

sage: s = a.__call__(v.restrict(U)); s 

Vector field a(v) on the Open subset U of the 2-dimensional 

differentiable manifold M 

sage: s = a.__call__(z.restrict(U), v); s 

Scalar field a(z,v) on the Open subset U of the 2-dimensional 

differentiable manifold M 

sage: s.display() 

a(z,v): U --> R 

(x, y) |--> 2*x*y^2 + x 

 

""" 

if len(arg) == 1: 

# the automorphism acting as such (map of a vector field to a 

# vector field) 

vector = arg[0] 

dom = self._domain.intersection(vector._domain) 

return FreeModuleAutomorphism.__call__(self.restrict(dom), 

vector.restrict(dom)) 

elif len(arg) == 2: 

# the automorphism acting as a type (1,1) tensor on a pair 

# (1-form, vector field), returning a scalar field: 

oneform = arg[0] 

vector = arg[1] 

dom = self._domain.intersection(oneform._domain).intersection( 

vector._domain) 

return FreeModuleAutomorphism.__call__(self.restrict(dom), 

oneform.restrict(dom), 

vector.restrict(dom)) 

else: 

raise TypeError("wrong number of arguments") 

 

def __invert__(self): 

r""" 

Return the inverse automorphism of ``self``. 

 

EXAMPLES:: 

 

sage: M = Manifold(2, 'M') 

sage: X.<x,y> = M.chart() 

sage: a = M.automorphism_field(name='a') 

sage: a[:] = [[0, 2], [-1, 0]] 

sage: b = a.inverse(); b 

Field of tangent-space automorphisms a^(-1) on the 2-dimensional 

differentiable manifold M 

sage: b[:] 

[ 0 -1] 

[1/2 0] 

sage: a[:] 

[ 0 2] 

[-1 0] 

 

The result is cached:: 

 

sage: a.inverse() is b 

True 

 

Instead of ``inverse()``, one can use the power minus one to get the 

inverse:: 

 

sage: b is a^(-1) 

True 

 

or the operator ``~``:: 

 

sage: b is ~a 

True 

 

""" 

from sage.rings.real_mpfr import RR 

from sage.matrix.constructor import matrix 

from sage.tensor.modules.comp import Components 

from sage.manifolds.differentiable.vectorframe import CoordFrame 

if self._is_identity: 

return self 

if self._inverse is None: 

if self._name is None: 

inv_name = None 

else: 

inv_name = self._name + '^(-1)' 

if self._latex_name is None: 

inv_latex_name = None 

else: 

inv_latex_name = self._latex_name + r'^{-1}' 

fmodule = self._fmodule 

si = fmodule._sindex ; nsi = fmodule._rank + si 

self._inverse = fmodule.automorphism(name=inv_name, 

latex_name=inv_latex_name) 

for frame in self._components: 

if isinstance(frame, CoordFrame): 

chart = frame._chart 

else: 

chart = self._domain._def_chart #!# to be improved 

try: 

# TODO: do the computation without the 'SR' enforcement 

mat_self = matrix( 

[[self.comp(frame)[i, j, chart].expr(method='SR') 

for j in range(si, nsi)] for i in range(si, nsi)]) 

except (KeyError, ValueError): 

continue 

mat_inv = mat_self.inverse() 

cinv = Components(fmodule._ring, frame, 2, start_index=si, 

output_formatter=fmodule._output_formatter) 

for i in range(si, nsi): 

for j in range(si, nsi): 

val = chart.simplify(mat_inv[i-si,j-si], method='SR') 

cinv[i, j] = {chart: val} 

self._inverse._components[frame] = cinv 

return self._inverse 

 

inverse = __invert__ 

 

def restrict(self, subdomain, dest_map=None): 

r""" 

Return the restriction of ``self`` to some subset of its domain. 

 

If such restriction has not been defined yet, it is constructed here. 

 

This is a redefinition of 

:meth:`sage.manifolds.differentiable.tensorfield_paral.TensorFieldParal.restrict` 

to take into account the identity map. 

 

INPUT: 

 

- ``subdomain`` -- 

:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`; 

open subset `V` of ``self._domain`` 

- ``dest_map`` -- (default: ``None``) 

:class:`~sage.manifolds.differentiable.diff_map.DiffMap` 

destination map `\Phi:\ V \rightarrow N`, where `N` is a subset of 

``self._codomain``; if ``None``, the restriction of 

``self.base_module().destination_map()`` to `V` is used 

 

OUTPUT: 

 

- a :class:`AutomorphismFieldParal` representing the restriction 

 

EXAMPLES: 

 

Restriction of an automorphism field defined on `\RR^2` to a disk:: 

 

sage: M = Manifold(2, 'R^2') 

sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2 

sage: D = M.open_subset('D') # the unit open disc 

sage: c_cart_D = c_cart.restrict(D, x^2+y^2<1) 

sage: a = M.automorphism_field(name='a') ; a 

Field of tangent-space automorphisms a on the 2-dimensional 

differentiable manifold R^2 

sage: a[:] = [[1, x*y], [0, 3]] 

sage: a.restrict(D) 

Field of tangent-space automorphisms a on the Open subset D of the 

2-dimensional differentiable manifold R^2 

sage: a.restrict(D)[:] 

[ 1 x*y] 

[ 0 3] 

 

Restriction to the disk of the field of tangent-space identity maps:: 

 

sage: id = M.tangent_identity_field() ; id 

Field of tangent-space identity maps on the 2-dimensional 

differentiable manifold R^2 

sage: id.restrict(D) 

Field of tangent-space identity maps on the Open subset D of the 

2-dimensional differentiable manifold R^2 

sage: id.restrict(D)[:] 

[1 0] 

[0 1] 

sage: id.restrict(D) == D.tangent_identity_field() 

True 

 

""" 

if subdomain == self._domain: 

return self 

if subdomain not in self._restrictions: 

if not self._is_identity: 

return TensorFieldParal.restrict(self, subdomain, 

dest_map=dest_map) 

# Special case of the identity map: 

if not subdomain.is_subset(self._domain): 

raise ValueError("the provided domain is not a subset of " + 

"the field's domain.") 

if dest_map is None: 

dest_map = self._fmodule._dest_map.restrict(subdomain) 

elif not dest_map._codomain.is_subset(self._ambient_domain): 

raise ValueError("the argument 'dest_map' is not compatible " + 

"with the ambient domain of " + 

"the {}".format(self)) 

smodule = subdomain.vector_field_module(dest_map=dest_map) 

self._restrictions[subdomain] = smodule.identity_map() 

return self._restrictions[subdomain] 

 

def at(self, point): 

r""" 

Value of ``self`` at a given point. 

 

If the current field of tangent-space automorphisms is 

 

.. MATH:: 

 

a:\ U \longrightarrow T^{(1,1)} M 

 

associated with the differentiable map 

 

.. MATH:: 

 

\Phi:\ U \longrightarrow M, 

 

where `U` and `M` are two manifolds (possibly `U = M` and 

`\Phi = \mathrm{Id}_M`), then for any point `p \in U`, 

`a(p)` is an automorphism of the tangent space `T_{\Phi(p)}M`. 

 

INPUT: 

 

- ``point`` -- :class:`~sage.manifolds.point.ManifoldPoint`; 

point `p` in the domain of the field of automorphisms `a` 

 

OUTPUT: 

 

- the automorphism `a(p)` of the tangent vector space `T_{\Phi(p)}M` 

 

EXAMPLES: 

 

Automorphism at some point of a tangent space of a 2-dimensional 

manifold:: 

 

sage: M = Manifold(2, 'M') 

sage: c_xy.<x,y> = M.chart() 

sage: a = M.automorphism_field(name='a') 

sage: a[:] = [[1+exp(y), x*y], [0, 1+x^2]] 

sage: a.display() 

a = (e^y + 1) d/dx*dx + x*y d/dx*dy + (x^2 + 1) d/dy*dy 

sage: p = M.point((-2,3), name='p') ; p 

Point p on the 2-dimensional differentiable manifold M 

sage: ap = a.at(p) ; ap 

Automorphism a of the Tangent space at Point p on the 

2-dimensional differentiable manifold M 

sage: ap.display() 

a = (e^3 + 1) d/dx*dx - 6 d/dx*dy + 5 d/dy*dy 

sage: ap.parent() 

General linear group of the Tangent space at Point p on the 

2-dimensional differentiable manifold M 

 

The identity map of the tangent space at point ``p``:: 

 

sage: id = M.tangent_identity_field() ; id 

Field of tangent-space identity maps on the 2-dimensional 

differentiable manifold M 

sage: idp = id.at(p) ; idp 

Identity map of the Tangent space at Point p on the 2-dimensional 

differentiable manifold M 

sage: idp is M.tangent_space(p).identity_map() 

True 

sage: idp.display() 

Id = d/dx*dx + d/dy*dy 

sage: idp.parent() 

General linear group of the Tangent space at Point p on the 

2-dimensional differentiable manifold M 

sage: idp * ap == ap 

True 

 

""" 

if point not in self._domain: 

raise TypeError("the {} is not in the domain of the {}".format( 

point, self)) 

dest_map = self._fmodule._dest_map 

if dest_map.is_identity(): 

amb_point = point 

else: 

amb_point = dest_map(point) # "ambient" point 

ts = amb_point._manifold.tangent_space(amb_point) 

if self._is_identity: 

return ts.identity_map() 

resu = ts.automorphism(name=self._name, latex_name=self._latex_name) 

for frame, comp in self._components.items(): 

comp_resu = resu.add_comp(frame.at(point)) 

for ind, val in comp._comp.items(): 

comp_resu._comp[ind] = val(point) 

return resu