Function Repository Resource:

ChristoffelSymbol

Source Notebook

Return the Christoffel symbol for a given metric

Contributed by: Lars Ulke-Winter

ResourceFunction["ChristoffelSymbol"][metric,coords]

creates the Christoffel symbol of the second kind for metric specified in coordinate variables coords.

ResourceFunction["ChristoffelSymbol"][metric,coords,"Kind""First"]

creates the Christoffel symbol of the first kind.

Details and Options

Christoffel Symbols are rank-3 objects defined by the relation (with base vectors ek and coordinate variables zj).
Christoffel symbols of the first kind are usually written as , though some text books use the ordering .
Input metric should be a matrix or StructuredArray expression.
ResourceFunction["ChristoffelSymbol"] outputs a triple nested List.

Examples

Basic Examples (3) 

Christoffel symbol of the second kind for Euclidean cylindrical coordinates:

In[1]:=
ResourceFunction["ChristoffelSymbol"][\!\(\*
TagBox[
RowBox[{"(", "", GridBox[{
{"1", "0", "0"},
{"0", 
SuperscriptBox["r", "2"], "0"},
{"0", "0", "1"}
},
GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.7]}, 
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]}, 
Offset[0.2]}}], "", ")"}],
Function[BoxForm`e$, 
MatrixForm[BoxForm`e$]]]\), {r, \[Phi], z}] // MatrixForm
Out[1]=
In[2]:=
% // TensorRank
Out[2]=

Christoffel symbol of the first kind for cylindrical coordinates:

In[3]:=
ResourceFunction["ChristoffelSymbol"][\!\(\*
TagBox[
RowBox[{"(", "", GridBox[{
{"1", "0", "0"},
{"0", 
SuperscriptBox["r", "2"], "0"},
{"0", "0", "1"}
},
GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.7]}, 
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.4]}, 
Offset[0.2]}}], "", ")"}],
Function[BoxForm`e$, 
MatrixForm[BoxForm`e$]]]\), {r, \[Phi], z}, "Kind" -> "First"] // MatrixForm
Out[4]=

Christoffel symbols of a sphere:

In[5]:=
ResourceFunction["ChristoffelSymbol"][
  CoordinateChartData["Spherical", "Metric", {r, \[Theta], \[CurlyPhi]}],
  {r, \[Theta], \[CurlyPhi]}, "Kind" -> "Second"] // MatrixForm
Out[6]=
In[7]:=
ResourceFunction["ChristoffelSymbol"][
  CoordinateChartData["Spherical", "Metric", {r, \[Theta], \[CurlyPhi]}],
  {r, \[Theta], \[CurlyPhi]}, Kind -> "First"] // MatrixForm
Out[10]=

Applications (5) 

The Christoffel symbol on a torus described with surface coordinates  (5) 

Describe a toroidal surface in ambient Cartesian space with surface coordinates:

In[11]:=
x[\[Alpha]_, \[Beta]_] := (R + r Cos[\[Beta]]) Cos[\[Alpha]]
y[\[Alpha]_, \[Beta]_] := (R + r Cos[\[Beta]]) Sin[\[Alpha]]
z[\[Alpha]_, \[Beta]_] := r Sin[\[Beta]]

Plot the surface:

In[12]:=
ParametricPlot3D[({x[\[Alpha], \[Beta]], y[\[Alpha], \[Beta]], z[\[Alpha], \[Beta]]} /. {r -> 1, R -> 3}), {\[Alpha], 0, 2 \[Pi]}, {\[Beta], 0, 2 \[Pi]}]
Out[12]=

Form a covariant basis on the surface:

In[13]:=
{Subscript[g, \[Alpha]], Subscript[g, \[Beta]]} = Transpose@(D[{x[\[Alpha], \[Beta]], y[\[Alpha], \[Beta]], z[\[Alpha], \[Beta]]}, {{\[Alpha], \[Beta]}}])
Out[13]=

Get the covariant surface metric tensor:

In[14]:=
Subscript[g, \[Alpha]\[Beta]] = SymmetrizedArray[{{1, 1} -> Subscript[g, \[Alpha]] . Subscript[g, \[Alpha]], {1, 2} -> Subscript[g, \[Alpha]] . Subscript[g, \[Beta]], {2, 2} -> Subscript[g, \[Beta]] . Subscript[g, \[Beta]]}, {2, 2}, Symmetric[{1, 2}]] // Simplify
Out[14]=

This leads to the related Christoffel symbol of the second kind of the toroidal surface:

In[15]:=
ResourceFunction["ChristoffelSymbol"][Subscript[
  g, \[Alpha]\[Beta]], {\[Alpha], \[Beta]}] // MatrixForm
Out[17]=

Publisher

Lars Ulke-Winter

Version History

  • 1.0.0 – 08 October 2019

Related Resources

License Information