Differential geometry with SageMath ric Gourgoulhon Laboratoire - - PowerPoint PPT Presentation

differential geometry with sagemath
SMART_READER_LITE
LIVE PREVIEW

Differential geometry with SageMath ric Gourgoulhon Laboratoire - - PowerPoint PPT Presentation

Differential geometry with SageMath ric Gourgoulhon Laboratoire Univers et Thories (LUTH) CNRS / Observatoire de Paris / Universit Paris Diderot Paris Sciences et Lettres Research University 92190 Meudon, France


slide-1
SLIDE 1

Differential geometry with SageMath

Éric Gourgoulhon

Laboratoire Univers et Théories (LUTH) CNRS / Observatoire de Paris / Université Paris Diderot Paris Sciences et Lettres Research University 92190 Meudon, France http://luth.obspm.fr/~luthier/gourgoulhon/

based on a collaboration with Pablo Angulo, Michał Bejger, Marco Mancini and Travis Scrimshaw Geometry and Computer Science Università degli Studi "G. d’Annunzio", Pescara, Italy 8-10 February 2017

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 1 / 35

slide-2
SLIDE 2

Outline

1

Introduction

2

A brief overview of SageMath

3

The SageManifolds project

4

Examples

5

Conclusion and perspectives

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 2 / 35

slide-3
SLIDE 3

Introduction

Outline

1

Introduction

2

A brief overview of SageMath

3

The SageManifolds project

4

Examples

5

Conclusion and perspectives

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 3 / 35

slide-4
SLIDE 4

Introduction

Introduction

Computer algebra system (CAS) started to be developed in the 1960’s; for instance Macsyma (to become Maxima in 1998) was initiated in 1968 at MIT

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 4 / 35

slide-5
SLIDE 5

Introduction

Introduction

Computer algebra system (CAS) started to be developed in the 1960’s; for instance Macsyma (to become Maxima in 1998) was initiated in 1968 at MIT In 1965, J.G. Fletcher developed the GEOM program, to compute the Riemann tensor of a given metric

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 4 / 35

slide-6
SLIDE 6

Introduction

Introduction

Computer algebra system (CAS) started to be developed in the 1960’s; for instance Macsyma (to become Maxima in 1998) was initiated in 1968 at MIT In 1965, J.G. Fletcher developed the GEOM program, to compute the Riemann tensor of a given metric In 1969, during his PhD under Pirani supervision, Ray d’Inverno wrote ALAM (Atlas Lisp Algebraic Manipulator) and used it to compute the Riemann tensor of Bondi metric. The original calculations took Bondi and his collaborators 6 months to go. The computation with ALAM took 4 minutes and yielded to the discovery of 6 errors in the original paper [J.E.F. Skea,

Applications of SHEEP (1994)]

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 4 / 35

slide-7
SLIDE 7

Introduction

Introduction

Computer algebra system (CAS) started to be developed in the 1960’s; for instance Macsyma (to become Maxima in 1998) was initiated in 1968 at MIT In 1965, J.G. Fletcher developed the GEOM program, to compute the Riemann tensor of a given metric In 1969, during his PhD under Pirani supervision, Ray d’Inverno wrote ALAM (Atlas Lisp Algebraic Manipulator) and used it to compute the Riemann tensor of Bondi metric. The original calculations took Bondi and his collaborators 6 months to go. The computation with ALAM took 4 minutes and yielded to the discovery of 6 errors in the original paper [J.E.F. Skea,

Applications of SHEEP (1994)]

Since then, many software tools for tensor calculus have been developed... A rather exhaustive list: http://www.xact.es/links.html = ⇒ cf. Maximilian Hasler’s review talk on Friday.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 4 / 35

slide-8
SLIDE 8

A brief overview of SageMath

Outline

1

Introduction

2

A brief overview of SageMath

3

The SageManifolds project

4

Examples

5

Conclusion and perspectives

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 5 / 35

slide-9
SLIDE 9

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-10
SLIDE 10

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-11
SLIDE 11

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which and provides a uniform interface to them

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-12
SLIDE 12

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations)

