# Tag Info

3

Take two arrays like you describe: n = 100; A = RandomReal[1, {n, n, n, n}]; B = RandomReal[1, {n, n}]; With your solution AbsoluteTiming[ Dimensions[result1 = TensorProdContract[A, B, {{2, 1}, {4, 2}}]]] {2.22103, {100, 100}} To avoid the inefficiency you refer to above, inactivate the tensor product and activate back at the end: ...

0

You can do this by projecting onto the two orthogonal vectors in the product space that have the second factor equal to the unchanged vector: res = KroneckerProduct[{{a}, {b}}, {{c}, {d}}] /. {a -> e, b -> f} (* ==> {{c e}, {d e}, {c f}, {d f}} *) p1 = KroneckerProduct[{{1}, {0}}, {{c}, {d}}/(c^2 + d^2)]; p2 = KroneckerProduct[{{0}, {1}}, {{c}, ...

7

Thank you for your interest. I would strongly recommend against trying to modify SymbolicTensorsCoordinateChartDataDumpmappingInfo. It is a very low level function and any changes you make are unlikely to work. There are two sets of operations commonly needed with alternate coordinate systems. One is calculus in the coordinate system - Grad, Div, Curl ...

Top 50 recent answers are included