Skip to main content
added 109 characters in body
Source Link
Silvia
  • 27.6k
  • 3
  • 85
  • 166

Is

$$\begin{split} 1+&(M+S) \, a\\ +&(M.S+S.M+M.M+S.S) \, a^2\\ +&(M.M.S+M.S.M+M.S.S+S.M.M+S.M.S+S.S.M+M.M.M+S.S.S) \, a^3\\ +&O\left(a^4\right) \end{split}$$$$\begin{split} 1+&(M+S) \, a\\ +&(M\cdot S+S\cdot M+M\cdot M+S\cdot S) \, a^2\\ +&(M\cdot M\cdot S+M\cdot S\cdot M+M\cdot S\cdot S\\ &+S\cdot M\cdot M+S\cdot M\cdot S+S\cdot S\cdot M+M\cdot M\cdot M+S\cdot S\cdot S) \, a^3\\ +&O\left(a^4\right) \end{split}$$

what you're expecting for? If yes, please continue read.

First we define a temporary matrix $A$:

A /: Times[A, A] := CircleTimes[A, A]
A /: Power[A, n_ /; IntegerQ[n] && Positive[n]] := CircleTimes @@ ConstantArray[A, n]
A /: Times[A, CircleTimes[M__]] := CircleTimes[A, M]
A /: Times[CircleTimes[M__], A] := CircleTimes[M, A]

Then we substitute $M+S$ with $A$ and expand the series as normal way:

tempSeries = Series[1/(1 - a  A), {a, 0, 3}]

$1+A\, a+A\otimes A\, a^2+A\otimes A\otimes A\,a^3+O\left(a^4\right)$

Then substitute $M+S$ back and do some replacement and transformation like Distribute etc.

tempSeries /. A -> M + S /.
  CircleTimes[M__] :> Distribute[CircleTimes[M]] /.
 CircleTimes -> Dot

Now we get the result shown at beginning.

Is

$$\begin{split} 1+&(M+S) \, a\\ +&(M.S+S.M+M.M+S.S) \, a^2\\ +&(M.M.S+M.S.M+M.S.S+S.M.M+S.M.S+S.S.M+M.M.M+S.S.S) \, a^3\\ +&O\left(a^4\right) \end{split}$$

what you're expecting? If yes, please continue read.

First we define a temporary matrix $A$:

A /: Times[A, A] := CircleTimes[A, A]
A /: Power[A, n_ /; IntegerQ[n] && Positive[n]] := CircleTimes @@ ConstantArray[A, n]
A /: Times[A, CircleTimes[M__]] := CircleTimes[A, M]
A /: Times[CircleTimes[M__], A] := CircleTimes[M, A]

Then we substitute $M+S$ with $A$ and expand the series as normal way:

tempSeries = Series[1/(1 - a  A), {a, 0, 3}]

$1+A\, a+A\otimes A\, a^2+A\otimes A\otimes A\,a^3+O\left(a^4\right)$

Then substitute $M+S$ back and do some replacement and transformation like Distribute etc.

tempSeries /. A -> M + S /.
  CircleTimes[M__] :> Distribute[CircleTimes[M]] /.
 CircleTimes -> Dot

Now we get the result shown at beginning.

Is

$$\begin{split} 1+&(M+S) \, a\\ +&(M\cdot S+S\cdot M+M\cdot M+S\cdot S) \, a^2\\ +&(M\cdot M\cdot S+M\cdot S\cdot M+M\cdot S\cdot S\\ &+S\cdot M\cdot M+S\cdot M\cdot S+S\cdot S\cdot M+M\cdot M\cdot M+S\cdot S\cdot S) \, a^3\\ +&O\left(a^4\right) \end{split}$$

what you're expecting for? If yes, please continue read.

First we define a temporary matrix $A$:

A /: Times[A, A] := CircleTimes[A, A]
A /: Power[A, n_ /; IntegerQ[n] && Positive[n]] := CircleTimes @@ ConstantArray[A, n]
A /: Times[A, CircleTimes[M__]] := CircleTimes[A, M]
A /: Times[CircleTimes[M__], A] := CircleTimes[M, A]

Then we substitute $M+S$ with $A$ and expand the series as normal way:

tempSeries = Series[1/(1 - a  A), {a, 0, 3}]

$1+A\, a+A\otimes A\, a^2+A\otimes A\otimes A\,a^3+O\left(a^4\right)$

Then substitute $M+S$ back and do some replacement and transformation like Distribute etc.

tempSeries /. A -> M + S /.
  CircleTimes[M__] :> Distribute[CircleTimes[M]] /.
 CircleTimes -> Dot

Now we get the result shown at beginning.

Source Link
Silvia
  • 27.6k
  • 3
  • 85
  • 166

Is

$$\begin{split} 1+&(M+S) \, a\\ +&(M.S+S.M+M.M+S.S) \, a^2\\ +&(M.M.S+M.S.M+M.S.S+S.M.M+S.M.S+S.S.M+M.M.M+S.S.S) \, a^3\\ +&O\left(a^4\right) \end{split}$$

what you're expecting? If yes, please continue read.

First we define a temporary matrix $A$:

A /: Times[A, A] := CircleTimes[A, A]
A /: Power[A, n_ /; IntegerQ[n] && Positive[n]] := CircleTimes @@ ConstantArray[A, n]
A /: Times[A, CircleTimes[M__]] := CircleTimes[A, M]
A /: Times[CircleTimes[M__], A] := CircleTimes[M, A]

Then we substitute $M+S$ with $A$ and expand the series as normal way:

tempSeries = Series[1/(1 - a  A), {a, 0, 3}]

$1+A\, a+A\otimes A\, a^2+A\otimes A\otimes A\,a^3+O\left(a^4\right)$

Then substitute $M+S$ back and do some replacement and transformation like Distribute etc.

tempSeries /. A -> M + S /.
  CircleTimes[M__] :> Distribute[CircleTimes[M]] /.
 CircleTimes -> Dot

Now we get the result shown at beginning.