and provides a uniform interface to them

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-13
SLIDE 13

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory)

and provides a uniform interface to them

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-14
SLIDE 14

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory)

and provides a uniform interface to them

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-15
SLIDE 15

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory) Singular (polynomial computations)

and provides a uniform interface to them

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-16
SLIDE 16

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory) Singular (polynomial computations) matplotlib (high quality 2D figures)

and provides a uniform interface to them

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-17
SLIDE 17

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory) Singular (polynomial computations) matplotlib (high quality 2D figures)

and provides a uniform interface to them William Stein (Univ. of Washington) created SageMath in 2005; since then, ∼100 developers (mostly mathematicians) have joined the SageMath team

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-18
SLIDE 18

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory) Singular (polynomial computations) matplotlib (high quality 2D figures)

and provides a uniform interface to them William Stein (Univ. of Washington) created SageMath in 2005; since then, ∼100 developers (mostly mathematicians) have joined the SageMath team SageMath is now supported by European Union via the open-math project OpenDreamKit (2015-2019, within the Horizon 2020 program)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-19
SLIDE 19

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory) Singular (polynomial computations) matplotlib (high quality 2D figures)

and provides a uniform interface to them William Stein (Univ. of Washington) created SageMath in 2005; since then, ∼100 developers (mostly mathematicians) have joined the SageMath team SageMath is now supported by European Union via the open-math project OpenDreamKit (2015-2019, within the Horizon 2020 program)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-20
SLIDE 20

A brief overview of SageMath

SageMath in a few words

SageMath (nickname: Sage) is a free open-source mathematics software system it is based on the Python programming language it makes use of many pre-existing open-sources packages, among which

Maxima, Pynac (symbolic calculations) GAP (group theory) PARI/GP (number theory) Singular (polynomial computations) matplotlib (high quality 2D figures)

and provides a uniform interface to them William Stein (Univ. of Washington) created SageMath in 2005; since then, ∼100 developers (mostly mathematicians) have joined the SageMath team SageMath is now supported by European Union via the open-math project OpenDreamKit (2015-2019, within the Horizon 2020 program) The mission Create a viable free open source alternative to Magma, Maple, Mathematica and Matlab.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 6 / 35

slide-21
SLIDE 21

A brief overview of SageMath

Some advantages of SageMath

SageMath is free Freedom means

1 everybody can use it, by downloading the software from

http://sagemath.org

2 everybody can examine the source code and improve it Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 7 / 35

slide-22
SLIDE 22

A brief overview of SageMath

Some advantages of SageMath

SageMath is free Freedom means

1 everybody can use it, by downloading the software from

http://sagemath.org

2 everybody can examine the source code and improve it

SageMath is based on Python no need to learn any specific syntax to use it easy access for students Python is a very powerful object oriented language, with a neat syntax

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 7 / 35

slide-23
SLIDE 23

A brief overview of SageMath

Some advantages of SageMath

SageMath is free Freedom means

1 everybody can use it, by downloading the software from

http://sagemath.org

2 everybody can examine the source code and improve it

SageMath is based on Python no need to learn any specific syntax to use it easy access for students Python is a very powerful object oriented language, with a neat syntax SageMath is developing and spreading fast ...sustained by an enthusiastic community of developers

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 7 / 35

slide-24
SLIDE 24

A brief overview of SageMath

Object-oriented notation in Python

As an object-oriented language, Python (and hence SageMath) makes use of the following postfix notation (same in C++, Java, etc.):

result = object.function(arguments)

In a procedural language, this would be written as

result = function(object,arguments)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 8 / 35

slide-25
SLIDE 25

A brief overview of SageMath

Object-oriented notation in Python

As an object-oriented language, Python (and hence SageMath) makes use of the following postfix notation (same in C++, Java, etc.):

result = object.function(arguments)

In a procedural language, this would be written as

result = function(object,arguments)

