A manipulação com matrizes com Python é mauito anti-natural eu acho. Vamos experimentar com o Python que tem uma sintaxe mais parecida com o matlab acho.
Vamos fazer o exemplo da decomposição de Kalman. dado um par de matrizes $(A,B)$ tal que a matriz de Kalman $[B|AB|\cdots A^{n-1}B]$ tem posto $d<n$, vamos encontrar o sistema equivalente $(A_1,B_1)$ que esteja na forma normal de controlabilidade.
A=[0 1. 0 0
12 0 0 4
0 0 0 1
0 -4 0 0]
4x4 Array{Float64,2}: 0.0 1.0 0.0 0.0 12.0 0.0 0.0 4.0 0.0 0.0 0.0 1.0 0.0 -4.0 0.0 0.0
B=[0;1.;0;0]
4-element Array{Float64,1}: 0.0 1.0 0.0 0.0
# Matriz de Kalman
K=[B';(A*B)';(A*A*B)';(A*A*A*B)']'
4x4 Array{Float64,2}: 0.0 1.0 0.0 -4.0 1.0 0.0 -4.0 0.0 0.0 0.0 -4.0 0.0 0.0 -4.0 0.0 16.0
f1=K[:,1]
f2=K[:,2]
f3=K[:,3]
4-element Array{Float64,1}: 0.0 -4.0 -4.0 0.0
f4=[0;0;0;1]
4-element Array{Int64,1}: 0 0 0 1
P=[f1';f2';f3';f4']'
4x4 Array{Float64,2}: 0.0 1.0 0.0 0.0 1.0 0.0 -4.0 0.0 0.0 0.0 -4.0 0.0 0.0 -4.0 0.0 1.0
Pi=inv(P)
4x4 Array{Float64,2}: -0.0 1.0 -1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 -0.25 0.0 4.0 0.0 0.0 1.0
A1=Pi*A*P
4x4 Array{Float64,2}: 0.0 0.0 0.0 3.0 1.0 0.0 -4.0 0.0 0.0 1.0 0.0 -0.25 0.0 0.0 0.0 0.0
B1=Pi*B
4-element Array{Float64,1}: 1.0 0.0 0.0 0.0