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

1237

1238

1239

1240

1241

1242

1243

1244

1245

1246

1247

1248

1249

1250

1251

1252

1253

1254

1255

1256

1257

1258

1259

1260

1261

1262

1263

1264

1265

1266

1267

1268

1269

1270

1271

1272

1273

1274

1275

1276

1277

1278

1279

1280

1281

1282

1283

1284

1285

1286

1287

1288

1289

1290

1291

1292

1293

1294

1295

1296

1297

1298

1299

1300

1301

1302

1303

1304

1305

1306

1307

1308

1309

1310

1311

1312

1313

1314

1315

1316

1317

1318

1319

1320

1321

1322

1323

1324

1325

1326

1327

1328

1329

1330

1331

1332

1333

1334

1335

1336

1337

1338

1339

1340

1341

1342

1343

1344

1345

1346

1347

1348

1349

1350

1351

1352

1353

1354

1355

1356

1357

1358

1359

1360

1361

1362

1363

1364

1365

1366

1367

1368

1369

1370

1371

1372

1373

1374

1375

1376

1377

1378

1379

1380

1381

1382

1383

1384

1385

1386

1387

1388

1389

1390

1391

1392

1393

1394

1395

1396

1397

1398

1399

1400

1401

1402

1403

1404

1405

1406

1407

1408

1409

1410

1411

1412

1413

1414

1415

1416

1417

1418

1419

1420

1421

1422

1423

1424

1425

1426

1427

1428

1429

1430

1431

1432

1433

1434

1435

1436

1437

1438

1439

1440

1441

1442

1443

1444

1445

1446

1447

1448

1449

1450

1451

1452

1453

1454

1455

1456

1457

1458

1459

1460

1461

1462

1463

1464

1465

1466

1467

1468

1469

1470

1471

1472

1473

1474

1475

1476

1477

1478

1479

1480

1481

1482

1483

1484

1485

1486

1487

1488

1489

1490

1491

1492

1493

1494

1495

1496

1497

1498

1499

1500

1501

1502

1503

1504

1505

1506

1507

1508

1509

1510

1511

1512

1513

1514

1515

1516

1517

1518

1519

1520

1521

1522

1523

1524

1525

1526

1527

1528

1529

1530

1531

1532

1533

1534

1535

1536

1537

1538

1539

1540

1541

1542

1543

1544

1545

1546

1547

1548

1549

1550

1551

1552

1553

1554

1555

1556

1557

1558

1559

1560

1561

1562

1563

1564

1565

1566

1567

1568

1569

1570

1571

1572

1573

1574

1575

1576

1577

1578

1579

1580

1581

1582

1583

1584

1585

1586

1587

1588

1589

1590

1591

1592

1593

1594

1595

1596

1597

1598

1599

1600

1601

1602

1603

1604

1605

1606

1607

1608

1609

1610

1611

1612

1613

1614

1615

1616

1617

1618

1619

1620

1621

1622

1623

1624

1625

1626

1627

1628

1629

1630

1631

1632

1633

1634

1635

1636

1637

1638

1639

1640

1641

1642

1643

1644

1645

1646

1647

1648

1649

1650

1651

1652

1653

1654

1655

1656

1657

1658

1659

1660

1661

1662

1663

1664

1665

1666

1667

1668

1669

1670

1671

1672

1673

1674

1675

1676

1677

1678

1679

1680

1681

1682

1683

1684

1685

1686

1687

1688

1689

1690

1691

1692

1693

1694

1695

1696

1697

1698

1699

1700

1701

1702

1703

1704

1705

1706

1707

1708

1709

1710

1711

1712

1713

1714

1715

1716

1717

1718

1719

1720

1721

1722

1723

1724

1725

1726

1727

1728

1729

1730

1731

1732

1733

1734

1735

1736

1737

1738

1739

1740

1741

1742

1743

1744

1745

1746

1747

1748

1749

1750

1751

1752

1753

1754

1755

1756

1757

1758

1759

1760

1761

1762

1763

1764

1765

1766

1767

1768

1769

1770

1771

1772

1773

1774

1775

1776

1777

1778

1779

1780

1781

1782

1783

1784

1785

1786

1787

1788

1789

1790

1791

1792

1793

1794

1795

1796

1797

1798

1799

1800

1801

1802

1803

1804

1805

1806

1807

1808

1809

1810

1811

1812

1813

1814

1815

1816

1817

1818

1819

1820

1821

1822

1823

1824

1825

1826

1827

1828

1829

1830

1831

1832

1833

1834

1835

1836

1837

1838

1839

1840

1841

1842

1843

1844

1845

1846

1847

1848

1849

1850

1851

1852

1853

1854

1855

1856

1857

1858

1859

1860

1861

1862

1863

1864

1865

1866

1867

1868

1869

1870

1871

1872

1873

1874

1875

1876

1877

1878

1879

1880

1881

1882

1883

1884

1885

1886

1887

1888

1889

1890

1891

1892

1893

1894

1895

1896

1897

1898

1899

1900

1901

1902

1903

1904

1905

1906

1907

1908

1909

1910

1911

1912

1913

1914

1915

1916

1917

1918

1919

1920

1921

1922

1923

1924

1925

1926

1927

1928

1929

1930

1931

1932

1933

1934

1935

1936

1937

1938

1939

1940

1941

1942

1943

1944

1945

1946

1947

1948

1949

1950

1951

1952

1953

1954

1955

1956

1957

1958

1959

1960

1961

1962

1963

1964

1965

1966

1967

1968

1969

1970

1971

1972

1973

1974

1975

1976

1977

1978

1979

1980

1981

1982

1983

1984

1985

1986

1987

1988

1989

1990

1991

1992

1993

1994

1995

1996

1997

1998

1999

2000

2001

2002

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

2015

2016

2017

2018

2019

2020

2021

2022

2023

2024

2025

2026

2027

2028

2029

2030

2031

2032

2033

2034

2035

2036

2037

2038

2039

2040

2041

2042

2043

2044

2045

2046

2047

2048

2049

2050

2051

2052

2053

2054

2055

2056

2057

2058

2059

2060

2061

2062

2063

2064

2065

2066

2067

2068

2069

2070

2071

2072

2073

2074

2075

2076

2077

2078

2079

2080

2081

2082

2083

2084

2085

2086

2087

2088

2089

2090

2091

2092

2093

2094

2095

2096

2097

2098

2099

2100

2101

2102

2103

2104

2105

2106

2107

2108

2109

2110

2111

2112

2113

2114

2115

2116

2117

2118

2119

2120

2121

2122

2123

2124

2125

2126

2127

2128

2129

2130

2131

2132

2133

2134

2135

2136

2137

2138

2139

2140

2141

2142

2143

2144

2145

2146

2147

2148

2149

2150

2151

2152

2153

2154

2155

2156

2157

2158

2159

2160

2161

2162

2163

2164

2165

2166

2167

2168

2169

2170

2171

2172

2173

2174

2175

2176

2177

2178

2179

2180

2181

2182

2183

2184

2185

2186

2187

2188

2189

2190

2191

2192

2193

2194

2195

2196

2197

2198

2199

2200

2201

2202

2203

2204

2205

2206

2207

2208

2209

2210

2211

2212

2213

2214

2215

2216

2217

2218

2219

2220

2221

2222

2223

2224

2225

2226

2227

2228

2229

2230

2231

2232

2233

2234

2235

2236

2237

2238

2239

2240

2241

2242

2243

2244

2245

2246

2247

2248

2249

2250

2251

2252

2253

2254

2255

2256

2257

2258

2259

2260

2261

2262

2263

2264

2265

2266

2267

2268

2269

2270

2271

2272

2273

2274

2275

2276

2277

2278

2279

2280

2281

2282

2283

2284

2285

2286

2287

2288

2289

2290

2291

2292

2293

2294

2295

2296

2297

2298

2299

2300

2301

2302

2303

2304

2305

2306

2307

2308

2309

2310

2311

2312

2313

2314

2315

2316

2317

2318

2319

2320

2321

2322

2323

2324

2325

2326

2327

2328

2329

2330

2331

2332

2333

2334

2335

2336

2337

2338

2339

2340

2341

2342

2343

2344

2345

2346

2347

2348

2349

2350

2351

2352

2353

2354

2355

2356

2357

2358

2359

2360

2361

2362

2363

2364

2365

2366

2367

2368

2369

2370

2371

2372

2373

2374

2375

2376

2377

2378

2379

2380

2381

2382

2383

2384

2385

2386

2387

2388

2389

2390

2391

2392

2393

2394

2395

2396

2397

2398

2399

2400

2401

2402

2403

2404

2405

2406

2407

2408

2409

2410

2411

2412

2413

2414

2415

2416

2417

2418

2419

2420

2421

2422

2423

2424

2425

2426

2427

2428

2429

2430

2431

2432

2433

2434

2435

2436

2437

2438

2439

2440

2441

2442

2443

2444

2445

2446

2447

2448

2449

2450

2451

2452

2453

2454

2455

2456

2457

2458

2459

2460

2461

2462

2463

2464

2465

2466

2467

2468

2469

2470

2471

2472

2473

2474

2475

2476

2477

2478

2479

2480

2481

2482

2483

2484

2485

2486

2487

2488

2489

2490

2491

2492

2493

2494

2495

2496

2497

2498

2499

2500

2501

2502

2503

2504

2505

2506

2507

2508

2509

2510

2511

2512

2513

2514

2515

2516

2517

2518

2519

2520

2521

2522

2523

2524

2525

2526

2527

2528

2529

2530

2531

2532

2533

2534

2535

2536

2537

2538

2539

2540

2541

2542

2543

2544

2545

2546

2547

2548

2549

2550

2551

2552

2553

2554

2555

2556

2557

2558

2559

2560

2561

2562

2563

2564

2565

2566

2567

2568

2569

2570

2571

2572

2573

2574

2575

2576

2577

2578

2579

2580

2581

2582

2583

2584

2585

2586

2587

2588

2589

2590

2591

2592

2593

2594

2595

2596

2597

2598

2599

2600

2601

2602

2603

2604

2605

2606

2607

2608

2609

2610

2611

2612

2613

2614

2615

2616

2617

2618

2619

2620

2621

2622

2623

2624

2625

2626

2627

2628

2629

2630

2631

2632

2633

2634

2635

2636

2637

2638

2639

2640

2641

2642

2643

2644

2645

2646

2647

2648

2649

2650

2651

2652

2653

2654

2655

2656

2657

2658

2659

2660

2661

2662

2663

2664

2665

2666

2667

2668

2669

2670

2671

2672

2673

2674

2675

2676

2677

2678

2679

2680

2681

2682

2683

2684

2685

2686

2687

2688

2689

2690

2691

2692

2693

2694

2695

2696

2697

2698

2699

2700

2701

2702

2703

2704

2705

2706

2707

2708

2709

2710

2711

2712

2713

2714

2715

2716

2717

2718

2719

2720

2721

2722

2723

2724

2725

2726

2727

2728

2729

2730

2731

2732

2733

2734

2735

2736

2737

2738

2739

2740

2741

2742

2743

2744

2745

2746

2747

2748

2749

2750

2751

2752

2753

2754

2755

2756

2757

2758

2759

2760

2761

2762

2763

2764

2765

2766

2767

2768

2769

2770

2771

2772

2773

2774

2775

2776

2777

2778

2779

2780

2781

2782

2783

2784

2785

2786

2787

2788

2789

2790

2791

2792

2793

2794

2795

2796

2797

2798

2799

2800

2801

2802

2803

2804

2805

2806

2807

2808

2809

2810

2811

2812

2813

2814

2815

2816

2817

2818

2819

2820

2821

2822

2823

2824

2825

2826

2827

2828

2829

2830

2831

2832

2833

2834

2835

2836

2837

2838

2839

2840

2841

2842

2843

2844

2845

2846

2847

2848

2849

2850

2851

2852

2853

2854

2855

2856

2857

2858

2859

2860

2861

2862

2863

2864

2865

2866

2867

2868

2869

2870

2871

2872

2873

2874

2875

2876

2877

2878

2879

2880

2881

2882

2883

2884

2885

2886

2887

2888

2889

2890

2891

2892

2893

2894

2895

2896

2897

2898

2899

2900

2901

2902

2903

2904

2905

2906

2907

2908

2909

2910

2911

2912

2913

2914

2915

2916

2917

2918

2919

2920

2921

2922

2923

2924

2925

2926

2927

2928

2929

2930

2931

2932

2933

2934

2935

2936

2937

2938

2939

2940

2941

2942

2943

2944

2945

2946

2947

2948

2949

2950

2951

2952

2953

2954

2955

2956

2957

2958

2959

2960

2961

2962

2963

2964

2965

2966

2967

2968

2969

2970

2971

2972

2973

2974

2975

2976

2977

2978

2979

2980

2981

2982

2983

2984

2985

2986

2987

2988

2989

2990

2991

2992

2993

2994

2995

2996

2997

2998

2999

3000

3001

3002

3003

3004

3005

3006

3007

3008

3009

3010

3011

3012

3013

3014

3015

3016

3017

3018

3019

3020

3021

3022

3023

3024

3025

3026

3027

3028

3029

3030

3031

3032

3033

3034

3035

3036

3037

3038

3039

3040

3041

3042

3043

3044

3045

3046

3047

3048

3049

3050

3051

3052

3053

3054

3055

3056

3057

3058

3059

3060

3061

3062

3063

3064

3065

3066

3067

3068

3069

3070

3071

3072

3073

3074

3075

3076

3077

3078

3079

3080

3081

3082

3083

3084

3085

3086

3087

3088

3089

3090

3091

3092

3093

3094

3095

3096

3097

3098

3099

3100

3101

3102

3103

3104

3105

3106

3107

3108

3109

3110

3111

3112

3113

3114

3115

3116

3117

3118

3119

3120

3121

3122

3123

3124

3125

3126

3127

3128

3129

3130

3131

3132

3133

3134

3135

3136

3137

3138

3139

3140

3141

3142

3143

3144

3145

3146

3147

3148

3149

3150

3151

3152

3153

3154

3155

3156

3157

3158

3159

3160

3161

3162

3163

3164

3165

3166

3167

3168

3169

3170

3171

3172

3173

3174

3175

3176

3177

3178

3179

3180

3181

3182

3183

3184

3185

3186

3187

3188

3189

3190

3191

3192

3193

3194

3195

3196

3197

3198

3199

3200

3201

3202

3203

3204

3205

3206

3207

3208

3209

3210

3211

3212

3213

3214

3215

3216

3217

3218

3219

3220

3221

3222

3223

3224

3225

3226

3227

3228

3229

3230

3231

3232

3233

3234

3235

3236

3237

3238

3239

3240

3241

3242

3243

3244

3245

3246

3247

3248

3249

3250

3251

3252

3253

3254

3255

3256

3257

3258

3259

3260

3261

3262

3263

3264

3265

3266

3267

3268

3269

3270

3271

3272

3273

3274

3275

3276

3277

3278

3279

3280

3281

3282

3283

3284

3285

3286

3287

3288

3289

3290

3291

3292

3293

3294

3295

3296

3297

3298

3299

3300

3301

3302

3303

3304

3305

3306

3307

3308

3309

3310

3311

3312

3313

3314

3315

3316

3317

3318

3319

3320

3321

3322

3323

3324

3325

3326

3327

3328

3329

3330

3331

3332

3333

3334

3335

3336

3337

3338

3339

3340

3341

3342

3343

3344

3345

3346

3347

3348

3349

3350

3351

3352

3353

3354

3355

3356

3357

3358

3359

3360

3361

3362

3363

3364

3365

3366

3367

3368

# -*- coding: utf-8 -*- 

