When are matrix logarithms diagonal?

Is this true: "$P$ is diagonal if and only if there exists a diagonal $\log P$"? This is the matrix logarithm. I just want to make sure of my reasoning.

If $\log P$ is diagonal, then $P$ is diagonal because \begin{align*} P &= \exp(\log P) \\ &= I + \log P + \frac{1}{2}(\log P)^2 + \cdots. \end{align*}

On the other hand if $P$ is diagonal, then $\log P$ is diagonal because $$\log P = \left[ \begin{array}{ccc} \log P_{11} & 0 & 0\\ 0 & \ddots & 0\\ 0 & 0 & \log P_{nn} \end{array} \right].$$

On the second one, is the logarithm unique? What happens if I change $P$ to orthogonal? What about invertible?

• Your question is not well posed, because matrix logarithm is not unique in general. When you say "$P$ is diagonal if and only if $\log P$ is diagonal", which $\log P$ are you referring to? – user1551 Aug 25 '17 at 4:41
• @user1551 yes I mentioned uniqueness but I have edited the question now to make it a little more clear. I am talking about any of them. What I care about is what kind of $P$ matrices can I look at that have at least one diagonal logarithm. – Taylor Aug 25 '17 at 13:08

If $\log P$ is diagonal, clearly $P$ must also be diagonal, because $P=\exp(\log P)$ is a power series in $\log P$.
But then each diagonal entry of $P$ is the exponential of its counterpart $\log P$. Therefore, $P$ has a diagonal matrix logarithm if and only if $P$ is a diagonal matrix with an entrywise nonzero diagonal.
• It means a diagonal matrix $P$ that has not any zero diagonal entries. That is, all diagonal entries of $P$ are nonzero, while all off-diagonal entries are zero. – user1551 Aug 25 '17 at 19:34