Top Banner
Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming v1 Nov.19.2017 Satoshi Egi Rakuten Institute of Technology Rakuten, Inc.
73

Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

Aug 06, 2018

Download

Documents

phungnhi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming

v1 Nov.19.2017

Satoshi Egi Rakuten Institute of TechnologyRakuten, Inc.

Page 2: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

2

The Egison Programming Language

https://www.egison.org

Page 3: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

3

Table of Contents

Introduction of the features of Egison.

Philosophy behind the creation of Egison and future direction.

Demonstration.

Page 4: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

4

Table of Contents

Introduction of the features of Egison.

Philosophy behind the creation of Egison and future direction.

Demonstration.

Page 5: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

5

Aim of Egison

My aim is to create a language that can represent directly all algorithms that can be discovered.

Currently, my biggest challenge is to improve Egison in order to represent directly calculations that appear in mathematical physics.

Page 6: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

6

Features of Egison

Pattern-matching against the wider range of data types.

Customizable symbolic computation using Egison pattern-matching.

Tensor index notation in programming.

Page 7: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

7

Features of Egison

Pattern-matching against the wider range of data types.

Customizable symbolic computation using Egison pattern-matching.

Tensor index notation in programming.

Page 8: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

8

Twin Primes

Pattern Body

Matcher

Target

Page 9: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

9

Poker Hands

are patterns.

Page 10: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

10

Poker Hands - Straight Flush

Page 11: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

11

Poker Hands - Straight Flush

Page 12: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

12

Poker Hands - Two Pair

Page 13: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

13

Poker Hands - Two Pair

Page 14: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

14

Multiset Matcher

Page 15: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

15

Multiset Matcher - Cons Pattern

Page 16: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

16

Multiset Matcher - Cons Pattern

{[1 {2 3}] [2 {1 3}] [3 {1 2}]}

[a (multiset a)]<cons $ $>

Next patterns Next matchers Next targets

Page 17: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

17

Meaning of Patterns for Collections before Egison

List Multiset Set

cons pattern: Divide a collection into the head element and the rest.

{[1 {2 3}]}

join pattern: Divide a collection into the head part and the rest.

nil pattern: Match with an empty collection.

List Multiset Set{[{} {1 2}] [{1} {2}] [{1 2} {}]}

Applicable only to Lists.

Applicable only to Lists.

Page 18: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

18

Meaning of Patterns for Collections Generalized by Egison

List Multiset Set

cons pattern: Divide a collection into an element and the rest.

{[1 {2 3}]} {[1 {2 3}] [2 {1 3}] [3 {1 2}]}

{[1 {1 2 3}] [2 {1 2 3}] [3 {1 2 3}]}

join pattern: Divide a collection into a part and the rest.

nil pattern: Match with an empty collection.

List Multiset Set{[{} {1 2}] [{1} {2}] [{1 2} {}]}

{[{} {1 2}] [{1} {2}] [{2} {1}] [{1 2} {}]}

{[{} {1 2}] [{1} {1 2}] [{2} {1 2}] [{1 2} {1 2}]}

Page 19: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

19

Features of Egison

Pattern-matching against the wider range of data types.

Customizable symbolic computation using Egison pattern-matching.

Tensor index notation in programming.

Page 20: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

20

Symbolic Computation

Page 21: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

21

Simplification - cos(θ)^2 + sin(θ)^2 = 1, ω + ω^2 = -1, …

Page 22: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

22

7th Roots of Unity

Page 23: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

23

Differential Operator

Page 24: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

24

Demonstration of Differential Operator

Page 25: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

25

Taylor Expansion

Page 26: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

26

Demonstration of Taylor Expansion

Page 27: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

27

Features of Egison

Pattern-matching against the wider range of data types.

Customizable symbolic computation using Egison pattern-matching.

Tensor index notation in programming.

Page 28: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

28

Tensor Index Notation in Egison

In Egison method, we can apply directly both “∂/∂” and “.” functions to tensors.

