Tag Info

New answers tagged

4

My keyboard is broken. So here is fast answer (on Mathematica 9); more later... Here is your input: dim = 3; g = RandomReal[{0, 1}, {dim, dim}]; F = RandomReal[{0, 1}, {dim, dim, dim, dim}]; Now multiply four g's and the F. Use TensorProduct[g, g, g, g, F] (don't run this yet--it's slow) to generate the rank 12 tensor (unrepeated indices). Now ...


2

I suspect you want something more than this but I would start with Indexed: Sum[f[Indexed[n, k]], {k, 0, Ν}] Note that I replaced N, a reserved symbol, with \[CapitalNu] which looks the same but is free for use.


4

The OP correctly notes that Collect with Simplify is essential for computing this double sum in a reasonable amount of time, if at all. It is straightforward to find that the LeafCount of the inner sum only without using Collect is 721809. With it, the size of the inner sum drops to 21158. However, we can do much better. Instead, define the inner sum as ...


2

This performs the multiplications before additions in onder to avoid repetitive multiplications: f[M_, n_] := Reverse[Table[Cos[θ[i]] Cos[θ'[i]], {i, 2, n}]].PadLeft[FoldList[ Sin[θ[M - #2] θ'[M - #2]] # &, Sin[θ[M] θ'[M]], Range[M - 3]], Max[n - 1, 0], 1]



Top 50 recent answers are included