Examples

  • 1. riem = g.riemann()
  • 2. lie_t_v = t.lie_der(v)

NB: no argument in example 1

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 8 / 35

slide-26
SLIDE 26

A brief overview of SageMath

SageMath approach to computer mathematics

SageMath relies on a Parent / Element scheme: each object x on which some calculus is performed has a “parent”, which is another SageMath object X representing the set to which x belongs. The calculus rules on x are determined by the algebraic structure of X. Conversion rules prior to an operation, e.g. x + y with x and y having different parents, are defined at the level of the parents

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 9 / 35

slide-27
SLIDE 27

A brief overview of SageMath

SageMath approach to computer mathematics

SageMath relies on a Parent / Element scheme: each object x on which some calculus is performed has a “parent”, which is another SageMath object X representing the set to which x belongs. The calculus rules on x are determined by the algebraic structure of X. Conversion rules prior to an operation, e.g. x + y with x and y having different parents, are defined at the level of the parents Example sage: x = 4 ; x.parent() Integer Ring sage: y = 4/3 ; y.parent() Rational Field sage: s = x + y ; s.parent() Rational Field sage: y.parent().has_coerce_map_from(x.parent()) True

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 9 / 35

slide-28
SLIDE 28

A brief overview of SageMath

SageMath approach to computer mathematics

SageMath relies on a Parent / Element scheme: each object x on which some calculus is performed has a “parent”, which is another SageMath object X representing the set to which x belongs. The calculus rules on x are determined by the algebraic structure of X. Conversion rules prior to an operation, e.g. x + y with x and y having different parents, are defined at the level of the parents Example sage: x = 4 ; x.parent() Integer Ring sage: y = 4/3 ; y.parent() Rational Field sage: s = x + y ; s.parent() Rational Field sage: y.parent().has_coerce_map_from(x.parent()) True This approach is similar to that of Magma and is different from that of Mathematica, in which everything is a tree of symbols

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 9 / 35

slide-29
SLIDE 29

The SageManifolds project

Outline

1

Introduction

2

A brief overview of SageMath

3

The SageManifolds project

4

Examples

5

Conclusion and perspectives

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 10 / 35

slide-30
SLIDE 30

The SageManifolds project

The SageManifolds project

http://sagemanifolds.obspm.fr/ Aim Implement smooth manifolds of arbitrary dimension in SageMath and tensor calculus on them In particular:

  • ne should be able to introduce an arbitrary number of coordinate charts on

a given manifold, with the relevant transition maps tensor fields must be manipulated as such and not through their components with respect to a specific (possibly coordinate) vector frame

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 11 / 35

slide-31
SLIDE 31

The SageManifolds project

The SageManifolds project

http://sagemanifolds.obspm.fr/ Aim Implement smooth manifolds of arbitrary dimension in SageMath and tensor calculus on them In particular:

  • ne should be able to introduce an arbitrary number of coordinate charts on

a given manifold, with the relevant transition maps tensor fields must be manipulated as such and not through their components with respect to a specific (possibly coordinate) vector frame Concretely, the project amounts to creating new Python classes, such as TopologicalManifold, DifferentiableManifold, Chart, TensorField or Metric, within SageMath’s Parent/Element framework.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 11 / 35

slide-32
SLIDE 32

The SageManifolds project

Implementing manifolds and their subsets

UniqueRepresentation Parent ManifoldSubset

element: ManifoldPoint

TopologicalManifold DifferentiableManifold OpenInterval RealLine Element ManifoldPoint Native SageMath class SageManifolds class

(differential part)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 12 / 35

slide-33
SLIDE 33

The SageManifolds project

Implementing coordinate charts

Given a (topological) manifold M of dimension n ≥ 1, a coordinate chart is a homeomorphism ϕ : U → V , where U is an open subset of M and V is an open subset of Rn.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 13 / 35

slide-34
SLIDE 34

The SageManifolds project

Implementing coordinate charts