Egison program that represents the above formula

Formula of Riemann curvature tensor ~: superscript _: subscript

Page 29: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

29

Tensor Index Notation in Wolfram and Egison

Wolfram program that represents the above formula

Egison program that represents the above formula

Formula of Riemann curvature tensor

Page 30: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

30

The Reason for the Problems

There are two types of functions:

- Functions that should be mapped to each component of the tensors. e.g. “+”, “-”, “*”, “/“, “∂/∂”, “min”, “max”, …

- Functions that should be applied directly to the tensors. e.g. Tensor multiplication, matrix determinant, …

The existing work does not provide the easiest way to define both types of functions.

Page 31: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

31

Proposed Method: Scalar and Tensor Parameters

Definition of the min function as the sample of scalar parameters

Definition of the “.” function as the sample of tensor parameters

When “$” is prepended to the beginning of the parameters, the function is applied to each component of tensors.

When “%” is prepended to the beginning of the parameters, the function treats the tensor argument as a whole.

Page 32: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

32

Proposed Method: Scalar Parameters and Functions

Definition of the min function as the sample of scalar parameters

Application of the min function to the vectors with different indices

Application of the min function to the vectors with identical indices

Page 33: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

33

Proposed Method: Tensor Parameters and Functions

Definition of the “.” function as the sample of scalar parameters

Application of the “.” function to vectors with various indices

Page 34: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

34

Proposed Method: Implementation of Scalar Parameters

Simple implementation of the scalar and tensor parameters

Page 35: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

35

Application: Riemannian Geometry

Page 36: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

36

Calculation of Riemann Curvature of Spherical Surface

https://commons.wikimedia.org/wiki/File:Triangles_(spherical_geometry).jpg

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 37: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

37

Local Basis - Spherical Surface

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 38: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

38

Riemann Metrics - Spherical Surface

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 39: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

39

Christoffel Symbols of the First Kind - Spherical Surface

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 40: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

40

Christoffel Symbols of the Second Kind - Spherical Surface

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 41: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

41

Riemann Curvature Tensor - Spherical Surface

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 42: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

42

Ricci and Scalar Curvature - Spherical Surface

https://www.egison.org/math/riemann-curvature-tensor-of-S2.html

Page 43: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

43

Calculation of Riemann Curvature of Schwarzschild Space

https://commons.wikimedia.org/wiki/File:Spacetime_lattice_analogy.svg

https://www.egison.org/math/riemann-curvature-tensor-of-Schwarzschild-metric.html

Page 44: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

44

Egison Paper on Tensor Index Notation

https://arxiv.org/abs/1702.06343

Page 45: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

45

Differential Forms

Page 46: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

46

Differential Forms in Egison

Egison program that represents the formula of curvature form

Formula of curvature formFormula of Riemann curvature

We can define and use the operators for differential forms concisely in Egison.

Page 47: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

47

Differential Forms in Egison

We achieved that by providing users the method for controlling the completion of omitted indices.

When “!” is prepended to the function application, the different indices are completed to each tensor of the arguments.

By default, the same indices are completed to each tensor of the arguments.

Formula of curvature formFormula of Riemann curvature

Page 48: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

48

Wedge Product, Exterior Derivative, Hodge operator, and Codifferential Operator

Page 49: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

49

Wedge Product - Euclid Space

https://www.egison.org/math/wedge-product.html

Page 50: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

50

Exterior Derivative - Euclid Space

https://www.egison.org/math/exterior-derivative.html

Page 51: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

51

Hodge Operator - Euclid Space

https://ncatlab.org/nlab/show/Hodge+star+operator

https://www.egison.org/math/hodge-E3.html

Page 52: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

52

Hodge Operator - Minkowski Space

https://www.egison.org/math/hodge-minkowski.html

Page 53: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

53

Codifferential Operator - Euclid Space

Page 54: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

54

Application: Geometry of Differential Forms

Page 55: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

55

Hodge Laplacian

