40

I need a differential geometry tool for Mathematica. Is there any add-on?

Unfortunately, Mathematica does not include such functionality or I can not find it.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Jim
  • 501
  • 1
  • 5
  • 4

3 Answers3

36

Atlas 2 for Mathematica is the add-on for doing modern differential geometry calculations.

The tool is available on DigiArea website and Wolfram Research website. The tool works with Mathematica 8 and Mathematica 9.

Calculations are coordinate free

  • First of all in the atlas tool all calculations are coordinate free. That means calculations are performed in terms of tensors, vectors and p-forms. Not their components!

    For example conformally flat metric tensor of sphere is presented as:

    conformally flat metric tensor

    where conformally flat metric tensor are coframe 1-forms and symbol - tensor product operator.


Standard differential geometry notations

  • Secondly, the package uses standard differential geometry notations for exterior derivative, covariant differentiation, tensor product etc. It is really helpful to see the same results/formulas on the screen and in my textbooks.

    • Example with Lie derivative calculation:

    conformally flat metric tensor

    • Example with exterior derivative calculation:

    conformally flat metric tensor

    • Example with tensor product calculation:

    conformally flat metric tensor

  • Atlas is very user-friendly and doesn't bog down with a lot of programming which is really importance for people interested in learning.

  • There are a lot of predefined operators to declare various DG objects.
    Just for example Invariants operator automatically calculates invariants of a mapping:

    • for an embedding of a curve - the curve's normalized moving frame and the curve's curvatures
    • for an embedding or immersion - the second fundamental form and mean curvature vector
    • for a submersion - A and T invariants, the mean curvature vector of corresponding fibers, the integrability obstruction of corresponding horizontal distribution and the riemannian obstruction (if the submersion is not a riemannian one).


Visualization of n-dimensional objects

  • The package has Visualize function that visualizes n-dimensional differential geometry objects using different Mathematica plot functions. The function allows quickly visualize an object and its projections. See some examples.

    For example visualization of projections for Mobius strip. Visualize Mobius strip Visualize Mobius strip


Differential Geometry Library

For instance:


Graphical user interfaces

  • There is a bunch of neat applications which included into the tool:
    • Atlas palette - Mathematica palette, allows manipulate, visualize and calculate entities for any of the objects from the library.
      • extends the keyboard with typesetting of characters and atlas symbols
      • gives access to the differential geometry library
      • generates notebook for any of the library objects that fully prepared to calculate differential geometry quantities for this entity
    • Atlas Wizard - solves differential geometry problems on the fly even if you have a little knowledge in the topic.

Video and Screencasts

Glorfindel
  • 547
  • 1
  • 8
  • 14
helen
  • 927
  • 1
  • 9
  • 10
32

The modern differential geometry is a vast subject and while not specified exactly what you need the question is a bit too general. I would rather point out a few references.

If you are looking for a package for tensor calculus, especially in General Relativity, the best choice is xAct made by José M. Martín-García (as far as I know he actually develops built-in functionality for the future versions of Mathematica):

However if you need something straightforward and concise, look at this implementation below of a few fundamental objects in differential geometry. You need a metric g and a coordinate system xx on an open set of a 4-dimentional (riemannian or lorentzian) manifold (but it is a straightforward to define these objects for other dimentions) as an input, eg.

xx = {t, x, theta, phi};
g  = { { -E^(2 nu[x]), 0, 0, 0}, {0, E^(2 lambda[x]), 0, 0}, 
       {0, 0, x^2, 0},           {0, 0, 0, x^2 Sin[theta]^2}};

The above is a Lorentzian metric tensor (in a given map) of a static spherically symmetric four dimentional manifold, and the following are the inverse metric, Christoffel symbol of the second kind, Riemann and Ricci curvature tensors and the Ricci scalar with brief descriptions of their usage:

enter image description here

    InverseMetric[ g_, xx_] := 
        Block[{ res }, 
                res = Simplify[ Inverse[g] ];
                res
            ]

enter image description here

    ChristoffelSymbol[g_, xx_] := 
        Block[{n, ig, res}, 
               n = 4;
               ig = InverseMetric[ g, xx]; 
               res = Table[(1/2)*Sum[ ig[[i,s]]*(-D[ g[[j,k]], xx[[s]]] + 
                                                  D[ g[[j,s]], xx[[k]]] 
                                                + D[ g[[s,k]], xx[[j]]]), 
                                      {s, 1, n}], 
                           {i, 1, n}, {j, 1, n}, {k, 1, n}];
               res
             ]