Given a (topological) manifold M of dimension n ≥ 1, a coordinate chart is a homeomorphism ϕ : U → V , where U is an open subset of M and V is an open subset of Rn. In general, more than one chart is required to cover the entire manifold: Examples: at least 2 charts are necessary to cover the n-dimensional sphere Sn (n ≥ 1) and the torus T2 at least 3 charts are necessary to cover the real projective plane RP2

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 13 / 35

slide-35
SLIDE 35

The SageManifolds project

Implementing coordinate charts

Given a (topological) manifold M of dimension n ≥ 1, a coordinate chart is a homeomorphism ϕ : U → V , where U is an open subset of M and V is an open subset of Rn. In general, more than one chart is required to cover the entire manifold: Examples: at least 2 charts are necessary to cover the n-dimensional sphere Sn (n ≥ 1) and the torus T2 at least 3 charts are necessary to cover the real projective plane RP2 In SageManifolds, an arbitrary number of charts can be introduced To fully specify the manifold, one shall also provide the transition maps on

  • verlapping chart domains (SageManifolds class CoordChange)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 13 / 35

slide-36
SLIDE 36

The SageManifolds project

Implementing scalar fields

A scalar field on manifold M is a smooth mapping f : U ⊂ M − → R p − → f(p) where U is an open subset of M.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 14 / 35

slide-37
SLIDE 37

The SageManifolds project

Implementing scalar fields

A scalar field on manifold M is a smooth mapping f : U ⊂ M − → R p − → f(p) where U is an open subset of M. A scalar field maps points, not coordinates, to real numbers = ⇒ an object f in the ScalarField class has different coordinate representations in different charts defined on U.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 14 / 35

slide-38
SLIDE 38

The SageManifolds project

Implementing scalar fields

A scalar field on manifold M is a smooth mapping f : U ⊂ M − → R p − → f(p) where U is an open subset of M. A scalar field maps points, not coordinates, to real numbers = ⇒ an object f in the ScalarField class has different coordinate representations in different charts defined on U. The various coordinate representations F, ˆ F, ... of f are stored as a Python dictionary whose keys are the charts C, ˆ C, ...: f._express =

  • C : F, ˆ

C : ˆ F, . . .

  • with f( p
  • point

) = F( x1, . . . , xn

  • coord. of p

in chart C ) = ˆ F( ˆ x1, . . . , ˆ xn

  • coord. of p

in chart ˆ C ) = . . .

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 14 / 35

slide-39
SLIDE 39

The SageManifolds project

The scalar field algebra

The parent of the scalar field f : U → R is the set C∞(U) of scalar fields defined

  • n the open subset U.

C∞(U) has naturally the structure of a commutative algebra over R:

1 it is clearly a vector space over R 2 it is endowed with a commutative ring structure by pointwise multiplication:

∀f, g ∈ C∞(U), ∀p ∈ U, (f.g)(p) := f(p)g(p) The algebra C∞(U) is implemented in SageManifolds via the class ScalarFieldAlgebra.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 15 / 35

slide-40
SLIDE 40

The SageManifolds project

Classes for scalar fields

UniqueRepresentation Parent ScalarFieldAlgebra

element: ScalarField

category: CommutativeAlgebras(base field)

DiffScalarFieldAlgebra

element: DiffScalarField

CommutativeAlgebraElement ScalarField

parent: ScalarFieldAlgebra

DiffScalarField

parent: DiffScalarFieldAlgebra

Native SageMath class SageManifolds class

(differential part)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 16 / 35

slide-41
SLIDE 41

The SageManifolds project

Vector field modules

Given an open subset U ⊂ M, the set X(U) of smooth vector fields defined on U has naturally the structure of a module over the scalar field algebra C∞(U). X(U) is a free module ⇐ ⇒ U admits a global vector frame (ea)1≤a≤n: ∀v ∈ X(U), v = vaea, with va ∈ C∞(U) At any point p ∈ U, the above translates into an identity in the tangent vector space TpM: v(p) = va(p) ea(p), with va(p) ∈ R Example: If U is the domain of a coordinate chart (xa)1≤a≤n, X(U) is a free module of rank n over C∞(U), a basis of it being the coordinate frame (∂/∂xa)1≤a≤n.

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 17 / 35

