compute log 2 matrices