# Trace of the Exponential of a Square Matrix

Tags:
1. Dec 1, 2017

### VSayantan

1. The problem statement, all variables and given/known data
Find the trace of a $4\times 4$ matrix $\mathbb U=exp(\mathbb A)$, where
$$\mathbb A = \begin {pmatrix} 0&0&0&{\frac {\pi}{4}}\\ 0&0&{\frac {\pi}{4}}&0\\ 0&{\frac {\pi}{4}}&0&0\\ {\frac {\pi}{4}}&0&0&0 \end {pmatrix}$$

2. Relevant equations
$$e^{(\mathbb A)}=\mathbb P {e^{\mathbb D}} {\mathbb P}^{-1}$$

3. The attempt at a solution
Eigenvalues of $\mathbb (A)$ are ${\lambda}_1=-\frac {\pi}{4}$, ${\lambda}_2=-\frac {\pi}{4}$, ${\lambda}_3=\frac {\pi}{4}$ and ${\lambda}_4=\frac {\pi}{4}$.
The corresponding eigenvectors are
$${\vec v}_1=\begin {pmatrix} 0\\ -1\\1\\0 \end {pmatrix}$$
$${\vec v}_2=\begin {pmatrix} -1\\ 0\\0\\1 \end {pmatrix}$$
$${\vec v}_3=\begin {pmatrix} 0\\ 1\\1\\0 \end {pmatrix}$$
$${\vec v}_4=\begin {pmatrix} 1\\ 0\\0\\1 \end {pmatrix}$$

So, $$\mathbb P = \begin {pmatrix} 0&-1&0&1\\ -1&0&1&0\\ 1&0&1&0\\ 0&1&0&1 \end {pmatrix}$$

$$Co{\mathbb P} = \begin {pmatrix} 0&2&0&-2\\ 2&0&-2&0\\ -2&0&-2&0\\ 0&-2&0&-2 \end {pmatrix}$$

$${(Co{\mathbb P})}^T = \begin {pmatrix} 0&2&-2&0\\ 2&0&0&-2\\ 0&-2&-2&0\\ -2&0&0&-2 \end {pmatrix}$$

$$det{\mathbb P} = \begin {vmatrix} 0&-1&0&1\\ -1&0&1&0\\ 1&0&1&0\\ 0&1&0&1 \end {vmatrix}$$
Which gives
$$det{\mathbb P} = -4$$

Now, $${\mathbb P}^{-1} = \frac {{(Co{\mathbb P})}^T}{det{\mathbb P}}$$
So, $${\mathbb P}^{-1} = {\frac {1}{- 4}}{\begin {pmatrix} 0&2&-2&0\\ 2&0&0&-2\\ 0&-2&-2&0\\ -2&0&0&-2 \end {pmatrix}}$$

After simplification
$${\mathbb P}^{-1} = \begin {pmatrix} 0&{-\frac {1}{2}}&{\frac {1}{2}}&0\\ {-\frac {1}{2}}&0&0&{\frac {1}{2}}\\ 0&{\frac {1}{2}}&{\frac {1}{2}}&0\\ {\frac {1}{2}}&0&0&{\frac {1}{2}} \end {pmatrix}$$

Then $${{\mathbb P}^{-1}}{\mathbb A}{\mathbb P} = {\begin {pmatrix} 0&{-\frac {1}{2}}&{\frac {1}{2}}&0\\ {-\frac {1}{2}}&0&0&{\frac {1}{2}}\\ 0&{\frac {1}{2}}&{\frac {1}{2}}&0\\ {\frac {1}{2}}&0&0&{\frac {1}{2}}\end {pmatrix}} {\begin {pmatrix} 0&0&0&{\frac {\pi}{4}}\\ 0&0&{\frac {\pi}{4}}&0\\ 0&{\frac {\pi}{4}}&0&0\\ {\frac {\pi}{4}}&0&0&0 \end {pmatrix}}{\begin {pmatrix} 0&-1&0&1\\ -1&0&1&0\\ 1&0&1&0\\ 0&1&0&1\end {pmatrix}}$$
This simplifies, giving the diagonal matrix $${{\mathbb P}^{-1}}{\mathbb A}{\mathbb P} =\begin {pmatrix} -{\frac {\pi}{4}}&0&0&0\\ 0&-{\frac {\pi}{4}}&0&0\\ 0&0&{\frac {\pi}{4}}&0\\ 0&0&0&{\frac {\pi}{4}} \end {pmatrix}$$