https://www.egison.org/math/hodge-laplacian-polar.html

Page 56: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

56

Euler Form

https://www.egison.org/math/euler-form-of-S2.html

Page 57: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

57

Euler Form

https://www.egison.org/math/euler-form-of-S2.html

Page 58: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

58

U(1) Yang-Mills Equation

https://www.egison.org/math/yang-mills-equation-of-U1-gauge-theory.html

Page 59: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

59

Egison Mathematics Notebook

https://www.egison.org/math/

Page 60: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

60

Future Work

Combine Egison with Formura. - https://github.com/formura/formura - If we achieved that, we can execute differential equations using the language of differential forms on super computers.

Collaboration with Fukagawa-san. - https://twitter.com/hiroki_f/status/930018952654200832

Page 61: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

61

Table of Contents

Introduction of the features of Egison.

Philosophy behind the creation of Egison and future direction.

Demonstration.

Page 62: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

62

Aim of Egison

My aim is to create a language that can represent directly all algorithms that can be discovered.

Currently, my biggest challenge is to improve Egison in order to represent directly calculations that appear in mathematical physics.

Page 63: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

63

Research of Science

Intuition Representation

Understanding of nature develops

our intuition.

Nature

Better representation is invented to express developed intuition.

Good representation promotes us to

deepen our understanding of

nature.

Icons made by Freepik from www.flaticon.com is licensed by CC BY 3.0

Page 64: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

64

History of Mathematical Symbols

+ - () = × Σ Πhttps://en.wikipedia.org/wiki/History_of_mathematical_notation

Page 65: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

65

Number Notations

MMMCCCCVIIII

3409

三千四百九

Page 66: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

66

The Process of Inventing New Representation

Nature

Intuition

Intuition Representation

Intuition Representation

1. 2.

3.

Study the features of nature.

Determine the features that cause the gap.

Design new representation utilizing the features determined in the 2nd phase.

Icons made by Freepik from www.flaticon.com is licensed by CC BY 3.0

Page 67: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

67

The Process of Inventing New Representation

Nature

Intuition

1.

Study the features of nature.

Icons made by Freepik from www.flaticon.com is licensed by CC BY 3.0

Discovery of the rule that all numbers are uniquely represented in the following form.

Example (Number notation):

• Discovery of numbers. • Discovery of addition. • Discovery of multiplication.

c0 + c1・101+ c2・102

+ c r・10 r+ …n =

Page 68: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

68

The Process of Inventing New Representation

Intuition Representation

2. Determine the features that cause the gap.

Icons made by Freepik from www.flaticon.com is licensed by CC BY 3.0

• Discovery that the following rule is useful to improve representation. • All numbers are uniquely represented in

the following form.

Example (Number notation):

c0 + c1・101+ c2・102

+ c r・10 r+ …n =

Page 69: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

69

The Process of Inventing New Representation

Intuition Representation3.Design new representation utilizing the features

determined in the 2nd phase.Icons made by Freepik from www.flaticon.com is licensed by CC BY 3.0

• Idea to give a name to each number. • Invention of the decimal numeral system. • Invention of ‘0’ as a placeholder.

Example (Number notation):

Page 70: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

70

The Process of Inventing New Representation

Nature

Intuition

Intuition Representation

Intuition Representation

1. 2.

3.

Study the features of nature.

Determine the features that cause the gap.

Design new representation utilizing the features determined in the 2nd phase.

Icons made by Freepik from www.flaticon.com is licensed by CC BY 3.0

Page 71: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

71

Grand Questions

Is there a method for measuring the expressive power of languages?

Is there a common method for finding the better representation?

Page 72: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

72

Table of Contents

Introduction of the features of Egison.

Philosophy behind the creation of Egison and future direction.

Demonstration.

Page 73: Scalar and Tensor Parameters for Importing Notations … · Scalar and Tensor Parameters for Importing Notations of Differential Geometry into Programming ... Christoffel Symbols

THANK YOU