r""" 

Differentiable Manifolds 

 

Given a non-discrete topological field `K` (in most applications, `K = \RR` or 

`K = \CC`; see however [Ser1992]_ for `K = \QQ_p` and [Ber2008]_ for other fields), 

a *differentiable manifold over* `K` is a topological manifold `M` over `K` 

equipped with an atlas whose transitions maps are of class `C^k` (i.e. 

`k`-times continuously differentiable) for a fixed positive integer `k` 

(possibly `k=\infty`). `M` is then called a `C^k`-*manifold over* `K`. 

 

Note that 

 

- if the mention of `K` is omitted, then `K=\RR` is assumed; 

- if `K=\CC`, any `C^k`-manifold with `k\geq 1` is actually a 

`C^\infty`-manifold (even an analytic manifold); 

- if `K=\RR`, any `C^k`-manifold with `k\geq 1` admits a compatible 

`C^\infty`-structure (Whitney's smoothing theorem). 

 

Differentiable manifolds are implemented via the class 

:class:`DifferentiableManifold`. 

Open subsets of differentiable manifolds are also implemented via 

:class:`DifferentiableManifold`, since they are differentiable manifolds by 

themselves. 

 

The user interface is provided by the generic function 

:func:`~sage.manifolds.manifold.Manifold`, with 

the argument ``structure`` set to ``'differentiable'`` and the argument 

``diff_degree`` set to `k`, or the argument ``structure`` set to ``'smooth'`` 

(the default value). 

 

.. RUBRIC:: Example 1: the 2-sphere as a differentiable manifold of dimension 

2 over `\RR` 

 

One starts by declaring `S^2` as a 2-dimensional differentiable manifold:: 

 

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

sage: M 

2-dimensional differentiable manifold S^2 

 

Since the base topological field has not been specified in the argument list 

of ``Manifold``, `\RR` is assumed:: 

 

sage: M.base_field() 

Real Field with 53 bits of precision 

sage: dim(M) 

2 

 

By default, the created object is a smooth manifold:: 

 

sage: M.diff_degree() 

+Infinity 

 

Let us consider the complement of a point, the "North pole" say; this is an 

open subset of `S^2`, which we call `U`:: 

 

sage: U = M.open_subset('U'); U 

Open subset U of the 2-dimensional differentiable manifold S^2 

 

A standard chart on `U` is provided by the stereographic projection from the 

North pole to the equatorial plane:: 

 

sage: stereoN.<x,y> = U.chart(); stereoN 

Chart (U, (x, y)) 

 

Thanks to the operator ``<x,y>`` on the left-hand side, the coordinates 

declared in a chart (here `x` and `y`), are accessible by their names; they are 

Sage's symbolic variables:: 

 

sage: y 

y 

sage: type(y) 

<type 'sage.symbolic.expression.Expression'> 

 

The South pole is the point of coordinates `(x,y)=(0,0)` in the above 

chart:: 

 

sage: S = U.point((0,0), chart=stereoN, name='S'); S 

Point S on the 2-dimensional differentiable manifold S^2 

 

Let us call `V` the open subset that is the complement of the South pole and 

let us introduce on it the chart induced by the stereographic projection from 

the South pole to the equatorial plane:: 

 

sage: V = M.open_subset('V'); V 

Open subset V of the 2-dimensional differentiable manifold S^2 

sage: stereoS.<u,v> = V.chart(); stereoS 

Chart (V, (u, v)) 

 

The North pole is the point of coordinates `(u,v)=(0,0)` in this chart:: 

 

sage: N = V.point((0,0), chart=stereoS, name='N'); N 

Point N on the 2-dimensional differentiable manifold S^2 

 

To fully construct the manifold, we declare that it is the union of `U` 

and `V`:: 

 

sage: M.declare_union(U,V) 

 

and we provide the transition map between the charts ``stereoN`` = `(U, (x, y))` 

and ``stereoS`` = `(V, (u, v))`, denoting by `W` the intersection of `U` and 

`V` (`W` is the subset of `U` defined by `x^2+y^2\not=0`, as well as the subset 

of `V` defined by `u^2+v^2\not=0`):: 

 

sage: stereoN_to_S = 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: stereoN_to_S 

Change of coordinates from Chart (W, (x, y)) to Chart (W, (u, v)) 

sage: stereoN_to_S.display() 

u = x/(x^2 + y^2) 

v = y/(x^2 + y^2) 

 

We give the name ``W`` to the Python variable representing `W=U\cap V`:: 

 

sage: W = U.intersection(V) 

 

The inverse of the transition map is computed by the method ``inverse()``:: 

 

sage: stereoN_to_S.inverse() 

Change of coordinates from Chart (W, (u, v)) to Chart (W, (x, y)) 

sage: stereoN_to_S.inverse().display() 

x = u/(u^2 + v^2) 

y = v/(u^2 + v^2) 

 

At this stage, we have four open subsets on `S^2`:: 

 

sage: M.list_of_subsets() 

[2-dimensional differentiable manifold S^2, 

Open subset U of the 2-dimensional differentiable manifold S^2, 

Open subset V of the 2-dimensional differentiable manifold S^2, 

Open subset W of the 2-dimensional differentiable manifold S^2] 

 

`W` is the open subset that is the complement of the two poles:: 

 

sage: N in W or S in W 

False 

 

The North pole lies in `V` and the South pole in `U`:: 

 

sage: N in V, N in U 

(True, False) 

sage: S in U, S in V 

(True, False) 

 

The manifold's (user) atlas contains four charts, two of them 

being restrictions of charts to a smaller domain:: 

 

sage: M.atlas() 

[Chart (U, (x, y)), Chart (V, (u, v)), Chart (W, (x, y)), Chart (W, (u, v))] 

 

Let us consider the point of coordinates (1,2) in the chart ``stereoN``:: 

 

sage: p = M.point((1,2), chart=stereoN, name='p'); p 

Point p on the 2-dimensional differentiable manifold S^2 

sage: p.parent() 

2-dimensional differentiable manifold S^2 

sage: p in W 

True 

 

The coordinates of `p` in the chart ``stereoS`` are computed by letting 

the chart act on the point:: 

 

sage: stereoS(p) 

(1/5, 2/5) 

 

Given the definition of `p`, we have of course:: 

 

sage: stereoN(p) 

(1, 2) 

 

Similarly:: 

 

sage: stereoS(N) 

(0, 0) 

sage: stereoN(S) 

(0, 0) 

 

A differentiable scalar field on the sphere:: 

 

sage: f = M.scalar_field({stereoN: atan(x^2+y^2), stereoS: pi/2-atan(u^2+v^2)}, 

....: name='f') 

sage: f 

Scalar field f on the 2-dimensional differentiable manifold S^2 

sage: f.display() 

f: S^2 --> R 

on U: (x, y) |--> arctan(x^2 + y^2) 

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

sage: f(p) 

arctan(5) 

sage: f(N) 

1/2*pi 

sage: f(S) 

0 

sage: f.parent() 

Algebra of differentiable scalar fields on the 2-dimensional differentiable 

manifold S^2 

sage: f.parent().category() 

Category of commutative algebras over Symbolic Ring 

 

A differentiable manifold has a default vector frame, which, unless otherwise 

specified, is the coordinate frame associated with the first defined chart:: 

 

sage: M.default_frame() 

Coordinate frame (U, (d/dx,d/dy)) 

sage: latex(M.default_frame()) 

\left(U, \left(\frac{\partial}{\partial x },\frac{\partial}{\partial y }\right)\right) 

sage: M.default_frame() is stereoN.frame() 

True 

 

A vector field on the sphere:: 

 

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

sage: w[stereoN.frame(), :] = [x, y] 

sage: w.add_comp_by_continuation(stereoS.frame(), W, stereoS) 

sage: w.display() # display in the default frame (stereoN.frame()) 

w = x d/dx + y d/dy 

sage: w.display(stereoS.frame()) 

w = -u d/du - v d/dv 

sage: w.parent() 

Module X(S^2) of vector fields on the 2-dimensional differentiable 

manifold S^2 

sage: w.parent().category() 

Category of modules over Algebra of differentiable scalar fields on the 

2-dimensional differentiable manifold S^2 

 

Vector fields act on scalar fields:: 

 

sage: w(f) 

Scalar field w(f) on the 2-dimensional differentiable manifold S^2 

sage: w(f).display() 

w(f): S^2 --> R 

on U: (x, y) |--> 2*(x^2 + y^2)/(x^4 + 2*x^2*y^2 + y^4 + 1) 

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

sage: w(f) == f.differential()(w) 

True 

 

The value of the vector field at point `p` is a vector tangent to the sphere:: 

 

sage: w.at(p) 

Tangent vector w at Point p on the 2-dimensional differentiable manifold S^2 

sage: w.at(p).display() 

w = d/dx + 2 d/dy 

sage: w.at(p).parent() 

Tangent space at Point p on the 2-dimensional differentiable manifold S^2 

 

A 1-form on the sphere:: 

 

sage: df = f.differential() ; df 

1-form df on the 2-dimensional differentiable manifold S^2 

sage: df.display() 

df = 2*x/(x^4 + 2*x^2*y^2 + y^4 + 1) dx + 2*y/(x^4 + 2*x^2*y^2 + y^4 + 1) dy 

sage: df.display(stereoS.frame()) 

df = -2*u/(u^4 + 2*u^2*v^2 + v^4 + 1) du - 2*v/(u^4 + 2*u^2*v^2 + v^4 + 1) dv 

sage: df.parent() 

Module Omega^1(S^2) of 1-forms on the 2-dimensional differentiable 

manifold S^2 

sage: df.parent().category() 

Category of modules over Algebra of differentiable scalar fields on the 

2-dimensional differentiable manifold S^2 

 

The value of the 1-form at point `p` is a linear form on the tangent space 

at `p`:: 

 

sage: df.at(p) 

Linear form df on the Tangent space at Point p on the 2-dimensional 

differentiable manifold S^2 

sage: df.at(p).display() 

df = 1/13 dx + 2/13 dy 

sage: df.at(p).parent() 

Dual of the Tangent space at Point p on the 2-dimensional differentiable 

manifold S^2 

 

 

.. RUBRIC:: Example 2: the Riemann sphere as a differentiable manifold of 

dimension 1 over `\CC` 

 

We declare the Riemann sphere `\CC^*` as a 1-dimensional differentiable 

manifold over `\CC`:: 

 

sage: M = Manifold(1, 'C*', field='complex'); M 

1-dimensional complex manifold C* 

 

We introduce a first open subset, which is actually 

`\CC = \CC^*\setminus\{\infty\}` if we interpret `\CC^*` as the Alexandroff 

one-point compactification of `\CC`:: 

 

sage: U = M.open_subset('U') 

 

A natural chart on `U` is then nothing but the identity map of `\CC`, hence 

we denote the associated coordinate by `z`:: 

 

sage: Z.<z> = U.chart() 

 

The origin of the complex plane is the point of coordinate `z=0`:: 

 

sage: O = U.point((0,), chart=Z, name='O'); O 

Point O on the 1-dimensional complex manifold C* 

 

Another open subset of `\CC^*` is `V = \CC^*\setminus\{O\}`:: 

 

sage: V = M.open_subset('V') 

 

We define a chart on `V` such that the point at infinity is the point of 

coordinate 0 in this chart:: 

 

sage: W.<w> = V.chart(); W 

Chart (V, (w,)) 

sage: inf = M.point((0,), chart=W, name='inf', latex_name=r'\infty') 

sage: inf 

Point inf on the 1-dimensional complex manifold C* 

 

To fully construct the Riemann sphere, we declare that it is the union of `U` 

and `V`:: 

 

sage: M.declare_union(U,V) 

 

and we provide the transition map between the two charts as `w=1/z` on 

on `A = U\cap V`:: 

 

sage: Z_to_W = Z.transition_map(W, 1/z, intersection_name='A', 

....: restrictions1= z!=0, restrictions2= w!=0) 

sage: Z_to_W 

Change of coordinates from Chart (A, (z,)) to Chart (A, (w,)) 

sage: Z_to_W.display() 

w = 1/z 

sage: Z_to_W.inverse() 

Change of coordinates from Chart (A, (w,)) to Chart (A, (z,)) 

sage: Z_to_W.inverse().display() 

z = 1/w 

 

Let consider the complex number `i` as a point of the Riemann sphere:: 

 

sage: i = M((I,), chart=Z, name='i'); i 

Point i on the 1-dimensional complex manifold C* 

 

Its coordinates with respect to the charts ``Z`` and ``W`` are:: 

 

sage: Z(i) 

(I,) 

sage: W(i) 

(-I,) 

 

and we have:: 

 

sage: i in U 

True 

sage: i in V 

True 

 

The following subsets and charts have been defined:: 

 

sage: M.list_of_subsets() 

[Open subset A of the 1-dimensional complex manifold C*, 

1-dimensional complex manifold C*, 

Open subset U of the 1-dimensional complex manifold C*, 

Open subset V of the 1-dimensional complex manifold C*] 

sage: M.atlas() 

[Chart (U, (z,)), Chart (V, (w,)), Chart (A, (z,)), Chart (A, (w,))] 

 

A constant map `\CC^* \rightarrow \CC`:: 

 

sage: f = M.constant_scalar_field(3+2*I, name='f'); f 

Scalar field f on the 1-dimensional complex manifold C* 

sage: f.display() 

f: C* --> C 

on U: z |--> 2*I + 3 

on V: w |--> 2*I + 3 

sage: f(O) 

2*I + 3 

sage: f(i) 

2*I + 3 

sage: f(inf) 

2*I + 3 

sage: f.parent() 

Algebra of differentiable scalar fields on the 1-dimensional complex 

manifold C* 

sage: f.parent().category() 

Category of commutative algebras over Symbolic Ring 

 

A vector field on the Riemann sphere:: 

 

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

sage: v[Z.frame(), 0] = z^2 

sage: v.add_comp_by_continuation(W.frame(), U.intersection(V), W) 

sage: v.display(Z.frame()) 

v = z^2 d/dz 

sage: v.display(W.frame()) 

v = -d/dw 

sage: v.parent() 

Module X(C*) of vector fields on the 1-dimensional complex manifold C* 

 

The vector field `v` acting on the scalar field `f`:: 

 

sage: v(f) 

Scalar field v(f) on the 1-dimensional complex manifold C* 

 

Since `f` is constant, `v(f)` is vanishing:: 

 

sage: v(f).display() 

v(f): C* --> C 

on U: z |--> 0 

on V: w |--> 0 

 

The value of the vector field `v` at the point `\infty` is a vector tangent to 

the Riemann sphere:: 

 

sage: v.at(inf) 

Tangent vector v at Point inf on the 1-dimensional complex manifold C* 

sage: v.at(inf).display() 

v = -d/dw 

sage: v.at(inf).parent() 

Tangent space at Point inf on the 1-dimensional complex manifold C* 

 

AUTHORS: 

 

- Eric Gourgoulhon (2015): initial version 

- Travis Scrimshaw (2016): review tweaks 

 

REFERENCES: 

 

- [Lee2013]_ 

- [KN1963]_ 

- [Huy2005]_ 

- [Ser1992]_ 

- [Ber2008]_ 

- [BG1988]_ 

 

""" 

 

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

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

# Copyright (C) 2015 Michal Bejger <bejger@camk.edu.pl> 

# 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.categories.manifolds import Manifolds 

from sage.categories.homset import Hom 

from sage.rings.all import CC 

from sage.rings.real_mpfr import RR 

from sage.rings.infinity import infinity, minus_infinity 

from sage.rings.integer import Integer 

from sage.misc.latex import latex 

from sage.manifolds.manifold import TopologicalManifold 

 

############################################################################### 

 

class DifferentiableManifold(TopologicalManifold): 

