Computing the logarithm of an exponentiated matrix?

Let $\mathfrak{g} \subseteq \mathfrak{su}(n)$ be a linear Lie algebra represented by skew-symmetric $n\times n$ matrices. Let $C \in SU(n)$ be a special unitary matrix where it is known that $C = exp\{G\}$ for some $G \in \mathfrak{g}$.

Given $C$ and a basis $\{G_k\}$ for $\mathfrak{g}$, suppose we wish to find a matrix $G$ expressed in terms of its real basis coefficients $\vec{a}$:

$$G = \sum a_k G_k$$

such that $C = \exp\{ G\}$.

If more than one such matrix exists, we wish to find the one where $\sum |a_k|^2$ is minimized.

I know that if we diagonalize $C = P^{-1}\Lambda P$ where $$\Lambda = \left( {\begin{array}{*{20}{c}} {{\lambda _1}}&{}&{}\\ {}& \ddots &{}\\ {}&{}&{{\lambda _n}} \end{array}} \right)$$

then is suffices to find the vector $\vec{a}$ and set of integers $\{z_k\}$ such that

$$\sum a_k PG_kP^{-1} = \left( {\begin{array}{*{20}{c}} {\log {\lambda _1}}&{}&{}\\ {}& \ddots &{}\\ {}&{}&{\log {\lambda _n}} \end{array}} \right) + 2\pi i\left( {\begin{array}{*{20}{c}} {{z_1}}&{}&{}\\ {}& \ddots &{}\\ {}&{}&{{z_n}} \end{array}} \right)$$

where $\log \lambda$ is the (imaginary) principle log of $\lambda$.

But while it's possible to iterate through guesses for the $z$'s, checking to see whether the equation is solvable, this is a terribly inefficient way of solving the problem.

Is there a faster, more scalable way to find $\vec{a}$ for a given $C$? Does this problem have a name?

• Why is it important that you work in some fixed basis of $\mathfrak{g}$? If $C = PDP^{-1}$ then $\log C = P (\log D) P^{-1}$ (meaning, every possible value of $\log D$ has the property that $P (\log D) P^{-1}$ exponentiates to $C$), so you don't need to find anything once you've diagonalized $C$. – Qiaochu Yuan Jan 15 '18 at 22:28
• @QiaochuYuan: This is part of a longer procedure where the $G$ matrix is used to compute a cost, and must be in $\mathfrak{g}$. Generally speaking, $\log C$ is not in $\mathfrak{g}$. When I say "It is known that $C = \exp\{ G\}$ for some $G \in \mathfrak{g}$", I don't mean to imply that $G$ is known a priori. $C$ is generated through complex dynamics, and the existence of $G$ is guaranteed by other factors. – COTO Jan 16 '18 at 0:19
• Your last formula is valid only when the $\log(\lambda_i)$ are distinct. – loup blanc Jan 19 at 8:20
• "Skew-symmetric"->"skew-Hermitian"? – Dap Jan 19 at 9:17

We assume that the $$(\log(\lambda_i))$$ are distinct, cf. my comment above.
For every choice of the $$(a_k)_{k\leq p}$$, $$K=\sum_k a_kPG_kP^{-1}$$ is skew-hermitian. Then the main task to do is to seek the $$(a_k)$$ s.t. $$K$$ is diagonal. We must solve a homogeneous LINEAR system of $$n^2-n$$ real equations in the $$p$$ unknowns $$(a_k)$$.