0
$\begingroup$

I'm trying to use FoldList to create successive matrices that depend on a changing parameter n, so the transition matrices are constructed like T(n) for successive steps of n, applied to an initial state vector q(0).

I want to then use each transition matrix in a matrix power average using MatrixPower, like so:

enter image description here

Any idea how to go about this? I'm not familiar with Mathematica, Python is my language of preference, but Mathematica is better for symbol-based calculation.

$\endgroup$
1
  • $\begingroup$ To start: FoldList[#1 #2 &, q0, {T1, T2, T3}]. If you want to use matrix power, you can modify and include matrices. $\endgroup$
    – Syed
    Commented Apr 7 at 1:10

2 Answers 2

1
$\begingroup$
FoldList[#2 . #1 &, q[0], T /@ Range[3]]

(*    {q[0],
       T[1] . q[0],
       T[2] . T[1] . q[0],
       T[3] . T[2] . T[1] . q[0]}    *)
$\endgroup$
1
$\begingroup$
ComposeList[{T1, T2, T3}, q[0]]

{q[0], T1[q[0]], T2[T1[q[0]]], T3[T2[T1[q[0]]]]}

or

FoldList[Construct[#2, #1] &, q[0], {T1, T2, T3}]

{q[0], T1[q[0]], T2[T1[q[0]]], T3[T2[T1[q[0]]]]}

or

Through[FoldList[RightComposition, {T1, T2, T3}]@q[0]]

{T1[q[0]], T2[T1[q[0]]], T3[T2[T1[q[0]]]]}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.