r""" 

Differentiable manifold over a topological field `K`. 

 

Given a non-discrete topological field `K` (in most applications, 

`K = \RR` or `K = \CC`; see however [Ser1992]_ for `K = \QQ_p` and 

[Ber2008]_ for other fields), a *differentiable manifold over* `K` is a 

topological manifold `M` over `K` equipped with an atlas whose transitions 

maps are of class `C^k` (i.e. `k`-times continuously differentiable) for 

a fixed positive integer `k` (possibly `k=\infty`). `M` is then called a 

`C^k`-*manifold over* `K`. 

 

Note that 

 

- if the mention of `K` is omitted, then `K=\RR` is assumed; 

- if `K=\CC`, any `C^k`-manifold with `k\geq 1` is actually a 

`C^\infty`-manifold (even an analytic manifold); 

- if `K=\RR`, any `C^k`-manifold with `k\geq 1` admits a compatible 

`C^\infty`-structure (Whitney's smoothing theorem). 

 

INPUT: 

 

- ``n`` -- positive integer; dimension of the manifold 

- ``name`` -- string; name (symbol) given to the manifold 

- ``field`` -- field `K` on which the manifold is 

defined; allowed values are 

 

- ``'real'`` or an object of type ``RealField`` (e.g., ``RR``) for 

a manifold over `\RR` 

- ``'complex'`` or an object of type ``ComplexField`` (e.g., ``CC``) 

for a manifold 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 manifolds 

 

- ``structure`` -- manifold structure (see 

:class:`~sage.manifolds.structure.DifferentialStructure` or 

:class:`~sage.manifolds.structure.RealDifferentialStructure`) 

- ``ambient`` -- (default: ``None``) if not ``None``, must be a 

differentiable manifold; the created object is then an open subset of 

``ambient`` 

- ``diff_degree`` -- (default: ``infinity``) degree `k` of 

differentiability 

- ``latex_name`` -- (default: ``None``) string; LaTeX symbol to 

denote the manifold; if none is provided, it is set to ``name`` 

- ``start_index`` -- (default: 0) integer; lower value of the range of 

indices used for "indexed objects" on the manifold, e.g. coordinates 

in a chart 

- ``category`` -- (default: ``None``) to specify the category; if ``None``, 

``Manifolds(field).Differentiable()`` (or ``Manifolds(field).Smooth()`` 

if ``diff_degree`` = ``infinity``) is assumed (see the category 

:class:`~sage.categories.manifolds.Manifolds`) 

- ``unique_tag`` -- (default: ``None``) tag used to force the construction 

of a new object when all the other arguments have been used previously 

(without ``unique_tag``, the 

:class:`~sage.structure.unique_representation.UniqueRepresentation` 

behavior inherited from 

:class:`~sage.manifolds.subset.ManifoldSubset`, 

via :class:`~sage.manifolds.manifold.TopologicalManifold`, 

would return the previously constructed object corresponding to these 

arguments). 

 

EXAMPLES: 

 

A 4-dimensional differentiable manifold (over `\RR`):: 

 

sage: M = Manifold(4, 'M', latex_name=r'\mathcal{M}'); M 

4-dimensional differentiable manifold M 

sage: type(M) 

<class 'sage.manifolds.differentiable.manifold.DifferentiableManifold_with_category'> 

sage: latex(M) 

\mathcal{M} 

sage: dim(M) 

4 

 

Since the base field has not been specified, `\RR` has been assumed:: 

 

sage: M.base_field() 

Real Field with 53 bits of precision 

 

Since the degree of differentiability has not been specified, the default 

value, `C^\infty`, has been assumed:: 

 

sage: M.diff_degree() 

+Infinity 

 

The input parameter ``start_index`` defines the range of indices on the 

manifold:: 

 

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

sage: list(M.irange()) 

[0, 1, 2, 3] 

sage: M = Manifold(4, 'M', start_index=1) 

sage: list(M.irange()) 

[1, 2, 3, 4] 

sage: list(Manifold(4, 'M', start_index=-2).irange()) 

[-2, -1, 0, 1] 

 

A complex manifold:: 

 

sage: N = Manifold(3, 'N', field='complex'); N 

3-dimensional complex manifold N 

 

A differentiable manifold over `\QQ_5`, the field of 5-adic numbers:: 

 

sage: N = Manifold(2, 'N', field=Qp(5)); N 

2-dimensional differentiable manifold N over the 5-adic Field with 

capped relative precision 20 

 

A differentiable manifold is of course a topological manifold:: 

 

sage: isinstance(M, sage.manifolds.manifold.TopologicalManifold) 

True 

sage: isinstance(N, sage.manifolds.manifold.TopologicalManifold) 

True 

 

A differentiable manifold is a Sage *parent* object, in the category of 

differentiable (here smooth) manifolds over a given topological field (see 

:class:`~sage.categories.manifolds.Manifolds`):: 

 

sage: isinstance(M, Parent) 

True 

sage: M.category() 

Category of smooth manifolds over Real Field with 53 bits of precision 

sage: from sage.categories.manifolds import Manifolds 

sage: M.category() is Manifolds(RR).Smooth() 

True 

sage: M.category() is Manifolds(M.base_field()).Smooth() 

True 

sage: M in Manifolds(RR).Smooth() 

True 

sage: N in Manifolds(Qp(5)).Smooth() 

True 

 

The corresponding Sage *elements* are points:: 

 

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

sage: p = M.an_element(); p 

Point on the 4-dimensional differentiable manifold M 

sage: p.parent() 

4-dimensional differentiable manifold M 

sage: M.is_parent_of(p) 

True 

sage: p in M 

True 

 

The manifold's points are instances of class 

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

 

sage: isinstance(p, sage.manifolds.point.ManifoldPoint) 

True 

 

Since an open subset of a differentiable manifold `M` is itself a 

differentiable manifold, open subsets of `M` have all attributes of 

manifolds:: 

 

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

Open subset U of the 4-dimensional differentiable manifold M 

sage: U.category() 

Join of Category of subobjects of sets and Category of smooth manifolds 

over Real Field with 53 bits of precision 

sage: U.base_field() == M.base_field() 

True 

sage: dim(U) == dim(M) 

True 

 

The manifold passes all the tests of the test suite relative to its 

category:: 

 

sage: TestSuite(M).run() 

 

""" 

def __init__(self, n, name, field, structure, ambient=None, 

diff_degree=infinity, latex_name=None, start_index=0, 

category=None, unique_tag=None): 

r""" 

Construct a differentiable manifold. 

 

TESTS:: 

 

sage: M = Manifold(3, 'M', latex_name=r'\mathbb{M}', 

....: start_index=1) 

sage: M 

3-dimensional differentiable manifold M 

sage: latex(M) 

\mathbb{M} 

sage: dim(M) 

3 

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

sage: TestSuite(M).run() 

 

Tests for open subsets, which are constructed as differentiable 

manifolds:: 

 

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

sage: type(U) 

<class 'sage.manifolds.differentiable.manifold.DifferentiableManifold_with_category'> 

sage: U.category() is M.category().Subobjects() 

True 

sage: TestSuite(U).run() 

 

""" 

if ambient is None: 

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 = Manifolds(field_c).Smooth() 

else: 

category = Manifolds(field_c).Differentiable() 

elif not isinstance(ambient, DifferentiableManifold): 

raise TypeError("the argument 'ambient' must be a " + 

"differentiable manifold") 

TopologicalManifold.__init__(self, n, name, field, structure, 

ambient=ambient, 

latex_name=latex_name, 

start_index=start_index, 

category=category) 

# The degree of differentiability: 

if diff_degree == infinity: 

self._diff_degree = infinity 

elif not isinstance(diff_degree, (int, Integer)): 

raise TypeError("the argument 'diff_degree' must be an integer") 

elif diff_degree < 1: 

raise ValueError("the argument 'diff_degree' must be a positive " + 

"integer") 

else: 

self._diff_degree = diff_degree 

# Vector frames: 

self._frames = [] # list of vector frames defined on subsets of self 

# list of vector frames defined on subsets of self that are 

# not subframes of frames on larger subsets 

self._top_frames = [] 

self._def_frame = None # default frame 

self._coframes = [] # list of coframes defined on subsets of self 

# List of vector frames that individually cover self, i.e. whose 

# domains are self (if non-empty, self is parallelizable): 

self._covering_frames = [] 

self._parallelizable_parts = set() # parallelizable subsets contained in self 

self._frame_changes = {} # dictionary of changes of frames 

# Dictionary of vector field modules along self 

# (keys = diff. map from self to an open set (possibly the identity map)) 

self._vector_field_modules = {} 

 

def diff_degree(self): 

r""" 

Return the manifold's degree of differentiability. 

 

The degree of differentiability is the integer `k` (possibly 

`k=\infty`) such that the manifold is a `C^k`-manifold over its base 

field. 

 

EXAMPLES:: 

 

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

sage: M.diff_degree() 

+Infinity 

sage: M = Manifold(2, 'M', structure='differentiable', diff_degree=3) 

sage: M.diff_degree() 

3 

 

""" 

return self._diff_degree 

 

def open_subset(self, name, latex_name=None, coord_def={}): 

r""" 

Create an open subset of the manifold. 

 

An open subset is a set that is (i) included in the manifold and (ii) 

open with respect to the manifold's topology. It is a differentiable 

manifold by itself. Hence the returned object is an instance of 

:class:`DifferentiableManifold`. 

 

INPUT: 

 

- ``name`` -- name given to the open subset 

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

subset; if none is provided, it is set to ``name`` 

- ``coord_def`` -- (default: {}) definition of the subset in 

terms of coordinates; ``coord_def`` must a be dictionary with keys 

charts in the manifold's atlas and values the symbolic expressions 

formed by the coordinates to define the subset. 

 

OUTPUT: 

 

- the open subset, as an instance of :class:`DifferentiableManifold` 

 

EXAMPLES: 

 

Creating an open subset of a differentiable manifold:: 

 

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

sage: A = M.open_subset('A'); A 

Open subset A of the 2-dimensional differentiable manifold M 

 

As an open subset of a differentiable manifold, ``A`` is itself a 

differentiable manifold, on the same topological field and of the same 

dimension as ``M``:: 

 

sage: A.category() 

Join of Category of subobjects of sets and Category of smooth 

manifolds over Real Field with 53 bits of precision 

sage: A.base_field() == M.base_field() 

True 

sage: dim(A) == dim(M) 

True 

 

Creating an open subset of ``A``:: 

 

sage: B = A.open_subset('B'); B 

Open subset B of the 2-dimensional differentiable manifold M 

 

We have then:: 

 

sage: A.list_of_subsets() 

[Open subset A of the 2-dimensional differentiable manifold M, 

Open subset B of the 2-dimensional differentiable manifold M] 

sage: B.is_subset(A) 

True 

sage: B.is_subset(M) 

True 

 

Defining an open subset by some coordinate restrictions: the open 

unit disk in of the Euclidean plane:: 

 

sage: X.<x,y> = M.chart() # Cartesian coordinates on M 

sage: U = M.open_subset('U', coord_def={X: x^2+y^2<1}); U 

Open subset U of the 2-dimensional differentiable manifold M 

 

Since the argument ``coord_def`` has been set, ``U`` is automatically 

endowed with a chart, which is the restriction of ``X`` 

to ``U``:: 

 

sage: U.atlas() 

[Chart (U, (x, y))] 

sage: U.default_chart() 

Chart (U, (x, y)) 

sage: U.default_chart() is X.restrict(U) 

True 

 

An point in ``U``:: 

 

sage: p = U.an_element(); p 

Point on the 2-dimensional differentiable manifold M 

sage: X(p) # the coordinates (x,y) of p 

(0, 0) 

sage: p in U 

True 

 

Checking whether various points, defined by their coordinates 

with respect to chart ``X``, are in ``U``:: 

 

sage: M((0,1/2)) in U 

True 

sage: M((0,1)) in U 

False 

sage: M((1/2,1)) in U 

False 

sage: M((-1/2,1/3)) in U 

True 

 

""" 

resu = DifferentiableManifold(self._dim, name, self._field, 

self._structure, ambient=self._manifold, 

diff_degree=self._diff_degree, 

latex_name=latex_name, 

start_index=self._sindex) 

resu._calculus_method = self._calculus_method 

resu._supersets.update(self._supersets) 

for sd in self._supersets: 

sd._subsets.add(resu) 

self._top_subsets.add(resu) 

# Charts on the result from the coordinate definition: 

for chart, restrictions in coord_def.items(): 

if chart not in self._atlas: 

raise ValueError("the {} does not belong to ".format(chart) + 

"the atlas of {}".format(self)) 

chart.restrict(resu, restrictions) 

# Transition maps on the result inferred from those of self: 

for chart1 in coord_def: 

for chart2 in coord_def: 

if chart2 != chart1 and (chart1, chart2) in self._coord_changes: 

self._coord_changes[(chart1, chart2)].restrict(resu) 

#!# update vector frames and change of frames 

return resu 

 

def diff_map(self, codomain, coord_functions=None, chart1=None, 

chart2=None, name=None, latex_name=None): 

r""" 

Define a differentiable map between the current differentiable manifold 

and a differentiable manifold over the same topological field. 

 

See :class:`~sage.manifolds.differentiable.diff_map.DiffMap` for a 

complete documentation. 

 

INPUT: 

 

- ``codomain`` -- the map codomain (a differentiable manifold over the 

same topological field as the current differentiable manifold) 

- ``coord_functions`` -- (default: ``None``) if not ``None``, must be 

either 

 

- (i) a dictionary of 

the coordinate expressions (as lists (or tuples) of the 

coordinates of the image expressed in terms of the coordinates of 

the considered point) with the pairs of charts (chart1, chart2) 

as keys (chart1 being a chart on the current manifold and chart2 a 

chart on ``codomain``) 

- (ii) a single coordinate expression in a given pair of charts, the 

latter being provided by the arguments ``chart1`` and ``chart2`` 

 

In both cases, if the dimension of the arrival manifold is 1, 

a single coordinate expression can be passed instead of a tuple with 

a single element 

- ``chart1`` -- (default: ``None``; used only in case (ii) above) chart 

on the current manifold defining the start coordinates involved in 

``coord_functions`` for case (ii); if none is provided, the 

coordinates are assumed to refer to the manifold's default chart 

- ``chart2`` -- (default: ``None``; used only in case (ii) above) chart 

on ``codomain`` defining the arrival coordinates involved in 

``coord_functions`` for case (ii); if none is provided, the 

coordinates are assumed to refer to the default chart of ``codomain`` 

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

map 

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

differentiable map; if none is provided, the LaTeX symbol is set to 

``name`` 

 

OUTPUT: 

 

- the differentiable map, as an instance of 

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

 

EXAMPLES: 

 

A differentiable map between an open subset of `S^2` covered by regular 

spherical coordinates and `\RR^3`:: 

 

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

sage: U = M.open_subset('U') 

sage: c_spher.<th,ph> = U.chart(r'th:(0,pi):\theta ph:(0,2*pi):\phi') 

sage: N = Manifold(3, 'R^3', r'\RR^3') 

sage: c_cart.<x,y,z> = N.chart() # Cartesian coord. on R^3 

sage: Phi = U.diff_map(N, (sin(th)*cos(ph), sin(th)*sin(ph), cos(th)), 

....: name='Phi', latex_name=r'\Phi') 

sage: Phi 

Differentiable map Phi from the Open subset U of the 2-dimensional 

differentiable manifold S^2 to the 3-dimensional differentiable 

manifold R^3 

 

The same definition, but with a dictionary with pairs of charts as 

keys (case (i) above):: 

 

sage: Phi1 = U.diff_map(N, 

....: {(c_spher, c_cart): (sin(th)*cos(ph), sin(th)*sin(ph), 

....: cos(th))}, name='Phi', latex_name=r'\Phi') 

sage: Phi1 == Phi 

True 

 

The differentiable map acting on a point:: 

 

sage: p = U.point((pi/2, pi)) ; p 

Point on the 2-dimensional differentiable manifold S^2 

sage: Phi(p) 

Point on the 3-dimensional differentiable manifold R^3 

sage: Phi(p).coord(c_cart) 

(-1, 0, 0) 

sage: Phi1(p) == Phi(p) 

True 

 

See the documentation of class 

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

examples. 

 

""" 

