Hello,
I have a hard calculation to do that I have performed successfully in 7 dimensions, but when I try to do an analogous calculation in 11 dimensions things become impossibly slow. I realize that the Riemann tensor in D=11 has 1210 non-zero out of a total of 11^4 components, so it is expected to be slow, but how do I speed up my calculation? Here is part of my code, the full code is attached as a notebook, the problem arises in section 6 of the notebook:
Define the manifold:
<< xAct`xTerior`
xAct`xCoba`$LargeComponentSize = 3000;
$PrePrint = ScreenDollarIndices;
$DefInfoQ = $UndefInfoQ = $CVVerbose = False;
$CVSimplify = Together;
DefManifold[man, 11, {a, b, c, d, e, f, h, i, j, k, l}]
Define chart:
DefChart[bh11, man, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, {t[],
r[], \[Theta][], \[Psi][], \[Phi][], x[],
y[], \[Alpha][], \[Beta][], \[Phi]1[], \[Phi]2[]},
FormatBasis -> {"Partials", "Differentials"}]
DefConstantSymbol@{f0, g0, r0, m, \[Epsilon], p, q, g, L, z, \[Lambda]1, \[Lambda]2};
DefScalarFunction /@ {U, \[CapitalLambda], \[CapitalOmega], Att,
A\[Sigma]3, \[Nu]1, \[Nu]2, \[Nu]3, \[CapitalDelta], U11};
$Assumptions =
And[t[] \[Element] Reals, r0 > 0, r[] > r0, \[Pi] > \[Theta][] > 0,
4 \[Pi] > \[Phi][] > 0, 2 \[Pi] > \[Psi][] > 0,
x[] \[Element] Reals,
y[] \[Element] Reals, \[Pi] > \[Alpha][] > 0, \[Pi]/2 > \[Beta][] >
0, 1 > z > 0, m > 0, \[Epsilon] \[Element] Reals, L > 0, f0 > 0,
g0 > 0];
Define metric and covariant derivative:
[Some trivial code to setup the metric matrix omitted]
metmatrix =
CoefficientArrays[
ds2, {dt, dr, d\[Theta], d\[Psi], d\[Phi], dxx, dy, d\[Alpha],
d\[Beta], d\[Phi]1, d\[Phi]2}, "Symmetric" -> True][[3]] //
Normal // Simplify;
metbh11 =
CTensor[metmatrix /. {t -> t[],
r -> r[], \[Theta] -> \[Theta][], \[Psi] -> \[Psi][], \[Phi] -> \
\[Phi][], x -> x[],
y -> y[], \[Alpha] -> \[Alpha][], \[Beta] -> \[Beta][], \[Phi]1 \
-> \[Phi]1[], \[Phi]2 -> \[Phi]2[]}, {-bh11, -bh11}];
SetCMetric[metbh11, bh11, SignatureOfMetric -> {10, 1, 0}]
cdbh11 = CovDOfMetric[metbh11];
Trying to calculate Ricci (impossibly slow, left it overnight, it got stuck on finding Riemann[-1,-1,-1,1] with no error messages, just moves very slowly):
MetricCompute[metbh11, bh11, "Ricci"[-1, -1],
Verbose -> True, Parallelize -> True] // AbsoluteTiming
Thoughts:
I carry a bunch of constant symbols throughout the whole calculation: f0, g0, r0, m, \[Epsilon], p, q, g, L, z, \[Lambda]1, \[Lambda]2. I tried giving them numerical values beforehand, but this only makes things slower (even cdbh11 takes much longer to compute that way), I guess carrying numbers with many decimals after the comma is hard.
Raising indices is hard. I noticed the following: I have a tensor G[-a,-b,-c,-d]. Asking for G[-a,-b,c,d] is way slower than asking for metbh11[c,i]metbh11[d,j]G[-a,-b,-i,-j].
Questions:
3/ If the calculation is just slow and that's life I plan to put it on a cluster. Is there a way to tell xAct to make use of GPU resources for faster matrix operations?
Thank you so much, to everyone involved, for making such an expansive and amazing package!
Vasko