enter image description here

    RiemannTensor[g_, xx_] := 
        Block[{n, Chr, res}, 
               n   = 4;
               Chr = ChristoffelSymbol[ g, xx];
               res = Table[  D[ Chr[[i,k,m]], xx[[l]]] 
                           - D[ Chr[[i,k,l]], xx[[m]]]
                           + Sum[ Chr[[i,s,l]]*Chr[[s,k,m]], {s, 1, n}]
                           - Sum[ Chr[[i,s,m]]*Chr[[s,k,l]], {s, 1, n}], 
                            {i, 1, n}, {k, 1, n}, {l, 1, n}, {m, 1, n}]; 
               res
             ]

enter image description here

    RicciTensor[g_, xx_] :=
        Block[{Rie, res, n}, 
               n = 4; 
               Rie = RiemannTensor[ g, xx]; 
               res = Table[ Sum[ Rie[[ s,i,s,j]], 
                                 {s, 1, n}], {i, 1, n}, {j, 1, n}]; 
               res
             ]   

enter image description here

    RicciScalar[g_, xx_] := 
        Block[{Ricc,ig, res, n}, 
               n = 4;
               Ricc = RicciTensor[ g, xx];
               ig = InverseMetric[ g, xx];
               res = Sum[ ig[[s,i]] Ricc[[s,i]], {s, 1, n}, {i, 1, n}];
               Simplify[res]
            ]     

This is not an optimal implementation, but it is a good point to start building your own package. You could think about introducing a functional definition of the covariant derivative as well as lower and upper indices of covariant and contravariant tensors. One of the common difficulties with this is the multiplicity of definitions and conventions for Riemann and Ricci tensors etc, and that's why I added descriptions of the given functions.

Besides of the above I recommend to look at the Wolfram Demonstrations :

e.g.

One should also look at the geometry section of

Next it would be even more helpful and strongly recommended to look at these articles (some of them are particularly devoted to differential geometry topics, others only deal with useful geometric techniques) in the Mathematica Journal :

Artes
  • 57,212
  • 12
  • 157
  • 245
6

You may want to look, also, at David Park's Tensorial application as well as the associated TensorForms subpackage. See: http://home.comcast.net/~djmpark/TensorialPage.html

murray
  • 11,888
  • 2
  • 26
  • 50
  • Thank you very much, sir. How would you define an $n\times $ metric matrix for some generic $n$? Would any of the implementations in your post change significantly for such an unspecified $n$? My goal here is to examine a family of manifolds indexed by the naturals, each with the dimension of its index. The metrics depend nicely on the number $n$ and I want to treat the general case. – superAnnoyingUser Nov 13 '15 at 11:32
  • 2
    Link broken. Too bad – bbgodfrey Nov 27 '15 at 22:24
  • Your link does not work anymore. Would you please update the link? :) – Hosein Rahnama Feb 19 '16 at 09:14
  • The "Tensorial" author, David Park, seems to have moved his main Mathematica web site to https://davidandalicepark.wordpress.com/home-2/mathematica/. But none of his packages are linked there. One could try the email address at https://davidandalicepark.wordpress.com/home-2/mathematica/grassmann-calculus/ or the cached version of his old site: http://web.archive.org/web/20151002151436/http://home.comcast.net/~djmpark/Mathematica.html – murray Feb 19 '16 at 17:08
  • The tensorial 3.0 package is at http://library.wolfram.com/infocenter/MathSource/434/ – Bill Watts Dec 29 '18 at 07:39
  • @BillWatts: No, the link http://library.wolfram.com/infocenter/MathSource/434 does not point to David Park's Tensorial 3.0! The package and notebook link there are to version 1.3; the link on the page to version 3.0 is dead! – murray Dec 30 '18 at 16:17
  • Sorry, I guess they changed it. This is where I got my Tensorial 3.0. – Bill Watts Dec 30 '18 at 18:43
  • @murray another tensor package is at http://library.wolfram.com/infocenter/MathSource/8848/ which is the ccgrg package. I guess they pulled the tensorial 3.0 link because they are charging for tensorial 4.0 – Bill Watts Jan 14 '19 at 23:14
  • @BillWatts: Thanks for the link to ccgrg. Note that the issue with Tensorial 4.0 is not that it's proprietary, but that it does not seem any long to be available through David Park's current web site, https://davidandalicepark.wordpress.com. – murray Jan 15 '19 at 23:23