homset = Hom(self, codomain) 

if coord_functions is None: 

coord_functions = {} 

if not isinstance(coord_functions, dict): 

# Turn coord_functions into a dictionary: 

if chart1 is None: 

chart1 = self._def_chart 

elif chart1 not in self._atlas: 

raise ValueError("{} is not a chart ".format(chart1) + 

"defined on the {}".format(self)) 

if chart2 is None: 

chart2 = codomain._def_chart 

elif chart2 not in codomain._atlas: 

raise ValueError("{} is not a chart ".format(chart2) + 

" defined on the {}".format(codomain)) 

coord_functions = {(chart1, chart2): coord_functions} 

return homset(coord_functions, name=name, latex_name=latex_name) 

 

def diff_mapping(self, codomain, coord_functions=None, chart1=None, 

chart2=None, name=None, latex_name=None): 

r""" 

Deprecated. 

 

Use :meth:`diff_map` instead. 

 

EXAMPLES:: 

 

sage: M = Manifold(2, 'M'); X.<x,y> = M.chart() 

sage: N = Manifold(2, 'N'); Y.<u,v> = N.chart() 

sage: Phi = M.diff_mapping(N, {(X,Y): [x+y, x-y]}, name='Phi') 

doctest:...: DeprecationWarning: Use diff_map() instead. 

See http://trac.sagemath.org/18783 for details. 

sage: Phi 

Differentiable map Phi from the 2-dimensional differentiable 

manifold M to the 2-dimensional differentiable manifold N 

 

""" 

from sage.misc.superseded import deprecation 

deprecation(18783, 'Use diff_map() instead.') 

return self.diff_map(codomain, coord_functions=coord_functions, 

chart1=chart1, chart2=chart2, name=name, 

latex_name=latex_name) 

 

def diffeomorphism(self, codomain, coord_functions=None, chart1=None, 

chart2=None, name=None, latex_name=None): 

r""" 

Define a diffeomorphism between the current manifold and another one. 

 

See :class:`~sage.manifolds.differentiable.diff_map.DiffMap` for a 

complete documentation. 

 

INPUT: 

 

- ``codomain`` -- codomain of the diffeomorphism (the arrival manifold 

or some subset of it) 

- ``coord_functions`` -- (default: ``None``) if not ``None``, must be 

either 

 

- (i) a dictionary of 

the coordinate expressions (as lists (or tuples) of the 

coordinates of the image expressed in terms of the coordinates of 

the considered point) with the pairs of charts (chart1, chart2) 

as keys (chart1 being a chart on the current manifold and chart2 

a chart on ``codomain``) 

- (ii) a single coordinate expression in a given pair of charts, the 

latter being provided by the arguments ``chart1`` and ``chart2`` 

 

In both cases, if the dimension of the arrival manifold is 1, 

a single coordinate expression can be passed instead of a tuple with 

a single element 

- ``chart1`` -- (default: ``None``; used only in case (ii) above) chart 

on the current manifold defining the start coordinates involved in 

``coord_functions`` for case (ii); if none is provided, the 

coordinates are assumed to refer to the manifold's default chart 

- ``chart2`` -- (default: ``None``; used only in case (ii) above) chart 

on ``codomain`` defining the arrival coordinates involved in 

``coord_functions`` for case (ii); if none is provided, the 

coordinates are assumed to refer to the default chart of ``codomain`` 

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

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

diffeomorphism; if none is provided, the LaTeX symbol is set to 

``name`` 

 

OUTPUT: 

 

- the diffeomorphism, as an instance of 

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

 

EXAMPLES: 

 

Diffeomorphism between the open unit disk in `\RR^2` and `\RR^2`:: 

 

sage: M = Manifold(2, 'M') # the open unit disk 

sage: forget() # for doctests only 

sage: c_xy.<x,y> = M.chart('x:(-1,1) y:(-1,1)') # Cartesian coord on M 

sage: c_xy.add_restrictions(x^2+y^2<1) 

sage: N = Manifold(2, 'N') # R^2 

sage: c_XY.<X,Y> = N.chart() # canonical coordinates on R^2 

sage: Phi = M.diffeomorphism(N, [x/sqrt(1-x^2-y^2), y/sqrt(1-x^2-y^2)], 

....: name='Phi', latex_name=r'\Phi') 

sage: Phi 

Diffeomorphism Phi from the 2-dimensional differentiable manifold M 

to the 2-dimensional differentiable manifold N 

sage: Phi.display() 

Phi: M --> N 

(x, y) |--> (X, Y) = (x/sqrt(-x^2 - y^2 + 1), y/sqrt(-x^2 - y^2 + 1)) 

 

The inverse diffeomorphism:: 

 

sage: Phi^(-1) 

Diffeomorphism Phi^(-1) from the 2-dimensional differentiable 

manifold N to the 2-dimensional differentiable manifold M 

sage: (Phi^(-1)).display() 

Phi^(-1): N --> M 

(X, Y) |--> (x, y) = (X/sqrt(X^2 + Y^2 + 1), Y/sqrt(X^2 + Y^2 + 1)) 

 

See the documentation of class 

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

examples. 

 

""" 

homset = Hom(self, codomain) 

if coord_functions is None: 

coord_functions = {} 

if not isinstance(coord_functions, dict): 

# Turn coord_functions into a dictionary: 

if chart1 is None: 

chart1 = self._def_chart 

elif chart1 not in self._atlas: 

raise ValueError("{} is not a chart ".format(chart1) + 

"defined on the {}".format(self)) 

if chart2 is None: 

chart2 = codomain._def_chart 

elif chart2 not in codomain._atlas: 

raise ValueError("{} is not a chart ".format(chart2) + 

" defined on the {}".format(codomain)) 

coord_functions = {(chart1, chart2): coord_functions} 

return homset(coord_functions, name=name, latex_name=latex_name, 

is_isomorphism=True) 

 

def vector_field_module(self, dest_map=None, force_free=False): 

r""" 

Return the set of vector fields defined on ``self``, possibly 

with values in another differentiable manifold, as a module over the 

algebra of scalar fields defined on the manifold. 

 

See :class:`~sage.manifolds.differentiable.vectorfield_module.VectorFieldModule` 

for a complete documentation. 

 

INPUT: 

 

- ``dest_map`` -- (default: ``None``) destination map, i.e. a 

differentiable map `\Phi:\ M \rightarrow N`, where `M` is the 

current manifold and `N` a differentiable manifold; 

if ``None``, it is assumed that `N = M` and that `\Phi` is the 

identity map (case of vector fields *on* `M`), otherwise 

``dest_map`` must be a 

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

- ``force_free`` -- (default: ``False``) if set to ``True``, force 

the construction of a *free* module (this implies that `N` is 

parallelizable) 

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.vectorfield_module.VectorFieldModule` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.vectorfield_module.VectorFieldFreeModule`) 

representing the module `\mathfrak{X}(M,\Phi)` of vector fields on 

`M` taking values on `\Phi(M)\subset N` 

 

EXAMPLES: 

 

Vector field module `\mathfrak{X}(U) := \mathfrak{X}(U,\mathrm{Id}_U)` 

of the complement `U` of the two poles on the sphere `\mathbb{S}^2`:: 

 

sage: S2 = Manifold(2, 'S^2') 

sage: U = S2.open_subset('U') # the complement of the two poles 

sage: spher_coord.<th,ph> = U.chart(r'th:(0,pi):\theta ph:(0,2*pi):\phi') # spherical coordinates 

sage: XU = U.vector_field_module() ; XU 

Free module X(U) of vector fields on the Open subset U of 

the 2-dimensional differentiable manifold S^2 

sage: XU.category() 

Category of finite dimensional modules over Algebra of 

differentiable scalar fields on the Open subset U of 

the 2-dimensional differentiable manifold S^2 

sage: XU.base_ring() 

Algebra of differentiable scalar fields on the Open subset U of 

the 2-dimensional differentiable manifold S^2 

sage: XU.base_ring() is U.scalar_field_algebra() 

True 

 

`\mathfrak{X}(U)` is a free module because `U` is parallelizable 

(being a chart domain):: 

 

sage: U.is_manifestly_parallelizable() 

True 

 

Its rank is the manifold's dimension:: 

 

sage: XU.rank() 

2 

 

The elements of `\mathfrak{X}(U)` are vector fields on `U`:: 

 

sage: XU.an_element() 

Vector field on the Open subset U of the 2-dimensional 

differentiable manifold S^2 

sage: XU.an_element().display() 

2 d/dth + 2 d/dph 

 

Vector field module `\mathfrak{X}(U,\Phi)` of the 

`\RR^3`-valued vector fields along `U`, associated with the 

embedding `\Phi` of `\mathbb{S}^2` into `\RR^3`:: 

 

sage: R3 = Manifold(3, 'R^3') 

sage: cart_coord.<x, y, z> = R3.chart() 

sage: Phi = U.diff_map(R3, 

....: [sin(th)*cos(ph), sin(th)*sin(ph), cos(th)], name='Phi') 

sage: XU_R3 = U.vector_field_module(dest_map=Phi) ; XU_R3 

Free module X(U,Phi) of vector fields along the Open subset U of 

the 2-dimensional differentiable manifold S^2 mapped into the 

3-dimensional differentiable manifold R^3 

sage: XU_R3.base_ring() 

Algebra of differentiable scalar fields on the Open subset U of the 

2-dimensional differentiable manifold S^2 

 

`\mathfrak{X}(U,\Phi)` is a free module because `\RR^3` 

is parallelizable and its rank is 3:: 

 

sage: XU_R3.rank() 

3 

 

""" 

from sage.manifolds.differentiable.vectorfield_module import \ 

VectorFieldModule, VectorFieldFreeModule 

if dest_map is None: 

dest_map = self.identity_map() 

codomain = dest_map._codomain 

if dest_map not in self._vector_field_modules: 

if codomain.is_manifestly_parallelizable() or force_free: 

self._vector_field_modules[dest_map] = \ 

VectorFieldFreeModule(self, dest_map=dest_map) 

else: 

self._vector_field_modules[dest_map] = \ 

VectorFieldModule(self, dest_map=dest_map) 

return self._vector_field_modules[dest_map] 

 

def tensor_field_module(self, tensor_type, dest_map=None): 

r""" 

Return the set of tensor fields of a given type defined on ``self``, 

possibly with values in another manifold, as a module over 

the algebra of scalar fields defined on ``self``. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.tensorfield_module.TensorFieldModule` 

for complete documentation. 

 

INPUT: 

 

- ``tensor_type`` -- pair `(k,l)` with `k` being the contravariant 

rank and `l` the covariant rank 

- ``dest_map`` -- (default: ``None``) destination map, i.e. a 

differentiable map `\Phi:\ M \rightarrow N`, where `M` is the 

current manifold and `N` a differentiable manifold; 

if ``None``, it is assumed that `N = M` and that `\Phi` is the 

identity map (case of tensor fields *on* `M`), otherwise 

``dest_map`` must be a 

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

 

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)}(M,\Phi)` of type-`(k,l)` 

tensor fields on `M` taking values on `\Phi(M)\subset M` 

 

EXAMPLES: 

 

Module of type-`(2,1)` tensor fields on a 3-dimensional open subset of 

a differentiable manifold:: 

 

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

sage: U = M.open_subset('U') 

sage: c_xyz.<x,y,z> = U.chart() 

sage: TU = U.tensor_field_module((2,1)) ; TU 

Free module T^(2,1)(U) of type-(2,1) tensors fields on the Open 

subset U of the 3-dimensional differentiable manifold M 

sage: TU.category() 

Category of finite dimensional modules over Algebra of 

differentiable scalar fields on the Open subset U of the 

3-dimensional differentiable manifold M 

sage: TU.base_ring() 

Algebra of differentiable scalar fields on the Open subset U of 

the 3-dimensional differentiable manifold M 

sage: TU.base_ring() is U.scalar_field_algebra() 

True 

sage: TU.an_element() 

Tensor field of type (2,1) on the Open subset U of the 

3-dimensional differentiable manifold M 

sage: TU.an_element().display() 

2 d/dx*d/dx*dx 

 

""" 

return self.vector_field_module(dest_map=dest_map).tensor_module(*tensor_type) 

 

def diff_form_module(self, degree, dest_map=None): 

r""" 

Return the set of differential forms of a given degree defined on 

``self``, possibly with values in another manifold, as a module 

over the algebra of scalar fields defined on ``self``. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.diff_form_module.DiffFormModule` 

for complete documentation. 

 

INPUT: 

 

- ``degree`` -- positive integer; the degree `p` of the 

differential forms 

- ``dest_map`` -- (default: ``None``) destination map, i.e. a 

differentiable map `\Phi:\ M \rightarrow N`, where `M` is the 

current manifold and `N` a differentiable manifold; 

if ``None``, it is assumed that `N = M` and that `\Phi` is the 

identity map (case of differential forms *on* `M`), otherwise 

``dest_map`` must be a 

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

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.diff_form_module.DiffFormModule` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.diff_form_module.DiffFormFreeModule`) 

representing the module `\Omega^p(M,\Phi)` of `p`-forms on `M` 

taking values on `\Phi(M)\subset N` 

 

EXAMPLES: 

 

Module of 2-forms on a 3-dimensional parallelizable manifold:: 

 

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

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

sage: M.diff_form_module(2) 

Free module Omega^2(M) of 2-forms on the 3-dimensional 

differentiable manifold M 

sage: M.diff_form_module(2).category() 

Category of finite dimensional modules over Algebra of 

differentiable scalar fields on the 3-dimensional 

differentiable manifold M 

sage: M.diff_form_module(2).base_ring() 

Algebra of differentiable scalar fields on the 3-dimensional 

differentiable manifold M 

sage: M.diff_form_module(2).rank() 

3 

 

The outcome is cached:: 

 

sage: M.diff_form_module(2) is M.diff_form_module(2) 

True 

 

""" 

return self.vector_field_module(dest_map=dest_map).dual_exterior_power(degree) 

 

def multivector_module(self, degree, dest_map=None): 

r""" 

Return the set of multivector fields of a given degree defined 

on ``self``, possibly with values in another manifold, as a 

module over the algebra of scalar fields defined on ``self``. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.multivector_module.MultivectorModule` 

for complete documentation. 

 

INPUT: 

 

- ``degree`` -- positive integer; the degree `p` of the 

multivector fields 

- ``dest_map`` -- (default: ``None``) destination map, i.e. a 

differentiable map `\Phi:\ M \rightarrow N`, where `M` is the 

current manifold and `N` a differentiable manifold; 

if ``None``, it is assumed that `N = M` and that `\Phi` is the 

identity map (case of multivector fields *on* `M`), otherwise 

``dest_map`` must be a 

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

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.multivector_module.MultivectorModule` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.multivector_module.MultivectorFreeModule`) 

representing the module `\Omega^p(M,\Phi)` of `p`-forms on `M` 

taking values on `\Phi(M)\subset N` 

 

EXAMPLES: 

 

Module of 2-vector fields on a 3-dimensional parallelizable 

manifold:: 

 

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

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

sage: M.multivector_module(2) 

Free module A^2(M) of 2-vector fields on the 3-dimensional 

differentiable manifold M 

sage: M.multivector_module(2).category() 

Category of finite dimensional modules over Algebra of 

differentiable scalar fields on the 3-dimensional 

differentiable manifold M 

sage: M.multivector_module(2).base_ring() 

Algebra of differentiable scalar fields on the 3-dimensional 

differentiable manifold M 

sage: M.multivector_module(2).rank() 

3 

 

The outcome is cached:: 

 

sage: M.multivector_module(2) is M.multivector_module(2) 

True 

 

""" 

