commat function

Commutation matrix