is because you loaded TensoriaCalc more than once in the same kernel session.

When writing the package, I had to Protect all the symbols used in the package, such as Tensor, Metric, etc. This means their definitions cannot be altered by an external user, as otherwise, it will create inconsistencies. This is why loading TensoriaCalc more than once gives an error, because you are essentially trying to define these symbols yet again.

General remarks

In General Relativity we work in a 4-dimentional Lorentzian manifold i.e. there is a metric tensor $g$ of signature $(+,-,-,-)$ or $(-,+,+,+)$. Theses signatures are mathematically equivalent and we choose the latter because of certain quite formal aspects even though there are some physically relevant reasons for choosing the former one. In a neighbourhood of any point we choose a local chart $xx = (x^{1},x^{2},x^{3},x^{4})$ where the metric tensor is represented by real functions $g_{\alpha\beta}(x^{\mu})$ i.e. $g = g_{\alpha\beta}(x^{\mu}) dx^{\alpha}\otimes dx^{\beta}$ (We enumerate indices by $1,2,3,4$ unlike traditionally $0,1,2,3$ for representing tensors in Mathematica by Tables and accessing their entries by Part e.g. [[1,1]]). Now assuming the Einstein notation we need the following objects :

Following this way one could define another interesting geometrical objects e.g. the Weyl tensor $
C_{\mu\nu\lambda\sigma}=R_{\mu\nu\lambda\sigma}-\left(g_{\mu[\lambda}R_{\nu]\sigma}-g_{\nu[\lambda}R_{\sigma]\mu}\right)+\frac{1}{3}R g_{\mu[\lambda}g_{\nu]\sigma}$

Thank everybody above for your patience and help. I have some seminars those days, I will come back soon and give the feedback.
–
Zoe RowaJul 31 '12 at 18:15

Wouldn't it be better to use n=Length[g] instead of n=4? This helps generalize the package to more dimensions.
–
cartonnFeb 15 '14 at 21:09

@cartonn This is a part of my larger package I wrote some time ago. In fact I needed only n = 4 case because of another functions therein, which were defined properly assuming that there were 4 dimensions. A generalization shouldn't be difficult but it would need a bit more than changing only n = 4 to n = Length[g].
–
ArtesFeb 15 '14 at 23:49

partialDer::usage = "partialDer[T,vars] builts the list of the \
partial derivatives \!\(\*SubscriptBox[\(\[PartialD]\), \(i\)]\)T of \
tensor T w.r.t. the variables of list \"vars\". The first index of \
the produced list will be the derivative index."
christoffelSymbols::usage = "christoffelSymbols[metric, vars] gives \
the Christoffel-Symbols christ\[LeftDoubleBracket]i,j,k\
\[RightDoubleBracket] with variables of list vars and the metric \
Tensor metric. The first indes will be the \"upper\" index."
curvTensor::usage = "curvTensor[christ,vars] takes the Christoffel \
symbols \"christ\" with variables vars and calcules the Rieman \
curvature tensor. The first index will be the \
\"upper\\[CloseCurlyDoubleQuote] index."
ricciTensor::usage = "ricciTensor[curv] takes the Riemann curvarture \
tensor \"curv\" and calculates the Ricci tensor"

Example

First we need to give a metric Tensor gM and the variables list vars we will use, then we calculate the Christoffel symbols, the Riemann Curvature tensor and the Ricci tensor:

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.