%test factor_SU2pow3_matrix()

U0 = rand_unitary(2, 1); 
U1 = rand_unitary(2, 1); 
U2 = rand_unitary(2, 1); 

U = kron(kron(U2,U1),U0);
[X2,X1,X0] = factor_SU2pow3_matrix(U);
