3

I'm trying to print Christoffel symbols of the second kind for a surface in $\mathbb R^3$. I currently am using something along the lines of

Do[
  Print[Subscript[Subscript[\[CapitalGamma]^k, i], j]],
  {i, 2}, {j, 2}, {k, 2}
]

Unfortunately the superscript '1' is suppressed. How do I force them to display?

merv
  • 131
  • 5
  • 6
    Instead of \[CapitalGamma]^k use Superscript[\[CapitalGamma], k]. – Artes May 08 '13 at 17:20
  • Do on its own can be used for nested loops. No need to repeat Do three times. – Sjoerd C. de Vries May 08 '13 at 17:30
  • @Artes Is there a way to do that with a control sequence? The code showing in my question is just how it copies out of Mathematica - I originally typed "Ctrl+6", "k", "Ctrl+Space". – merv May 08 '13 at 17:34
  • 4
    The Superscript page tells you the (partial) cause for your problem: "Input of the form x^y in a notebook is interpreted as Power[x,y], not as Superscript[x,y]." – Sjoerd C. de Vries May 08 '13 at 17:39
  • @merv Perhaps this answer: http://mathematica.stackexchange.com/questions/8895/how-to-calculate-scalar-curvature-ricci-tensor-and-christoffel-symbols-in-mathem/8908#8908 might be interesting for you if you set n=2 and enumerate metric tensor inices with 1 and 2 like in standard riemannian geometry. – Artes May 08 '13 at 17:48
  • 2
    @SjoerdC.deVries The documentation makes it seem like "Ctrl+^" should be inserting \Superscript, not merely ^. – merv May 08 '13 at 17:49

2 Answers2

1

Making an answer from the comments:

Instead of \[CapitalGamma]^k use Superscript[\[CapitalGamma], k]. – Artes May 8 '13 at 17:20

The Superscript page tells you the (partial) cause for your problem: "Input of the form x^y in a notebook is interpreted as Power[x,y], not as Superscript[x,y]." – Sjoerd C. de Vries May 8 '13 at 17:39

So the solution is to use Superscript directly:

Superscript[f, 1] // Print

output

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
0

How about something along these lines:

Clear[coord, metric, inversemetric, affine, r, \[Theta], t];
n = 3;
coord = {r, \[Theta], t};
metric = {{(1 - 2 m/r)^(-1), 0, 0}, {0, r^2, 0}, {0, 0, -(1 - 2 m/r)}};
metric // MatrixForm
inversemetric = Simplify[Inverse[metric]];
inversemetric // MatrixForm
affine := affine = Simplify[Table[(1/2)*Sum[(inversemetric[[i, s]])*
       (D[metric[[s, j]], coord[[k]] ] +
         D[metric[[s, k]], coord[[j]] ] - 
         D[metric[[j, k]], coord[[s]] ]), {s, 1, n}],
    {i, 1, n}, {j, 1, n}, {k, 1, n}] ]
listaffine := 
 Table[If[UnsameQ[affine[[i, j, k]], 
    0], {ToString[\[CapitalGamma][(i - 1), (j - 1), (k - 1)]], 
    affine[[i, j, k]]}] , {i, 1, n}, {j, 1, n}, {k, 1, j}]
TableForm[Partition[DeleteCases[Flatten[listaffine], Null], 2], 
 TableSpacing -> {2, 2}]
Mark Pace
  • 316
  • 1
  • 12