slide-42
SLIDE 42

The SageManifolds project

Parallelizable manifolds

M is a parallelizable manifold ⇐ ⇒ M admits a global vector frame ⇐ ⇒ X(M) is a free module ⇐ ⇒ M’s tangent bundle is trivial: TM ≃ M × Rn

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 18 / 35

slide-43
SLIDE 43

The SageManifolds project

Parallelizable manifolds

M is a parallelizable manifold ⇐ ⇒ M admits a global vector frame ⇐ ⇒ X(M) is a free module ⇐ ⇒ M’s tangent bundle is trivial: TM ≃ M × Rn Examples of parallelizable manifolds Rn (global coordinate charts ⇒ global vector frames) the circle S1 (NB: no global coordinate chart) the torus T2 = S1 × S1 the 3-sphere S3 ≃ SU(2), as any Lie group the 7-sphere S7 any orientable 3-manifold (Steenrod theorem)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 18 / 35

slide-44
SLIDE 44

The SageManifolds project

Parallelizable manifolds

M is a parallelizable manifold ⇐ ⇒ M admits a global vector frame ⇐ ⇒ X(M) is a free module ⇐ ⇒ M’s tangent bundle is trivial: TM ≃ M × Rn Examples of parallelizable manifolds Rn (global coordinate charts ⇒ global vector frames) the circle S1 (NB: no global coordinate chart) the torus T2 = S1 × S1 the 3-sphere S3 ≃ SU(2), as any Lie group the 7-sphere S7 any orientable 3-manifold (Steenrod theorem) Examples of non-parallelizable manifolds the sphere S2 (hairy ball theorem!) and any n-sphere Sn with n ∈ {1, 3, 7} the real projective plane RP2

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 18 / 35

slide-45
SLIDE 45

The SageManifolds project

Implementing vector fields

Ultimately, in SageManifolds, vector fields are to be described by their components w.r.t. various vector frames. If the manifold M is not parallelizable, we assume that it can be covered by a finite number N of parallelizable open subsets Ui (1 ≤ i ≤ N) (OK for M compact). We then consider restrictions of vector fields to these domains:

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 19 / 35

slide-46
SLIDE 46

The SageManifolds project

Implementing vector fields

Ultimately, in SageManifolds, vector fields are to be described by their components w.r.t. various vector frames. If the manifold M is not parallelizable, we assume that it can be covered by a finite number N of parallelizable open subsets Ui (1 ≤ i ≤ N) (OK for M compact). We then consider restrictions of vector fields to these domains: For each i, X(Ui) is a free module of rank n = dim M and is implemented in SageManifolds as an instance of VectorFieldFreeModule, which is a subclass of FiniteRankFreeModule. Each vector field v ∈ X(Ui) has different set of components (va)1≤a≤n in different vector frames (ea)1≤a≤n introduced on Ui. They are stored as a Python dictionary whose keys are the vector frames: v._components = {(e) : (va), (ˆ e) : (ˆ va), . . .}

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 19 / 35

slide-47
SLIDE 47

The SageManifolds project

Module classes in SageManifolds

UniqueRepresentation Parent VectorFieldModule

ring: DiffScalarFieldAlgebra element: VectorField

c a t e g

  • r

y : M

  • d

u l e s TensorFieldModule

ring: DiffScalarFieldAlgebra element: TensorField

c a t e g

  • r

y : M

  • d

u l e s VectorFieldFreeModule

ring: DiffScalarFieldAlgebra element: VectorFieldParal

TensorFieldFreeModule

ring: DiffScalarFieldAlgebra element: TensorFieldParal

FiniteRankFreeModule

ring: CommutativeRing element: FiniteRankFreeModuleElement

TensorFreeModule

element: FreeModuleTensor

TangentSpace

ring: SR element: TangentVector

c a t e g

  • r

