title: Starting tensor indices at 0
body: <p>Some time ago I wrote a package for tensor calculus in General Relativity. In order to make it easily accessible  for others it should be slightly modified. </p>
  
  <p>There are functions like i.e. Christoffel for calculation of Christoffel symbol :</p>
  
  <pre><code>Christoffel[g_, xx_] := 
      Block[{ig, res, n}, 
             n = 4;
             ig = Simplify[Inverse[g]]; 
             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
       ] 
  </code></pre>
  
  <p>where g and xx are metric tensor and coordinates respectively, which I define in a Mathematica session after uploading the package in a straightforward way putting for example an ansatz for a static spherically symmetric spacetime : 
    <img src="https://i.stack.imgur.com/PBY2D.jpg" alt="metric">
   This way involves drawbacks since index ranges are <code>{1, 2, 3, 4}</code>  while the common practice in relativistic physics suggests to put <code>{0, 1, 2, 3}</code> where 0 stands for timelike coordinate, and <code>{1, 2, 3}</code> stand for spacelike ones.<br>
     To ilustrate the problem let's define a table where indices start from 0 , i.e.</p>
  
  <pre><code>V = Table[i - j, {i, 0, 3}, {j, 0, 3}] 
  {{0, -1, -2, -3}, {1, 0, -1, -2}, {2, 1, 0, -1}, {3, 2, 1, 0}}
  </code></pre>
  
  <p>but when I evaluate 
   <code>V[[0, 0]]</code> 
  I get   <code>Symbol</code> - the head of V,<br>
    while for  <code>V[[1, 2]]</code> I get <code>-1</code> as it should be.</p>
  
  <p><strong>My questions are :</strong></p>
  
  <ol>
  <li>How could I redefine V in order be able to evaluate "table" component <code>[0, 0]</code> ? </li>
  <li>What would be the most convenient way to introduce matrix g with its indices starting at 0? </li>
  <li>Since I have to give up using <code>Part</code> to access tensor components <code>0,0</code>
  how to introduce in a package a freedom of choice of index ranges of other objects like Christoffel (let's say by default index ranges - <code>{0, 1, 2, 3}</code> or if one prefers - <code>{1, 2, 3, 4}</code>) ? </li>
  </ol>
  
  <p>Although these questions seem trivial at first sight but any comprehensive answers are welcome. Anyone using a package shouldn't bother his head about Mathematica subtleties.</p>