Now, I don't know if $$e^{{{\mathbb P}^{-1}}{\mathbb A}{\mathbb P}} =\begin {pmatrix} e^{-{\frac {\pi}{4}}}&0&0&0\\ 0&e^{-{\frac {\pi}{4}}}&0&0\\ 0&0&e^{{\frac {\pi}{4}}}&0\\ 0&0&0&e^{{\frac {\pi}{4}}} \end {pmatrix}$$

If it is so, $trace {[\mathbb P {e^{\mathbb D}} {\mathbb P}^{-1}]}$ looks not ok.

Can anyone suggest any simpler way to handle such a problem?

Last edited: Dec 1, 2017
2. Dec 1, 2017

### Staff: Mentor

This equation is not correct.

3. Dec 1, 2017

### VSayantan

Thanks @DrClaude, for pointing out.
It should be $$e^{(\mathbb A)}=\mathbb P {e^{\mathbb D}}{\mathbb P}^{-1}$$
I corrected it.

4. Dec 1, 2017

### Staff: Mentor

You now need to calculate $\mathbb P {e^{\mathbb D}}{\mathbb P}^{-1}$.

5. Dec 1, 2017

### VSayantan

$$\mathbb P {e^{\mathbb D}} {\mathbb P}^{-1}=\begin {pmatrix} \cosh {\frac {\pi}{4}}&0&0&\sinh {\frac {\pi}{4}}\\ 0&\cosh {\frac {\pi}{4}}&\sinh {\frac {\pi}{4}}&0\\ 0&\sinh {\frac {\pi}{4}}&\cosh {\frac {\pi}{4}}&0\\ \sinh {\frac {\pi}{4}}&0&0&\cosh {\frac {\pi}{4}} \end {pmatrix}$$

So, I just take its $trace$?
That's all?

6. Dec 1, 2017

### Ray Vickson

Yes, but that is doing it the hard way. An often-easier approach is to note that if the eigenvalues of a $4 \times 4$ matrix $B$ are $r_1, r_1, r_2, r_2$ the general form of $f(B)$ for an analytic function $f(\cdot)$ is
$$f(B) = E_0 f(r_1) + E_1 f^{\prime}(r_1) + F_0 f(r_2) + F_1 f^{\prime}(r_2) \hspace{3ex}(1)$$
for some fixed matrices $E_0,E_1,F_0,F_1$ that are the same for any function $f$. Here, I take
$$B = \pmatrix{0 & 0 & 0 & 1\\0 & 0 & 1 &0\\0 &1 & 0 & 0 \\ 1 & 0 & 0 & 0},$$
so that we want to know $f(B) = \exp( \pi/4 \: B)$.

We can determine these matrices just by using equation (1) on the four functions $f_0(x) = 1 \Rightarrow f_0(B) = I$, $f_1(x) = x \Rightarrow f_1(B) = B$, $f_2(x) = x^2 \Rightarrow f_2(B) = B^2$ and $f_3(x) = x^3 \Rightarrow f_3(B) = B^3$. In this case you have $r_1 = 1$ and $r_2 = -1$, so that gives four equations:
$$\begin{array}{ccl} I &=& E_0 + F_0\\ B &=& E_0+E_1 -F_0 + F_1 \\ B^2 &=& E_0 + 2 E_1 + F_0 - 2 F_1 \\ B^3 &=& E_0 + 3 E_1 - F_0 + 3 F_1 \end{array}$$
You can solve these, and then get
$$e^{\pi/4 \: B} = E_0 e^{\pi/4} + (\pi/4) E_1 e^{\pi/4} + F_0 e^{-\pi/4} - (\pi/4) F_1 e^{-\pi/4},$$
so that
$$\text{trace} \left(e^{\pi/4 \: B}\right) = \text{trace} (E_0) e^{\pi/4} + (\pi/4) \text{trace} (E_1) e^{\pi/4} + \text{trace}(F_0) e^{-\pi/4} -(\pi/4) \text{trace}(F_1) e^{-\pi/4}$$

Last edited: Dec 1, 2017