y : M

  • d

u l e s Native SageMath class SageManifolds class (algebraic part) SageManifolds class (differential part)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 20 / 35

slide-48
SLIDE 48

The SageManifolds project

Tensor field classes

TensorField

parent: TensorFieldModule

VectorField

parent: VectorFieldModule

TensorFieldParal

parent: TensorFieldFreeModule

VectorFieldParal

parent: VectorFieldFreeModule

FreeModuleTensor

parent: TensorFreeModule

FiniteRankFreeModuleElement

parent: FiniteRankFreeModule

TangentVector

parent: TangentSpace

Element ModuleElement Native SageMath class SageManifolds class

(algebraic part)

SageManifolds class

(differential part)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 21 / 35

slide-49
SLIDE 49

The SageManifolds project

Tensor field storage

TensorField

T

dictionary TensorField. restrictions domain 1:

U1

TensorFieldParal

T|U1 = T a

bea ⊗ eb = T ˆ a ˆ bεˆ a ⊗ εˆ b = . . .

domain 2:

U2

TensorFieldParal

T|U2

. . .

dictionary TensorFieldParal. components frame 1:

(ea)

Components

(T a

b)1≤a, b ≤n

frame 2:

(εˆ

a)

Components

(T ˆ

a ˆ b)1≤ˆ a, ˆ b ≤n

. . .

dictionary Components. comp

(1, 1) : DiffScalarField T 1

1

(1, 2) : DiffScalarField T 1

2

. . .

dictionary DiffScalarField. express chart 1:

(xa)

CoordFunction

T 1

1

  • x1, . . . , xn

chart 2:

(ya)

CoordFunction

T 1

1

  • y1, . . . , yn

. . .

Expression

x1 cos x2

Expression

  • y1 + y2

cos

  • y1 − y2

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 22 / 35

slide-50
SLIDE 50

Examples

Outline

1

Introduction

2

A brief overview of SageMath

3

The SageManifolds project

4

Examples

5

Conclusion and perspectives

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 23 / 35

slide-51
SLIDE 51

Examples

The 2-sphere example

Stereographic coordinates on the 2-sphere Two charts: X1: S2 \ {N} → R2 X2: S2 \ {S} → R2 ← picture obtained via function RealChart.plot() See the worksheet at http://sagemanifolds.obspm.fr/examples.html

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 24 / 35

slide-52
SLIDE 52

Examples

The 2-sphere example

Vector frame associated with the stereographic coordinates (x, y) from the North pole

∂ ∂x ∂ ∂y

← picture obtained via the function VectorField.plot() See the worksheet at

http://sagemanifolds.

  • bspm.fr/examples.html

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 25 / 35

slide-53
SLIDE 53

Examples

The 2-sphere example

A curve in S2: a loxodrome and its tangent vector field ← picture obtained via the functions DifferentiableCurve.plot() and VectorField.plot() See the worksheet at http://sagemanifolds.obspm.fr/examples.html

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 26 / 35

slide-54
SLIDE 54

Examples

The 3-sphere example

Some fibers of the Hopf fibration of S3 viewed in stereographic coordinates ← picture obtained via the function DifferentiableCurve.plot() See the worksheet at http://nbviewer.jupyter.org/github/sagemanifolds/

SageManifolds/blob/master/Worksheets/v1.0/SM_sphere_S3_Hopf.ipynb

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 27 / 35

slide-55
SLIDE 55

Examples

The 3-sphere example

The same fibers but viewed in the Cartesian coordinates (T, X, Y ) of R4 via the canonical embedding S3 → R4 ← picture obtained via the function DifferentiableCurve.plot() See the worksheet at http://nbviewer.jupyter.org/github/sagemanifolds/

SageManifolds/blob/master/Worksheets/v1.0/SM_sphere_S3_Hopf.ipynb

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 28 / 35

slide-56
SLIDE 56

Examples

The 3-sphere example

