I want to solve a system of matrix equations $$A_1X = XB_1,$$ $$A_2X = XB_2,$$ $$A_3X = XB_3.$$ Here $A_i$, $B_i$ and $X$ are matrices $3 \times 3$ ($A_i$ and $B_i$ are known). How can I solve it using numpy and scipy?
I was trying to use scipy.linalg.solve_sylvester , but it gives only trivial solution (even in case $A_i = B_i = 0$).