return self.vector_field_module(dest_map=dest_map).exterior_power(degree) 

 

def automorphism_field_group(self, dest_map=None): 

r""" 

Return the group of tangent-space automorphism fields defined on 

``self``, possibly with values in another manifold, as a module 

over the algebra of scalar fields defined on ``self``. 

 

If `M` is the current manifold and `\Phi` a differentiable map 

`\Phi: M \rightarrow N`, where `N` is a differentiable manifold, 

this method called with ``dest_map`` being `\Phi` returns the 

general linear group `\mathrm{GL}(\mathfrak{X}(M, \Phi))` of the module 

`\mathfrak{X}(M, \Phi)` of vector fields along `M` with values in 

`\Phi(M) \subset N`. 

 

INPUT: 

 

- ``dest_map`` -- (default: ``None``) destination map, i.e. a 

differentiable map `\Phi:\ M \rightarrow N`, where `M` is the 

current manifold and `N` a differentiable manifold; 

if ``None``, it is assumed that `N = M` and that `\Phi` is the 

identity map, otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.automorphismfield_group.AutomorphismFieldParalGroup` 

(if `N` is parallelizable) or a 

:class:`~sage.manifolds.differentiable.automorphismfield_group.AutomorphismFieldGroup` 

(if `N` is not parallelizable) representing 

`\mathrm{GL}(\mathfrak{X}(U, \Phi))` 

 

EXAMPLES: 

 

Group of tangent-space automorphism fields of a 2-dimensional 

differentiable manifold:: 

 

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

sage: M.automorphism_field_group() 

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

2-dimensional differentiable manifold M 

sage: M.automorphism_field_group().category() 

Category of groups 

 

.. SEEALSO:: 

 

For more examples, see 

:class:`~sage.manifolds.differentiable.automorphismfield_group.AutomorphismFieldParalGroup` 

and 

:class:`~sage.manifolds.differentiable.automorphismfield_group.AutomorphismFieldGroup`. 

""" 

return self.vector_field_module(dest_map=dest_map).general_linear_group() 

 

def vector_field(self, name=None, latex_name=None, dest_map=None): 

r""" 

Define a vector field on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the vector field 

take its values on another manifold. More precisely, if `M` is 

the current manifold, `N` a differentiable manifold and 

`\Phi:\ M \rightarrow N` a differentiable map, a *vector field 

along* `M` *with values on* `N` is a differentiable map 

 

.. MATH:: 

 

v:\ M \longrightarrow TN 

 

(`TN` being the tangent bundle of `N`) such that 

 

.. MATH:: 

 

\forall p \in M,\ v(p) \in T_{\Phi(p)} N, 

 

where `T_{\Phi(p)} N` is the tangent space to `N` at the 

point `\Phi(p)`. 

 

The standard case of vector fields *on* `M` corresponds 

to `N = M` 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`). 

 

See :class:`~sage.manifolds.differentiable.vectorfield.VectorField` 

for a complete documentation. 

 

INPUT: 

 

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

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

vector field; if none is provided, the LaTeX symbol is set to 

``name`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that `N = M` 

andthat `\Phi` is the identity map (case of a vector field 

*on* `M`), otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.vectorfield.VectorField` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.vectorfield.VectorFieldParal`) 

representing the defined vector field 

 

EXAMPLES: 

 

A vector field on a open subset of a 3-dimensional differentiable 

manifold:: 

 

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

sage: U = M.open_subset('U') 

sage: c_xyz.<x,y,z> = U.chart() 

sage: v = U.vector_field('v'); v 

Vector field v on the Open subset U of the 3-dimensional 

differentiable manifold M 

 

The vector fields on `U` form the set `\mathfrak{X}(U)`, which is a 

module over the algebra `C^k(U)` of differentiable scalar fields 

on `U`:: 

 

sage: v.parent() 

Free module X(U) of vector fields on the Open subset U of the 

3-dimensional differentiable manifold M 

sage: v in U.vector_field_module() 

True 

 

.. SEEALSO:: 

 

For more examples, see 

:class:`~sage.manifolds.differentiable.vectorfield.VectorField`. 

 

""" 

vmodule = self.vector_field_module(dest_map) # the parent 

return vmodule.element_class(vmodule, name=name, latex_name=latex_name) 

 

def tensor_field(self, k, l, name=None, latex_name=None, sym=None, 

antisym=None, dest_map=None): 

r""" 

Define a tensor field on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the tensor field 

take its values on another manifold. More precisely, if `M` is 

the current manifold, `N` a differentiable manifold, 

`\Phi:\ M \rightarrow N` a differentiable map and `(k,l)` 

a pair of non-negative integers, a *tensor field of type* `(k,l)` 

*along* `M` *with values on* `N` is a differentiable map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^{(k,l)} N 

 

(`T^{(k,l)}N` being the tensor bundle of type `(k,l)` over `N`) 

such that 

 

.. MATH:: 

 

\forall p \in M,\ t(p) \in T^{(k,l)}(T_{\Phi(p)} N), 

 

where `T^{(k,l)}(T_{\Phi(p)} N)` is the space of tensors of type 

`(k,l)` on the tangent space `T_{\Phi(p)} N`. 

 

The standard case of tensor fields *on* `M` corresponds 

to `N=M` 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`). 

 

See :class:`~sage.manifolds.differentiable.tensorfield.TensorField` 

for a complete documentation. 

 

INPUT: 

 

- ``k`` -- the contravariant rank `k`, the tensor type being `(k,l)` 

- ``l`` -- the covariant rank `l`, the tensor type being `(k,l)` 

- ``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`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that `N = M` 

and that `\Phi` is the identity map (case of a tensor field 

*on* `M`), otherwise ``dest_map`` must be a 

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

 

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 

 

EXAMPLES: 

 

A tensor field of type `(2,0)` on an open subset of a 3-dimensional 

differentiable manifold:: 

 

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

sage: U = M.open_subset('U') 

sage: c_xyz.<x,y,z> = U.chart() 

sage: t = U.tensor_field(2, 0, 'T'); t 

Tensor field T of type (2,0) on the Open subset U of the 

3-dimensional differentiable manifold M 

 

The type `(2,0)` tensor fields on `U` form the set 

`\mathcal{T}^{(2,0)}(U)`, which is a module over the algebra `C^k(U)` 

of differentiable scalar fields on `U`:: 

 

sage: t.parent() 

Free module T^(2,0)(U) of type-(2,0) tensors fields on the Open 

subset U of the 3-dimensional differentiable manifold M 

sage: t in U.tensor_field_module((2,0)) 

True 

 

.. SEEALSO:: 

 

For more examples, see 

:class:`~sage.manifolds.differentiable.tensorfield.TensorField`. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.tensor((k,l), name=name, latex_name=latex_name, 

sym=sym, antisym=antisym) 

 

def sym_bilin_form_field(self, name=None, latex_name=None, dest_map=None): 

r""" 

Define a field of symmetric bilinear forms on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the field 

take its values on another manifold. More precisely, if `M` is 

the current manifold, `N` a differentiable manifold and 

`\Phi:\ M \rightarrow N` a differentiable map, a *field of 

symmetric bilinear forms along* `M` *with values on* `N` is a 

differentiable map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^{(0,2)}N 

 

(`T^{(0,2)} N` being the tensor bundle of type `(0,2)` over `N`) 

such that 

 

.. MATH:: 

 

\forall p \in M,\ t(p) \in S(T_{\Phi(p)} N), 

 

where `S(T_{\Phi(p)} N)` is the space of symmetric bilinear forms on 

the tangent space `T_{\Phi(p)} N`. 

 

The standard case of fields of symmetric bilinear forms *on* `M` 

corresponds to `N = M` 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: 

 

- ``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`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that `N = M` 

and that `\Phi` is the identity map (case of a field *on* `M`), 

otherwise ``dest_map`` must be an instance of instance of 

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

 

OUTPUT: 

 

- a :class:`~sage.manifolds.differentiable.tensorfield.TensorField` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.tensorfield_paral.TensorFieldParal`) 

of tensor type `(0,2)` and symmetric representing the defined 

field of symmetric bilinear forms 

 

EXAMPLES: 

 

A field of symmetric bilinear forms on a 3-dimensional manifold:: 

 

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

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

sage: t = M.sym_bilin_form_field('T'); t 

Field of symmetric bilinear forms T on the 3-dimensional 

differentiable manifold M 

 

Such a object is a tensor field of rank 2 and type `(0,2)`:: 

 

sage: t.parent() 

Free module T^(0,2)(M) of type-(0,2) tensors fields on the 

3-dimensional differentiable manifold M 

sage: t.tensor_rank() 

2 

sage: t.tensor_type() 

(0, 2) 

 

The LaTeX symbol is deduced from the name or can be specified when 

creating the object:: 

 

sage: latex(t) 

T 

sage: om = M.sym_bilin_form_field('Omega', r'\Omega') 

sage: latex(om) 

\Omega 

 

Components with respect to some vector frame:: 

 

sage: e = M.vector_frame('e') ; M.set_default_frame(e) 

sage: t.set_comp() 

Fully symmetric 2-indices components w.r.t. Vector frame 

(M, (e_0,e_1,e_2)) 

sage: type(t.comp()) 

<class 'sage.tensor.modules.comp.CompFullySym'> 

 

For the default frame, the components are accessed with the 

square brackets:: 

 

sage: t[0,0], t[0,1], t[0,2] = (1, 2, 3) 

sage: t[1,1], t[1,2] = (4, 5) 

sage: t[2,2] = 6 

 

The other components are deduced by symmetry:: 

 

sage: t[1,0], t[2,0], t[2,1] 

(2, 3, 5) 

sage: t[:] 

[1 2 3] 

[2 4 5] 

[3 5 6] 

 

A symmetric bilinear form acts on vector pairs:: 

 

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

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

sage: t = M.sym_bilin_form_field('T') 

sage: t[0,0], t[0,1], t[1,1] = (-1, x, y*x) 

sage: v1 = M.vector_field('V_1') 

sage: v1[:] = (y,x) 

sage: v2 = M.vector_field('V_2') 

sage: v2[:] = (x+y,2) 

sage: s = t(v1,v2) ; s 

Scalar field T(V_1,V_2) on the 2-dimensional differentiable 

manifold M 

sage: s.expr() 

x^3 + (3*x^2 + x)*y - y^2 

sage: s.expr() - t[0,0]*v1[0]*v2[0] - \ 

....: t[0,1]*(v1[0]*v2[1]+v1[1]*v2[0]) - t[1,1]*v1[1]*v2[1] 

0 

sage: latex(s) 

T\left(V_1,V_2\right) 

 

Adding two symmetric bilinear forms results in another symmetric 

bilinear form:: 

 

sage: a = M.sym_bilin_form_field() 

sage: a[0,0], a[0,1], a[1,1] = (1,2,3) 

sage: b = M.sym_bilin_form_field() 

sage: b[0,0], b[0,1], b[1,1] = (-1,4,5) 

sage: s = a + b ; s 

Field of symmetric bilinear forms on the 2-dimensional 

differentiable manifold M 

sage: s[:] 

[0 6] 

[6 8] 

 

But adding a symmetric bilinear from with a non-symmetric bilinear 

form results in a generic type `(0,2)` tensor:: 

 

sage: c = M.tensor_field(0,2) 

sage: c[:] = [[-2, -3], [1,7]] 

sage: s1 = a + c ; s1 

Tensor field of type (0,2) on the 2-dimensional differentiable 

manifold M 

sage: s1[:] 

[-1 -1] 

[ 3 10] 

sage: s2 = c + a ; s2 

Tensor field of type (0,2) on the 2-dimensional differentiable 

manifold M 

sage: s2[:] 

[-1 -1] 

[ 3 10] 

 

""" 

return self.tensor_field(0, 2, name=name, latex_name=latex_name, 

sym=(0,1)) 

 

def multivector_field(self, degree, name=None, latex_name=None, 

dest_map=None): 

r""" 

Define a multivector field on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the 

multivector field take its values on another manifold. More 

precisely, if `M` is the current manifold, `N` a differentiable 

manifold, `\Phi:\ M \rightarrow N` a differentiable map and `p` 

a non-negative integer, a *multivector field of degree* `p` (or 

`p`-*vector field*) *along* `M` *with values on* `N` is a 

differentiable map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^{(p,0)} N 

 

(`T^{(p,0)} N` being the tensor bundle of type `(p,0)` over `N`) 

such that 

 

.. MATH:: 

 

\forall x \in M,\quad t(x) \in \Lambda^p(T_{\Phi(x)} N), 

 

where `\Lambda^p(T_{\Phi(x)} N)` is the `p`-th exterior power 

of the tangent vector space `T_{\Phi(x)} N`. 

 

The standard case of a `p`-vector field *on* `M` corresponds 

to `N = M` 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`). 

 

For `p = 1`, one can use the method 

:meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.vector_field` 

instead. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.multivectorfield.MultivectorField` 

for complete documentation. 

 

INPUT: 

 

- ``degree`` -- the degree `p` of the multivector field (i.e. 

its tensor rank) 

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

field 

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

the multivector field; if none is provided, the LaTeX symbol 

is set to ``name`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that 

`N = M` and that `\Phi` is the identity map (case of a 

multivector field *on* `M`), otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- the `p`-vector field as a 

:class:`~sage.manifolds.differentiable.multivectorfield.MultivectorField` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.multivectorfield.MultivectorFieldParal`) 

 

EXAMPLES: 

 

A 2-vector field on a open subset of a 4-dimensional 

differentiable manifold:: 

 

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

sage: A = M.open_subset('A', latex_name=r'\mathcal{A}'); A 

Open subset A of the 4-dimensional differentiable manifold M 

sage: c_xyzt.<x,y,z,t> = A.chart() 

sage: h = A.multivector_field(2, 'H'); h 

2-vector field H on the Open subset A of the 4-dimensional 

differentiable manifold M 

 

See the documentation of class 

:class:`~sage.manifolds.differentiable.multivectorfield.MultivectorField` 

for more examples. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.alternating_contravariant_tensor(degree, 

name=name, latex_name=latex_name) 

 

def diff_form(self, degree, name=None, latex_name=None, 

dest_map=None): 

r""" 

Define a differential form on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the 

differential form take its values on another manifold. More 

precisely, if `M` is the current manifold, `N` a differentiable 

manifold, `\Phi:\ M \rightarrow N` a differentiable map and `p` 

a non-negative integer, a *differential form of degree* `p` (or 

`p`-*form*) *along* `M` *with values on* `N` is a differentiable 

map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^{(0,p)}N 

 

(`T^{(0,p)} N` being the tensor bundle of type `(0,p)` over `N`) 

such that 

 

.. MATH:: 

 

\forall x \in M,\quad t(x) \in \Lambda^p(T^*_{\Phi(x)} N), 

 

where `\Lambda^p(T^*_{\Phi(x)} N)` is the `p`-th exterior power 

of the dual of the tangent space `T_{\Phi(x)} N`. 

 

The standard case of a differential form *on* `M` corresponds 

to `N = M` 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`). 

 

For `p = 1`, one can use the method 

:meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.one_form` 

instead. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.diff_form.DiffForm` 

for complete documentation. 

 

INPUT: 

 

- ``degree`` -- the degree `p` of the differential form (i.e. 

its tensor rank) 

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