Again the same fibers but viewed in the Cartesian coordinates (X, Y, Z) of R4 via the canonical embedding S3 → R4 ← picture obtained via the function DifferentiableCurve.plot() See the worksheet at http://nbviewer.jupyter.org/github/sagemanifolds/

SageManifolds/blob/master/Worksheets/v1.0/SM_sphere_S3_Hopf.ipynb

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 29 / 35

slide-57
SLIDE 57

Examples

The 3-sphere example

One of the vector fields of a left-invariant global vector frame

  • f S3, viewed in stereographic

coordinates ← picture obtained via the function VectorField.plot() See the worksheet at http://nbviewer.jupyter.org/github/sagemanifolds/

SageManifolds/blob/master/Worksheets/v1.0/SM_sphere_S3_vectors.ipynb

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 30 / 35

slide-58
SLIDE 58

Examples

Charts on Schwarzschild spacetime

The Carter-Penrose diagram

  • 3
  • 2
  • 1

1 2 3

˜ X

  • 1.5
  • 1
  • 0.5

0.5 1 1.5

˜ T r = 0 r′= 0

+ − ′+ ′− I II III IV

Two charts of standard Schwarzschild-Droste coordinates (t, r, θ, ϕ) plotted in terms of Frolov-Novikov compactified coordinates ( ˜ T, ˜ X, θ, ϕ); see the worksheet at http://luth.obspm.fr/~luthier/gourgoulhon/bh16/sage.html

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 31 / 35

slide-59
SLIDE 59

Conclusion and perspectives

Outline

1

Introduction

2

A brief overview of SageMath

3

The SageManifolds project

4

Examples

5

Conclusion and perspectives

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 32 / 35

slide-60
SLIDE 60

Conclusion and perspectives

Summary

SageManifolds: extends the modern computer algebra system SageMath towards differential geometry and tensor calculus http://sagemanifolds.obspm.fr/ free software (GPL), as SageMath ∼ 65,000 lines of Python code (including comments and doctests) submitted to SageMath community as a sequence of 14 tickets → first ticket accepted in March 2015, the 14th one in Nov. 2016 5 developers, 3 reviewers SageManifolds 1.0 released on 11 Jan. 2017 and fully included in SageMath 7.5

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 33 / 35

slide-61
SLIDE 61

Conclusion and perspectives

Current status

Already present (v1.0): topological manifolds: charts, open subsets, maps between manifolds, scalar fields differentiable manifolds: tangent spaces, vector frames, tensor fields, curves, pullback and pushforward operators standard tensor calculus (tensor product, contraction, symmetrization, etc.), even on non-parallelizable manifolds taking into account any monoterm tensor symmetry exterior calculus (wedge product, exterior derivative, Hodge duality) Lie derivatives of tensor fields affine connections (curvature, torsion) pseudo-Riemannian metrics some plotting capabilities (charts, points, curves, vector fields) parallelization (on tensor components) of CPU demanding computations, via the Python library multiprocessing

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 34 / 35

slide-62
SLIDE 62

Conclusion and perspectives

Current status

Future prospects: extrinsic geometry of pseudo-Riemannian submanifolds computation of geodesics (numerical integration via SageMath/GSL or Gyoto) integrals on submanifolds more graphical outputs more functionalities: symplectic forms, fibre bundles, spinors, variational calculus, etc. connection with numerical relativity: using SageMath to explore numerically-generated spacetimes

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 35 / 35

slide-63
SLIDE 63

Conclusion and perspectives

Current status

Future prospects: extrinsic geometry of pseudo-Riemannian submanifolds computation of geodesics (numerical integration via SageMath/GSL or Gyoto) integrals on submanifolds more graphical outputs more functionalities: symplectic forms, fibre bundles, spinors, variational calculus, etc. connection with numerical relativity: using SageMath to explore numerically-generated spacetimes Want to join the project or simply to stay tuned? visit http://sagemanifolds.obspm.fr/ (download, documentation, example worksheets, mailing list)

Éric Gourgoulhon Differential geometry with SageMath Pescara, 8 Feb. 2017 35 / 35