matrix multiplication appears to work for diagonal matrices.