form 

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

the differential form; if none is provided, the LaTeX symbol 

is set to ``name`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that 

`N = M` and that `\Phi` is the identity map (case of a 

differential form *on* `M`), otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- the `p`-form as a 

:class:`~sage.manifolds.differentiable.diff_form.DiffForm` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.diff_form.DiffFormParal`) 

 

EXAMPLES: 

 

A 2-form on a open subset of a 4-dimensional differentiable 

manifold:: 

 

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

sage: A = M.open_subset('A', latex_name=r'\mathcal{A}'); A 

Open subset A of the 4-dimensional differentiable manifold M 

sage: c_xyzt.<x,y,z,t> = A.chart() 

sage: f = A.diff_form(2, 'F'); f 

2-form F on the Open subset A of the 4-dimensional 

differentiable manifold M 

 

See the documentation of class 

:class:`~sage.manifolds.differentiable.diff_form.DiffForm` for 

more examples. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.alternating_form(degree, name=name, 

latex_name=latex_name) 

 

def one_form(self, name=None, latex_name=None, dest_map=None): 

r""" 

Define a 1-form on the manifold. 

 

Via the argument ``dest_map``, it is possible to let the 

1-form take its values on another manifold. More precisely, 

if `M` is the current manifold, `N` a differentiable 

manifold and `\Phi:\ M \rightarrow N` a differentiable map, 

a *1-form along* `M` *with values on* `N` is a differentiable 

map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^* N 

 

(`T^* N` being the cotangent bundle of `N`) such that 

 

.. MATH:: 

 

\forall p \in M,\quad t(p) \in T^*_{\Phi(p)}N, 

 

where `T^*_{\Phi(p)}` is the dual of the tangent space 

`T_{\Phi(p)} N`. 

 

The standard case of a 1-form *on* `M` corresponds to `N = M` 

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`). 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.diff_form.DiffForm` 

for complete documentation. 

 

INPUT: 

 

- ``name`` -- (default: ``None``) name given to the 1-form 

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

the 1-form; if none is provided, the LaTeX symbol is set to 

``name`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that 

`N = M` and that `\Phi` is the identity map (case of a 1-form 

*on* `M`), otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- the 1-form as a 

:class:`~sage.manifolds.differentiable.diff_form.DiffForm` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.diff_form.DiffFormParal`) 

 

EXAMPLES: 

 

A 1-form on a 3-dimensional open subset:: 

 

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

sage: A = M.open_subset('A', latex_name=r'\mathcal{A}') 

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

sage: om = A.one_form('omega', r'\omega') ; om 

1-form omega on the Open subset A of the 3-dimensional 

differentiable manifold M 

sage: om.parent() 

Free module Omega^1(A) of 1-forms on the Open subset A of 

the 3-dimensional differentiable manifold M 

 

.. SEEALSO:: 

 

For more examples, see 

:class:`~sage.manifolds.differentiable.diff_form.DiffForm`. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.linear_form(name=name, latex_name=latex_name) 

 

def automorphism_field(self, name=None, latex_name=None, 

dest_map=None): 

r""" 

Define a field of automorphisms (invertible endomorphisms in each 

tangent space) on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the 

field take its values on another manifold. More precisely, 

if `M` is the current manifold, `N` a differentiable 

manifold and `\Phi:\ M \rightarrow N` a differentiable map, 

a *field of automorphisms along* `M` *with values on* `N` is a 

differentiable map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^{(1,1)} N 

 

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

such that 

 

.. MATH:: 

 

\forall p \in M,\ t(p) \in \mathrm{GL}\left(T_{\Phi(p)} N \right), 

 

where `\mathrm{GL}\left(T_{\Phi(p)} N \right)` is the general linear 

group of the tangent space `T_{\Phi(p)} N`. 

 

The standard case of a field of automorphisms *on* `M` corresponds 

to `N = M` 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`). 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismField` 

for complete documentation. 

 

INPUT: 

 

- ``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`` 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that `N = M` 

and that `\Phi` is the identity map (case of a field of 

automorphisms *on* `M`), otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismField` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismFieldParal`) 

representing the defined field of automorphisms 

 

EXAMPLES: 

 

A field of automorphisms on a 3-dimensional manifold:: 

 

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

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

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

Field of tangent-space automorphisms A on the 3-dimensional 

differentiable manifold M 

sage: a.parent() 

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

the 3-dimensional differentiable manifold M 

 

.. SEEALSO:: 

 

For more examples, see 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismField`. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.automorphism(name=name, latex_name=latex_name) 

 

def tangent_identity_field(self, name='Id', latex_name=None, 

dest_map=None): 

r""" 

Return the field of identity maps in the tangent spaces on ``self``. 

 

Via the argument ``dest_map``, it is possible to let the 

field take its values on another manifold. More precisely, 

if `M` is the current manifold, `N` a differentiable 

manifold and `\Phi:\ M \rightarrow N` a differentiable map, 

a *field of identity maps along* `M` *with values on* `N` is a 

differentiable map 

 

.. MATH:: 

 

t:\ M \longrightarrow T^{(1,1)} N 

 

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

that 

 

.. MATH:: 

 

\forall p \in M,\ t(p) = \mathrm{Id}_{T_{\Phi(p)} N}, 

 

where `\mathrm{Id}_{T_{\Phi(p)} N}` is the identity map of the 

tangent space `T_{\Phi(p)} N`. 

 

The standard case of a field of identity maps *on* `M` corresponds 

to `N = M` 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: 

 

- ``name`` -- (string; default: 'Id') name given to the field of 

identity maps 

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

the field of identity map; if none is provided, the LaTeX symbol is 

set to '\mathrm{Id}' if ``name`` is 'Id' and to ``name`` otherwise 

- ``dest_map`` -- (default: ``None``) the destination map 

`\Phi:\ M \rightarrow N`; if ``None``, it is assumed that `N = M` 

and that `\Phi` is the identity map (case of a field of identity 

maps *on* `M`), otherwise ``dest_map`` must be a 

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

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismField` 

