Sage UM Unitary Matrices

No surprise about how we check if a matrix is unitary. Here is Example UM3,





We can verify Theorem UMPIP, where the vectors u and v are created randomly. Try evaluating this compute cell with your own choices.



If you want to experiment with permutation matrices, Sage has these too. We can create a permutation matrix from a list that indicates for each column the row with a one in it. Notice that the product here of two permutation matrices is again a permutation matrix.