AllContractions expected time

38 views
Skip to first unread message

apt45

unread,
Mar 28, 2018, 1:41:28 PM3/28/18
to xAct Tensor Computer Algebra
I have to compute all possible contractions of 4 6-rank tensors T[a,b,c,d,e,f] which have a definite symmetry(look the definition in the code).

I do the following

<< xAct`xTras`
DefTensor[T[a, b, c, d, e, f], M, TableauSymmetric[{{a, b, c}, {d, e, f}}]]

If I compute all possible contractions for 2 tensors, 

AllContractions[ Module[{a, b, c, d, e, f}, T[a, b, c, d, e, f]] Module[{a, b, c, d, e, f}, T[a, b, c, d, e, f]]] // Timing

I get the answer in 0.128567 seconds.

Now, I wanto to compute

list = AllContractions[ Module[{a, b, c, d, e, f}, T[a, b, c, d, e, f]] Module[{a, b, c, d, e, f}, T[a, b, c, d, e, f]] Module[{a, b, c, d, e, f}, T[a, b, c, d, e, f]] Module[{a, b, c, d, e, f}, T[a, b, c, d, e, f]]]

Is there a way to compute the expected running time for this command? I know that this is not an speed task, but I want to understand how much time I have to wait.

If the time is too big, is there a way to speed up the command?? Thank you


Teake Nutma

unread,
Mar 28, 2018, 2:37:13 PM3/28/18
to xAct Tensor Computer Algebra
Hi,

AllContractions has a `Verbose -> True` option that shows basic
information about what’s going on, and a (most likely very) naive
linearly fitted ETA. So for the three tensor case you could do

```
AllContractions[IndexFree[T^3], Verbose -> True]
```

(Note also the IndexFree notation,
http://www.xact.es/xtras/documentation/ref/IndexFree.html).
But for the n=4 case the ETA shown is pretty much useless. To get a
better idea, you can try to fit a non-linear model to the timings for
n=1,2,3:

```
timings = First/@AbsoluteTiming@AllContractions[IndexFree[T^#]] & /@ Range[3]
f = a Exp[b x^c + d] (* Yeah I'm overfitting four parameters to three
datapoints because I'm lazy. *)
fit = FindFit[timings, f, {a, b, c, d}, x, MaxIterations -> 10000]
f/.fit/.x->4
```

which gives about 240,000 seconds on my machine, or roughly 66 hours.
Of course, this assumes you don’t run out of memory, so keep an eye
that during the computation.

Good luck,


Teake
> --
> You received this message because you are subscribed to the Google Groups "xAct Tensor
> Computer Algebra" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

apt45

unread,
Mar 29, 2018, 1:44:34 PM3/29/18
to xAct Tensor Computer Algebra

Hi Teake,
Thank you for your answer. 

I finally managed to compute all the contractions in "just" 3 hours (on a cluster with just 1 node). Amazing!

Thank you
Reply all
Reply to author
Forward
0 new messages