(or if `N` is parallelizable, a 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismFieldParal`) 

representing the field of identity maps 

 

EXAMPLES: 

 

Field of tangent-space identity maps on a 3-dimensional manifold:: 

 

sage: M = Manifold(3, 'M', start_index=1) 

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

sage: a = M.tangent_identity_field(); a 

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

differentiable manifold M 

sage: a.comp() 

Kronecker delta of size 3x3 

 

.. SEEALSO:: 

 

For more examples, see 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismField`. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.identity_map(name=name, latex_name=latex_name) 

 

def default_frame(self): 

r""" 

Return the default vector frame defined on ``self``. 

 

By *vector frame*, it is meant a field on the manifold that provides, 

at each point `p`, a vector basis of the tangent space at `p`. 

 

Unless changed via :meth:`set_default_frame`, the default frame is 

the first one defined on the manifold, usually implicitely as the 

coordinate basis associated with the first chart defined on the 

manifold. 

 

OUTPUT: 

 

- a :class:`~sage.manifolds.differentiable.vectorframe.VectorFrame` 

representing the default vector frame 

 

EXAMPLES: 

 

The default vector frame is often the coordinate frame associated 

with the first chart defined on the manifold:: 

 

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

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

sage: M.default_frame() 

Coordinate frame (M, (d/dx,d/dy)) 

 

""" 

return self._def_frame 

 

def set_default_frame(self, frame): 

r""" 

Changing the default vector frame on ``self``. 

 

INPUT: 

 

- ``frame`` -- 

:class:`~sage.manifolds.differentiable.vectorframe.VectorFrame` 

a vector frame defined on the manifold 

 

EXAMPLES: 

 

Changing the default frame on a 2-dimensional manifold:: 

 

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

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

sage: e = M.vector_frame('e') 

sage: M.default_frame() 

Coordinate frame (M, (d/dx,d/dy)) 

sage: M.set_default_frame(e) 

sage: M.default_frame() 

Vector frame (M, (e_0,e_1)) 

 

""" 

from sage.manifolds.differentiable.vectorframe import VectorFrame 

if not isinstance(frame, VectorFrame): 

raise TypeError("{} is not a vector frame".format(frame)) 

if frame._domain is not self: 

if self.is_manifestly_parallelizable(): 

raise ValueError("the frame domain must coincide with " + 

"the {}".format(self)) 

if not frame._domain.is_subset(self): 

raise ValueError("the frame must be defined on " + 

"the {}".format(self)) 

self._def_frame = frame 

frame._fmodule.set_default_basis(frame) 

 

def change_of_frame(self, frame1, frame2): 

r""" 

Return a change of vector frames defined on ``self``. 

 

INPUT: 

 

- ``frame1`` -- vector frame 1 

- ``frame2`` -- vector frame 2 

 

OUTPUT: 

 

- a 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismField` 

representing, at each point, the vector space automorphism `P` 

that relates frame 1, `(e_i)` say, to frame 2, `(n_i)` say, 

according to `n_i = P(e_i)` 

 

EXAMPLES: 

 

Change of vector frames induced by a change of coordinates:: 

 

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: M.change_of_frame(c_xy.frame(), c_uv.frame()) 

Field of tangent-space automorphisms on the 2-dimensional 

differentiable manifold M 

sage: M.change_of_frame(c_xy.frame(), c_uv.frame())[:] 

[ 1/2 1/2] 

[ 1/2 -1/2] 

sage: M.change_of_frame(c_uv.frame(), c_xy.frame()) 

Field of tangent-space automorphisms on the 2-dimensional 

differentiable manifold M 

sage: M.change_of_frame(c_uv.frame(), c_xy.frame())[:] 

[ 1 1] 

[ 1 -1] 

sage: M.change_of_frame(c_uv.frame(), c_xy.frame()) == \ 

....: M.change_of_frame(c_xy.frame(), c_uv.frame()).inverse() 

True 

 

In the present example, the manifold `M` is parallelizable, so 

that the module `X(M)` of vector fields on `M` is free. A change 

of frame on `M` is then identical to a change of basis in `X(M)`:: 

 

sage: XM = M.vector_field_module() ; XM 

Free module X(M) of vector fields on the 2-dimensional 

differentiable manifold M 

sage: XM.print_bases() 

Bases defined on the Free module X(M) of vector fields on the 

2-dimensional differentiable manifold M: 

- (M, (d/dx,d/dy)) (default basis) 

- (M, (d/du,d/dv)) 

sage: XM.change_of_basis(c_xy.frame(), c_uv.frame()) 

Field of tangent-space automorphisms on the 2-dimensional 

differentiable manifold M 

sage: M.change_of_frame(c_xy.frame(), c_uv.frame()) is \ 

....: XM.change_of_basis(c_xy.frame(), c_uv.frame()) 

True 

 

""" 

if (frame1, frame2) not in self._frame_changes: 

raise ValueError("the change of frame from {} to {}".format(frame1, frame2) + 

" has not been defined on the {}".format(self)) 

return self._frame_changes[(frame1, frame2)] 

 

 

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

 

INPUT: 

 

- ``frame1`` -- frame 1, denoted `(e_i)` below 

- ``frame2`` -- frame 2, denoted `(f_i)` below 

- ``change_of_frame`` -- instance of class 

:class:`~sage.manifolds.differentiable.automorphismfield.AutomorphismFieldParal` 

describing the automorphism `P` that relates the basis `(e_i)` to 

the basis `(f_i)` according to `f_i = P(e_i)` 

- ``compute_inverse`` (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: 

 

Connecting two vector frames on a 2-dimensional manifold:: 

 

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: M.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: M.change_of_frame(e,f)[e,:] 

[1 2] 

[0 3] 

 

""" 

from sage.manifolds.differentiable.automorphismfield import AutomorphismFieldParal 

fmodule = frame1._fmodule 

if frame2._fmodule != fmodule: 

raise ValueError("the two frames are not defined on the same " + 

"vector field module") 

if not isinstance(change_of_frame, AutomorphismFieldParal): 

raise TypeError("the argument change_of_frame must be some " + 

"instance of AutomorphismFieldParal") 

fmodule.set_change_of_basis(frame1, frame2, change_of_frame, 

compute_inverse=compute_inverse) 

for sdom in self._supersets: 

sdom._frame_changes[(frame1, frame2)] = change_of_frame 

if compute_inverse: 

if (frame2, frame1) not in self._frame_changes: 

for sdom in self._supersets: 

sdom._frame_changes[(frame2, frame1)] = change_of_frame.inverse() 

 

def vector_frame(self, symbol=None, latex_symbol=None, dest_map=None, 

from_frame=None, indices=None, latex_indices=None, 

symbol_dual=None, latex_symbol_dual=None): 

r""" 

Define a vector frame on ``self``. 

 

A *vector frame* is a field on the manifold that provides, at each 

point `p` of the manifold, a vector basis of the tangent space at `p` 

(or at `\Phi(p)` when ``dest_map`` is not ``None``, see below). 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.vectorframe.VectorFrame` 

for complete documentation. 

 

INPUT: 

 

- ``symbol`` -- (default: ``None``) either a string, to be used as a 

common base for the symbols of the vector fields constituting the 

vector frame, or a list/tuple of strings, representing the individual 

symbols of the vector fields; can be ``None`` only if ``from_frame`` 

is not ``None`` (see below) 

- ``latex_symbol`` -- (default: ``None``) either a string, to be used 

as a common base for the LaTeX symbols of the vector fields 

constituting the vector frame, or a list/tuple of strings, 

representing the individual LaTeX symbols of the vector fields; 

if ``None``, ``symbol`` is used in place of ``latex_symbol`` 

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

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

destination map `\Phi:\ U \rightarrow M`, where `U` is ``self`` and 

`M` is a differentiable manifold; for each `p\in U`, the vector 

frame evaluated at `p` is a basis of the tangent space 

`T_{\Phi(p)}M`; if ``dest_map`` is ``None``, the identity is assumed 

(case of a vector frame *on* `U`) 

- ``from_frame`` -- (default: ``None``) vector frame `\tilde{e}` 

on the codomain `M` of the destination map `\Phi`; the returned 

frame `e` is then such that for all `p \in U`, 

we have `e(p) = \tilde{e}(\Phi(p))` 

- ``indices`` -- (default: ``None``; used only if ``symbol`` is a 

single string) tuple of strings representing the indices labelling 

the vector fields of the frame; if ``None``, the indices will be 

generated as integers within the range declared on ``self`` 

- ``latex_indices`` -- (default: ``None``) tuple of strings 

representing the indices for the LaTeX symbols of the vector fields; 

if ``None``, ``indices`` is used instead 

- ``symbol_dual`` -- (default: ``None``) same as ``symbol`` but for the 

dual coframe; if ``None``, ``symbol`` must be a string and is used 

for the common base of the symbols of the elements of the dual 

coframe 

- ``latex_symbol_dual`` -- (default: ``None``) same as ``latex_symbol`` 

but for the dual coframe 

 

OUTPUT: 

 

- a :class:`~sage.manifolds.differentiable.vectorframe.VectorFrame` 

representing the defined vector frame 

 

EXAMPLES: 

 

Setting a vector frame on a 3-dimensional manifold:: 

 

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

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

sage: e = M.vector_frame('e'); e 

Vector frame (M, (e_0,e_1,e_2)) 

sage: e[0] 

Vector field e_0 on the 3-dimensional differentiable manifold M 

 

.. SEEALSO:: 

 

For more options, in particular for the choice of symbols and 

indices, see 

:class:`~sage.manifolds.differentiable.vectorframe.VectorFrame`. 

 

""" 

from sage.manifolds.differentiable.vectorframe import VectorFrame 

return VectorFrame(self.vector_field_module(dest_map=dest_map, 

force_free=True), 

symbol=symbol, latex_symbol=latex_symbol, 

from_frame=from_frame, indices=indices, 

latex_indices=latex_indices, symbol_dual=symbol_dual, 

latex_symbol_dual=latex_symbol_dual) 

 

def _set_covering_frame(self, frame): 

r""" 

Declare a frame covering ``self``. 

 

This helper method is invoked by the frame constructor. 

 

TESTS:: 

 

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

sage: M._covering_frames 

[] 

sage: e = M.vector_frame('e') 

sage: M._covering_frames 

[Vector frame (M, (e_0,e_1))] 

sage: M._covering_frames = [] 

sage: M._set_covering_frame(e) 

sage: M._covering_frames 

[Vector frame (M, (e_0,e_1))] 

 

""" 

self._covering_frames.append(frame) 

self._parallelizable_parts = set([self]) 

# if self contained smaller parallelizable parts, they are forgotten 

for sd in self._supersets: 

if not sd.is_manifestly_parallelizable(): 

sd._parallelizable_parts.add(self) 

 

def frames(self): 

r""" 

Return the list of vector frames defined on open subsets of ``self``. 

 

OUTPUT: 

 

- list of vector frames defined on open subsets of ``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: M.frames() 

[Coordinate frame (R^2, (d/dx,d/dy))] 

sage: e = M.vector_frame('e') 

sage: M.frames() 

[Coordinate frame (R^2, (d/dx,d/dy)), 

Vector frame (R^2, (e_0,e_1))] 

sage: U = M.open_subset('U', coord_def={c_cart: x^2+y^2<1}) # unit disk 

sage: U.frames() 

[Coordinate frame (U, (d/dx,d/dy))] 

sage: M.frames() 

[Coordinate frame (R^2, (d/dx,d/dy)), 

Vector frame (R^2, (e_0,e_1)), 

Coordinate frame (U, (d/dx,d/dy))] 

 

""" 

return self._frames 

 

def coframes(self): 

r""" 

Return the list of coframes defined on open subsets of ``self``. 

 

OUTPUT: 

 

- list of coframes defined on open subsets of ``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 

sage: M.coframes() 

[Coordinate coframe (R^2, (dx,dy))] 

sage: e = M.vector_frame('e') 

sage: M.coframes() 

[Coordinate coframe (R^2, (dx,dy)), Coframe (R^2, (e^0,e^1))] 

sage: U = M.open_subset('U', coord_def={c_cart: x^2+y^2<1}) # unit disk 

sage: U.coframes() 

[Coordinate coframe (U, (dx,dy))] 

sage: e.restrict(U) 

Vector frame (U, (e_0,e_1)) 

sage: U.coframes() 

[Coordinate coframe (U, (dx,dy)), Coframe (U, (e^0,e^1))] 

sage: M.coframes() 

[Coordinate coframe (R^2, (dx,dy)), 

Coframe (R^2, (e^0,e^1)), 

Coordinate coframe (U, (dx,dy)), 

Coframe (U, (e^0,e^1))] 

 

""" 

return self._coframes 

 

def changes_of_frame(self): 

r""" 

Return all the changes of vector frames defined on ``self``. 

 

OUTPUT: 

 

- dictionary of fields of tangent-space automorphisms 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: e = X.frame(); e 

Coordinate frame (M, (d/dx,d/dy)) 

 

At this stage, the dictionary of changes of frame is empty:: 

 

sage: M.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: M.changes_of_frame() # random (dictionary output) 

{(Coordinate frame (M, (d/dx,d/dy)), 

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, (d/dx,d/dy))): Field of tangent-space 

automorphisms on the 2-dimensional differentiable manifold M} 

 

Some checks:: 

 

sage: M.changes_of_frame()[(e,f)] == a 

True 

sage: M.changes_of_frame()[(f,e)] == a^(-1) 

True 

 

""" 

return self._frame_changes 

 

def is_manifestly_parallelizable(self): 

r""" 

Return ``True`` if ``self`` is known to be a parallelizable 

and ``False`` otherwise. 

 

If ``False`` is returned, either the manifold is not parallelizable 

or no vector frame has been defined on it yet. 

 

EXAMPLES: 

 

A just created manifold is a priori not manifestly parallelizable:: 

 

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

sage: M.is_manifestly_parallelizable() 

False 

 

Defining a vector frame on it makes it parallelizable:: 

 

sage: e = M.vector_frame('e') 

sage: M.is_manifestly_parallelizable() 

True 

 

Defining a coordinate chart on the whole manifold also makes it 

parallelizable:: 

 

sage: N = Manifold(4, 'N') 

sage: X.<t,x,y,z> = N.chart() 

sage: N.is_manifestly_parallelizable() 

True 

 

""" 

return bool(self._covering_frames) 

 

def tangent_space(self, point): 

r""" 

Tangent space to ``self`` at a given point. 

 

INPUT: 

 

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

point `p` on the manifold 

 

OUTPUT: 

 

- :class:`~sage.manifolds.differentiable.tangent_space.TangentSpace` 

representing the tangent vector space `T_{p} M`, where `M` is the 

current manifold 

 

EXAMPLES: 

 

A tangent space to a 2-dimensional manifold:: 

 

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

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

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

sage: Tp = M.tangent_space(p); Tp 

Tangent space at Point p on the 2-dimensional differentiable 

manifold M 

sage: Tp.category() 

Category of finite dimensional vector spaces over Symbolic Ring 

sage: dim(Tp) 

2 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.tangent_space.TangentSpace` 

for more examples. 

 

""" 

from sage.manifolds.point import ManifoldPoint 

from sage.manifolds.differentiable.tangent_space import TangentSpace 

if not isinstance(point, ManifoldPoint): 

raise TypeError("{} is not a manifold point".format(point)) 

if point not in self: 

raise ValueError("{} is not a point on the {}".format(point, self)) 

return TangentSpace(point) 

 

def curve(self, coord_expression, param, chart=None, 

name=None, latex_name=None): 

r""" 

Define a differentiable curve in the manifold. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.curve.DifferentiableCurve` 

for details. 

 

INPUT: 

 

- ``coord_expression`` -- either 

 

- (i) a dictionary whose keys are charts on the manifold and values 

the coordinate expressions (as lists or tuples) of the curve in 

the given chart 

- (ii) a single coordinate expression in a given chart on the 

manifold, the latter being provided by the argument ``chart`` 

 

in both cases, if the dimension of the manifold is 1, a single 

coordinate expression can be passed instead of a tuple with 

a single element 

- ``param`` -- a tuple of the type ``(t, t_min, t_max)``, where 

 

* ``t`` is the curve parameter used in ``coord_expression``; 

* ``t_min`` is its minimal value; 

* ``t_max`` its maximal value; 

 

if ``t_min=-Infinity`` and ``t_max=+Infinity``, they can be 

omitted and ``t`` can be passed for ``param`` instead of the 

tuple ``(t, t_min, t_max)`` 

- ``chart`` -- (default: ``None``) chart on the manifold used for 

case (ii) above; if ``None`` the default chart of the manifold is 

assumed 

- ``name`` -- (default: ``None``) string; symbol given to the curve 

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

the curve; if none is provided, ``name`` will be used 

 

OUTPUT: 

 

- :class:`~sage.manifolds.differentiable.curve.DifferentiableCurve` 

 

EXAMPLES: 

 

The lemniscate of Gerono in the 2-dimensional Euclidean plane:: 

 

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

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

sage: R.<t> = RealLine() 

sage: c = M.curve([sin(t), sin(2*t)/2], (t, 0, 2*pi), name='c') ; c 

Curve c in the 2-dimensional differentiable manifold M 

 

The same definition with the coordinate expression passed as a 

dictionary:: 

 

sage: c = M.curve({X: [sin(t), sin(2*t)/2]}, (t, 0, 2*pi), name='c') ; c 

Curve c in the 2-dimensional differentiable manifold M 

 

An example of definition with ``t_min`` and ``t_max`` omitted: a helix 

in `\RR^3`:: 

 

sage: R3 = Manifold(3, 'R^3') 

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

sage: c = R3.curve([cos(t), sin(t), t], t, name='c') ; c 

Curve c in the 3-dimensional differentiable manifold R^3 

sage: c.domain() # check that t is unbounded 

Real number line R 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.curve.DifferentiableCurve` 

for more examples, including plots. 

 

""" 

from sage.manifolds.differentiable.real_line import RealLine 

if not isinstance(param, (tuple, list)): 

param = (param, minus_infinity, infinity) 

elif len(param) != 3: 

raise ValueError("the argument 'param' must be of the form " + 

"(t, t_min, t_max)") 

t = param[0] 

t_min = param[1] 

t_max = param[2] 

real_field = RealLine(names=(repr(t),)) 

interval = real_field.open_interval(t_min, t_max) 

curve_set = Hom(interval, self) 

if not isinstance(coord_expression, dict): 

# Turn coord_expression into a dictionary: 

if chart is None: 

chart = self._def_chart 

elif chart not in self._atlas: 

raise ValueError("the {} has not been ".format(chart) + 

"defined on the {}".format(self)) 

if isinstance(coord_expression, (tuple, list)): 

coord_expression = {chart: coord_expression} 

else: 

# case self.dim()=1 

coord_expression = {chart: (coord_expression,)} 

return curve_set(coord_expression, name=name, latex_name=latex_name) 

 

def integrated_curve(self, equations_rhs, velocities, curve_param, 

initial_tangent_vector, chart=None, name=None, 

latex_name=None, verbose=False): 

r""" 

Construct a curve defined by a system of second order 

differential equations in the coordinate functions. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.integrated_curve.IntegratedCurve` 

for details. 

 

INPUT: 

 

- ``equations_rhs`` -- list of the right-hand sides of the 

equations on the velocities only 

- ``velocities`` -- list of the symbolic expressions used in 

``equations_rhs`` to denote the velocities 

- ``curve_param`` -- a tuple of the type ``(t, t_min, t_max)``, 

where 

 

* ``t`` is the symbolic variable used in ``equations_rhs`` to 

denote the parameter of the curve; 

* ``t_min`` is its minimal (finite) value; 

* ``t_max`` its maximal (finite) value. 

 

- ``initial_tangent_vector`` -- 

:class:`~sage.manifolds.differentiable.tangent_vector.TangentVector`; 

initial tangent vector of the curve 

- ``chart`` -- (default: ``None``) chart on the manifold in 

which the equations are given; if ``None`` the default chart 

of the manifold is assumed 

- ``name`` -- (default: ``None``) string; symbol given to the curve 

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

the curve; if none is provided, ``name`` will be used 

 

OUTPUT: 

 

- :class:`~sage.manifolds.differentiable.integrated_curve.IntegratedCurve` 

 

EXAMPLES: 

 

Trajectory of a particle of unit mass and unit charge in a 

unit, uniform, stationary magnetic field:: 

 

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

sage: X.<x1,x2,x3> = M.chart() 

sage: t = var('t') 

sage: D = X.symbolic_velocities() 

sage: eqns = [D[1], -D[0], SR(0)] 

sage: p = M.point((0,0,0), name='p') 

sage: Tp = M.tangent_space(p) 

sage: v = Tp((1,0,1)) 

sage: c = M.integrated_curve(eqns, D, (t,0,6), v, name='c'); c 

Integrated curve c in the 3-dimensional differentiable 

manifold M 

sage: sys = c.system(verbose=True) 

Curve c in the 3-dimensional differentiable manifold M 

integrated over the Real interval (0, 6) as a solution to 

the following system, written with respect to 

Chart (M, (x1, x2, x3)): 

<BLANKLINE> 

Initial point: Point p on the 3-dimensional differentiable 

manifold M with coordinates [0, 0, 0] with respect to 

Chart (M, (x1, x2, x3)) 

Initial tangent vector: Tangent vector at Point p on the 

3-dimensional differentiable manifold M with 

components [1, 0, 1] with respect to Chart (M, (x1, x2, x3)) 

<BLANKLINE> 

d(x1)/dt = Dx1 

d(x2)/dt = Dx2 

d(x3)/dt = Dx3 

d(Dx1)/dt = Dx2 

d(Dx2)/dt = -Dx1 

d(Dx3)/dt = 0 

<BLANKLINE> 

sage: sol = c.solve() 

sage: interp = c.interpolate() 

sage: p = c(1.3, verbose=True) 

Evaluating point coordinates from the interpolation 

associated with the key 'cubic spline-interp-rk4_maxima' 

by default... 

sage: p 

Point on the 3-dimensional differentiable manifold M 

sage: p.coordinates() # abs tol 1e-12 

(0.9635581155730744, -0.7325010457963622, 1.3) 

sage: tgt_vec = c.tangent_vector_eval_at(3.7, verbose=True) 

Evaluating tangent vector components from the interpolation 

associated with the key 'cubic spline-interp-rk4_maxima' 

by default... 

sage: tgt_vec[:] # abs tol 1e-12 

[-0.8481008455360024, 0.5298346120470748, 1.0000000000000007] 

 

""" 

 

from sage.manifolds.differentiable.real_line import RealLine 

from sage.manifolds.differentiable.manifold_homset import IntegratedCurveSet 

 

if len(curve_param) != 3: 

raise ValueError("the argument 'curve_param' must be of the form " + 

"(t, t_min, t_max)") 

t = curve_param[0] 

t_min = curve_param[1] 

t_max = curve_param[2] 

real_field = RealLine(names=(repr(t),)) 

interval = real_field.open_interval(t_min, t_max) 

integrated_curve_set = IntegratedCurveSet(interval, self) # not 

# possible to use Hom(interval, self) 

return integrated_curve_set(equations_rhs, velocities, t, 

initial_tangent_vector, chart=chart, 

name=name, latex_name=latex_name, 

verbose=verbose) 

 

def integrated_autoparallel_curve(self, affine_connection, 

curve_param, initial_tangent_vector, chart=None, 

name=None, latex_name=None, verbose=False): 

r""" 

Construct an autoparallel curve on the manifold with respect to 

a given affine connection. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.integrated_curve.IntegratedAutoparallelCurve` 

for details. 

 

INPUT: 

 

- ``affine_connection`` -- 

:class:`~sage.manifolds.differentiable.affine_connection.AffineConnection`; 

affine connection with respect to which the curve is autoparallel 

- ``curve_param`` -- a tuple of the type ``(t, t_min, t_max)``, 

where 

 

* ``t`` is the symbolic variable to be used as the parameter 

of the curve (the equations defining an instance of 

:class:`~sage.manifolds.differentiable.integrated_curve.IntegratedAutoparallelCurve` 

are such that ``t`` will actually be an affine parameter 

of the curve); 

* ``t_min`` is its minimal (finite) value; 

* ``t_max`` its maximal (finite) value. 

 

- ``initial_tangent_vector`` -- 

:class:`~sage.manifolds.differentiable.tangent_vector.TangentVector`; 

initial tangent vector of the curve 

- ``chart`` -- (default: ``None``) chart on the manifold in 

which the equations are given ; if ``None`` the default chart 

of the manifold is assumed 

- ``name`` -- (default: ``None``) string; symbol given to the curve 

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

the curve; if none is provided, ``name`` will be used 

 

OUTPUT: 

 

- :class:`~sage.manifolds.differentiable.integrated_curve.IntegratedAutoparallelCurve` 

 

EXAMPLES: 

 

Autoparallel curves associated with the Mercator projection of 

the 2-sphere `\mathbb{S}^{2}`:: 

 

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

sage: polar.<th,ph> = S2.chart('th ph') 

sage: epolar = polar.frame() 

sage: ch_basis = S2.automorphism_field() 

sage: ch_basis[1,1], ch_basis[2,2] = 1, 1/sin(th) 

sage: epolar_ON=S2.default_frame().new_frame(ch_basis,'epolar_ON') 

 

Set the affine connection associated with Mercator projection; 

it is metric compatible but it has non-vanishing torsion:: 

 

sage: nab = S2.affine_connection('nab') 

sage: nab.set_coef(epolar_ON)[:] 

[[[0, 0], [0, 0]], [[0, 0], [0, 0]]] 

sage: g = S2.metric('g') 

sage: g[1,1], g[2,2] = 1, (sin(th))^2 

sage: nab(g)[:] 

[[[0, 0], [0, 0]], [[0, 0], [0, 0]]] 

sage: nab.torsion()[:] 

[[[0, 0], [0, 0]], [[0, cos(th)/sin(th)], [-cos(th)/sin(th), 0]]] 

 

Declare an integrated autoparallel curve with respect to this 

connection:: 

 

sage: p = S2.point((pi/4, 0), name='p') 

sage: Tp = S2.tangent_space(p) 

sage: v = Tp((1,1), basis=epolar_ON.at(p)) 

sage: t = var('t') 

sage: c = S2.integrated_autoparallel_curve(nab, (t, 0, 6), 

....: v, chart=polar, name='c') 

sage: sys = c.system(verbose=True) 

Autoparallel curve c in the 2-dimensional differentiable 

manifold S^2 equipped with Affine connection nab on the 

2-dimensional differentiable manifold S^2, and integrated 

over the Real interval (0, 6) as a solution to the 

following equations, written with respect to 

Chart (S^2, (th, ph)): 

<BLANKLINE> 

Initial point: Point p on the 2-dimensional differentiable 

manifold S^2 with coordinates [1/4*pi, 0] with respect to 

Chart (S^2, (th, ph)) 

Initial tangent vector: Tangent vector at Point p on the 

2-dimensional differentiable manifold S^2 with 

components [1, sqrt(2)] with respect to 

Chart (S^2, (th, ph)) 

<BLANKLINE> 

d(th)/dt = Dth 

d(ph)/dt = Dph 

d(Dth)/dt = 0 

d(Dph)/dt = -Dph*Dth*cos(th)/sin(th) 

<BLANKLINE> 

sage: sol = c.solve() 

sage: interp = c.interpolate() 

sage: p = c(1.3, verbose=True) 

Evaluating point coordinates from the interpolation 

associated with the key 'cubic spline-interp-rk4_maxima' 

by default... 

sage: p 

Point on the 2-dimensional differentiable manifold S^2 

sage: p.coordinates() # abs tol 1e-12 

(2.085398163397449, 1.4203172015958863) 

sage: tgt_vec = c.tangent_vector_eval_at(3.7, verbose=True) 

Evaluating tangent vector components from the interpolation 

associated with the key 'cubic spline-interp-rk4_maxima' 

by default... 

sage: tgt_vec[:] # abs tol 1e-12 

[0.9999999999999732, -1.016513736236512] 

 

""" 

 

from sage.manifolds.differentiable.real_line import RealLine 

from sage.manifolds.differentiable.manifold_homset import IntegratedAutoparallelCurveSet 

 

if len(curve_param) != 3: 

raise ValueError("the argument 'curve_param' must be " + 

"of the form (t, t_min, t_max)") 

t = curve_param[0] 

t_min = curve_param[1] 

t_max = curve_param[2] 

real_field = RealLine(names=(repr(t),)) 

interval = real_field.open_interval(t_min, t_max) 

autoparallel_curve_set = IntegratedAutoparallelCurveSet(interval, 

self) 

# not possible to use Hom(interval, self) 

return autoparallel_curve_set(affine_connection, t, 

initial_tangent_vector, 

chart=chart, name=name, 

latex_name=latex_name, 

verbose=verbose) 

 

def integrated_geodesic(self, metric, curve_param, 

initial_tangent_vector, chart=None, 

name=None, latex_name=None, verbose=False): 

r""" 

Construct a geodesic on the manifold with respect to a given metric. 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.integrated_curve.IntegratedGeodesic` 

for details. 

 

INPUT: 

 

- ``metric`` -- 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

metric with respect to which the curve is a geodesic 

- ``curve_param`` -- a tuple of the type ``(t, t_min, t_max)``, 

where 

 

* ``t`` is the symbolic variable to be used as the parameter 

of the curve (the equations defining an instance of 

:class:`~sage.manifolds.differentiable.integrated_curve.IntegratedGeodesic` 

are such that ``t`` will actually be an affine parameter 

of the curve); 

* ``t_min`` is its minimal (finite) value; 

* ``t_max`` its maximal (finite) value. 

 

- ``initial_tangent_vector`` -- 

:class:`~sage.manifolds.differentiable.tangent_vector.TangentVector`; 

initial tangent vector of the curve 

- ``chart`` -- (default: ``None``) chart on the manifold in 

which the equations are given; if ``None`` the default chart 

of the manifold is assumed 

- ``name`` -- (default: ``None``) string; symbol given to the curve 

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

the curve; if none is provided, ``name`` will be used 

 

OUTPUT: 

 

- :class:`~sage.manifolds.differentiable.integrated_curve.IntegratedGeodesic` 

 

EXAMPLES: 

 

Geodesics of the unit 2-sphere `\mathbb{S}^{2}`:: 

 

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

sage: polar.<th,ph> = S2.chart('th ph') 

sage: epolar = polar.frame() 

 

Set the standard metric tensor `g` on `\mathbb{S}^{2}`:: 

 

sage: g = S2.metric('g') 

sage: g[1,1], g[2,2] = 1, (sin(th))^2 

 

Declare an integrated geodesic with respect to this metric:: 

 

sage: p = S2.point((pi/4, 0), name='p') 

sage: Tp = S2.tangent_space(p) 

sage: v = Tp((1, 1), basis=epolar.at(p)) 

sage: t = var('t') 

sage: c = S2.integrated_geodesic(g, (t, 0, 6), v, 

....: chart=polar, name='c') 

sage: sys = c.system(verbose=True) 

Geodesic c in the 2-dimensional differentiable manifold S^2 

equipped with Riemannian metric g on the 2-dimensional 

differentiable manifold S^2, and integrated over the Real 

interval (0, 6) as a solution to the following geodesic 

equations, written with respect to Chart (S^2, (th, ph)): 

<BLANKLINE> 

Initial point: Point p on the 2-dimensional differentiable 

manifold S^2 with coordinates [1/4*pi, 0] with respect to 

Chart (S^2, (th, ph)) 

Initial tangent vector: Tangent vector at Point p on the 

2-dimensional differentiable manifold S^2 with 

components [1, 1] with respect to Chart (S^2, (th, ph)) 

<BLANKLINE> 

d(th)/dt = Dth 

d(ph)/dt = Dph 

d(Dth)/dt = Dph^2*cos(th)*sin(th) 

d(Dph)/dt = -2*Dph*Dth*cos(th)/sin(th) 

<BLANKLINE> 

sage: sol = c.solve() 

sage: interp = c.interpolate() 

sage: p = c(1.3, verbose=True) 

Evaluating point coordinates from the interpolation 

associated with the key 'cubic spline-interp-rk4_maxima' 

by default... 

sage: p 

Point on the 2-dimensional differentiable manifold S^2 

sage: p.coordinates() # abs tol 1e-12 

(2.2047444794514663, 0.7986609561213334) 

sage: tgt_vec = c.tangent_vector_eval_at(3.7, verbose=True) 

Evaluating tangent vector components from the interpolation 

associated with the key 'cubic spline-interp-rk4_maxima' 

by default... 

sage: tgt_vec[:] # abs tol 1e-12 

[-1.090742147346732, 0.620568327518154] 

 

""" 

from sage.manifolds.differentiable.real_line import RealLine 

from sage.manifolds.differentiable.manifold_homset import IntegratedGeodesicSet 

 

if len(curve_param) != 3: 

raise ValueError("the argument 'curve_param' must be of " + 

"the form (t, t_min, t_max)") 

t = curve_param[0] 

t_min = curve_param[1] 

t_max = curve_param[2] 

real_field = RealLine(names=(repr(t),)) 

interval = real_field.open_interval(t_min, t_max) 

integrated_geodesic_set = IntegratedGeodesicSet(interval, self) 

return integrated_geodesic_set(metric, t, initial_tangent_vector, 

chart=chart, name=name, 

latex_name=latex_name, 

verbose=verbose) 

 

def affine_connection(self, name, latex_name=None): 

r""" 

Define an affine connection on the manifold. 

 

See :class:`~sage.manifolds.differentiable.affine_connection.AffineConnection` 

for a complete documentation. 

 

INPUT: 

 

- ``name`` -- name given to the affine connection 

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

affine connection 

 

OUTPUT: 

 

- the affine connection, as an instance of 

:class:`~sage.manifolds.differentiable.affine_connection.AffineConnection` 

 

EXAMPLES: 

 

Affine connection on an open subset of a 3-dimensional smooth manifold:: 

 

sage: M = Manifold(3, 'M', start_index=1) 

sage: A = M.open_subset('A', latex_name=r'\mathcal{A}') 

sage: nab = A.affine_connection('nabla', r'\nabla') ; nab 

Affine connection nabla on the Open subset A of the 3-dimensional 

differentiable manifold M 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.affine_connection.AffineConnection` 

for more examples. 

 

""" 

from sage.manifolds.differentiable.affine_connection import \ 

AffineConnection 

return AffineConnection(self, name, latex_name) 

 

def metric(self, name, signature=None, latex_name=None, dest_map=None): 

r""" 

Define a pseudo-Riemannian metric on the manifold. 

 

A *pseudo-Riemannian metric* is a field of nondegenerate symmetric 

bilinear forms acting in the tangent spaces. See 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

for a complete documentation. 

 

INPUT: 

 

- ``name`` -- name given to the metric 

- ``signature`` -- (default: ``None``) signature `S` of the metric as a 

single integer: `S = n_+ - n_-`, where `n_+` (resp. `n_-`) is the 

number of positive terms (resp. number of negative terms) in any 

diagonal writing of the metric components; if ``signature`` is not 

provided, `S` is set to the manifold's dimension (Riemannian 

signature) 

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

metric; if ``None``, it is formed from ``name`` 

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

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

representing the destination map `\Phi:\ U \rightarrow M`, where `U` 

is the current manifold; if ``None``, the identity map is assumed 

(case of a metric tensor field *on* `U`) 

 

OUTPUT: 

 

- instance of 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

representing the defined pseudo-Riemannian metric. 

 

EXAMPLES: 

 

Metric on a 3-dimensional manifold:: 

 

sage: M = Manifold(3, 'M', start_index=1) 

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

sage: g = M.metric('g'); g 

Riemannian metric g on the 3-dimensional differentiable manifold M 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

for more examples. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

return vmodule.metric(name, signature=signature, latex_name=latex_name) 

 

def riemannian_metric(self, name, latex_name=None, dest_map=None): 

r""" 

Define a Riemannian metric on the manifold. 

 

A *Riemannian metric* is a field of positive definite symmetric 

bilinear forms acting in the tangent spaces. 

 

See 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

for a complete documentation. 

 

INPUT: 

 

- ``name`` -- name given to the metric 

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

metric; if ``None``, it is formed from ``name`` 

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

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

representing the destination map `\Phi:\ U \rightarrow M`, where `U` 

is the current manifold; if ``None``, the identity map is assumed 

(case of a metric tensor field *on* `U`) 

 

OUTPUT: 

 

- instance of 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

representing the defined Riemannian metric. 

 

EXAMPLES: 

 

Metric of the hyperbolic plane `H^2`:: 

 

sage: H2 = Manifold(2, 'H^2', start_index=1) 

sage: X.<x,y> = H2.chart('x y:(0,+oo)') # Poincaré half-plane coord. 

sage: g = H2.riemannian_metric('g') 

sage: g[1,1], g[2,2] = 1/y^2, 1/y^2 

sage: g 

Riemannian metric g on the 2-dimensional differentiable manifold H^2 

sage: g.display() 

g = y^(-2) dx*dx + y^(-2) dy*dy 

sage: g.signature() 

2 

 

.. SEEALSO:: 

 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

for more examples. 

 

""" 

vmodule = self.vector_field_module(dest_map) 

dim = vmodule.ambient_domain().dimension() 

return vmodule.metric(name, signature=dim, latex_name=latex_name) 

 

def riemann_metric(self, name, latex_name=None, dest_map=None): 

r""" 

Deprecated. 

 

Use :meth:`riemannian_metric` instead. 

 

EXAMPLES:: 

 

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

sage: g = M.riemann_metric('g') 

doctest:...: DeprecationWarning: Use riemannian_metric() instead. 

See http://trac.sagemath.org/19209 for details. 

sage: g 

Riemannian metric g on the 3-dimensional differentiable manifold M 

 

""" 

from sage.misc.superseded import deprecation 

deprecation(19209, 'Use riemannian_metric() instead.') 

return self.riemannian_metric(name, latex_name=latex_name, 

dest_map=dest_map) 

 

def lorentzian_metric(self, name, signature='positive', latex_name=None, 

dest_map=None): 

r""" 

Define a Lorentzian metric on the manifold. 

 

A *Lorentzian metric* is a field of nondegenerate symmetric bilinear 

forms acting in the tangent spaces, with signature `(-,+,\cdots,+)` or 

`(+,-,\cdots,-)`. 

 

See 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

for a complete documentation. 

 

INPUT: 

 

- ``name`` -- name given to the metric 

- ``signature`` -- (default: 'positive') sign of the metric 

signature: 

 

* if set to 'positive', the signature is n-2, where n is the 

manifold's dimension, i.e. `(-,+,\cdots,+)` 

* if set to 'negative', the signature is -n+2, i.e. `(+,-,\cdots,-)` 

 

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

metric; if ``None``, it is formed from ``name`` 

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

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

representing the destination map `\Phi:\ U \rightarrow M`, where `U` 

is the current manifold; if ``None``, the identity map is assumed 

(case of a metric tensor field *on* `U`) 

 

OUTPUT: 

 

- instance of 

:class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric` 

representing the defined Lorentzian metric. 

 

EXAMPLES: 

 

Metric of Minkowski spacetime:: 

 

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

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

sage: g = M.lorentzian_metric('g'); g 

Lorentzian metric g on the 4-dimensional differentiable manifold M 

sage: g[0,0], g[1,1], g[2,2], g[3,3] = -1, 1, 1, 1 

sage: g.display() 

g = -dt*dt + dx*dx + dy*dy + dz*dz 

sage: g.signature() 

2 

 

Choice of a negative signature:: 

 

sage: g = M.lorentzian_metric('g', signature='negative'); g 

Lorentzian metric g on the 4-dimensional differentiable manifold M 

sage: g[0,0], g[1,1], g[2,2], g[3,3] = 1, -1, -1, -1 

sage: g.display() 

g = dt*dt - dx*dx - dy*dy - dz*dz 

sage: g.signature() 

-2 

 

""" 

vmodule = self.vector_field_module(dest_map) 

dim = vmodule.ambient_domain().dimension() 

if signature=='positive': 

signat = dim - 2 

else: 

signat = 2 - dim 

return vmodule.metric(name, signature=signat, latex_name=latex_name) 

 

def lorentz_metric(self, name, signature='positive', latex_name=None, 

dest_map=None): 

r""" 

Deprecated. 

 

Use :meth:`lorentzian_metric` instead. 

 

EXAMPLES:: 

 

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

sage: g = M.lorentz_metric('g') 

doctest:...: DeprecationWarning: Use lorentzian_metric() instead. 

See http://trac.sagemath.org/19209 for details. 

sage: g 

Lorentzian metric g on the 4-dimensional differentiable manifold M 

 

""" 

from sage.misc.superseded import deprecation 

deprecation(19209, 'Use lorentzian_metric() instead.') 

return self.lorentzian_metric(name, signature=signature, 

latex_name=latex_name, dest_map=dest_map)