# How to do $\bigotimes_{i=1}^n A_i$ where $A_i$ is a $m \times m$ matrix?

$$\bigotimes_{i=1}^n A_i$$

where $A_i$ is a $m \times m$ matrix.

I want to do above operation, however KroneckerProduct in Mathematica must list all $A_i$s I need to use.

I have a function $A_i$ where $i\in \mathbb{Z}$, and I want to write a program which doesn't depend on specific $n$. I know I can write a recursion, but I want to know whether there is more clever method.

• Something like KroneckerProduct @@ Table[A[i], {i, n}]? Sep 12, 2018 at 20:33
• @CarlWoll Nice, thank you. Sep 12, 2018 at 20:36
• also Array[A, {n}, 1, KroneckerProduct]?
– kglr
Sep 12, 2018 at 20:41
• @kglr {n} can be just n here. Sep 13, 2018 at 2:56
• @ΑλέξανδροςΖεγγ, right; thank you.
– kglr
Sep 13, 2018 at 3:33

kP[a_, n_Integer] := Array[a, n, 1, KroneckerProduct]
kP[a_, 1] := a[1]

kP[A, 5]


KroneckerProduct[A[1], A[2], A[3], A[4], A[5]]

• Note, that for $n=1$ a special case is required or Unprotect@KroneckerProduct; KroneckerProduct[m_] := m.
– Johu
Sep 12, 2018 at 21:58
• @Johu, good point; added the special case.
– kglr
Sep 12, 2018 at 23:29