Simple exponential acceleration of the power iteration algorithm

Abstract: Many real-world problems rely on finding eigenvalues and eigenvectors of a matrix. The power iteration algorithm is a simple method for determining the largest eigenvalue and associated eigenvector of a general matrix. This algorithm relies on the idea that repeated multiplication of a randomly chosen vector x by the matrix A gradually amplifies the component of the vector along the eigenvector of the largest eigenvalue of A while suppressing all other components. Unfortunately, the power iteration algorithm may demonstrate slow convergence. In this report, we demonstrate an exponential speed up in convergence of the power iteration algorithm with only a polynomial increase in computation by taking advantage of the commutativity of matrix multiplication.

\section{Introduction}
\par Eigendecomposition of matrices is useful in continuum mechanics \cite{landaulifshitz}, quantum mechanics \cite{sakurai}, machine learning \cite{pca}, graph theory \cite{spectralgraph}, and many other areas of science and mathematics.
\par The power iteration algorithm is a well-known method for determining the largest eigenvalue and its associated eigenvector of a general matrix \cite{original}. The following argument is taken from \cite{bindellecture}. Given a diagonalizable matrix $A\in \mathbb{C}^{n\times n}$, we may write
\begin{equation} \label{eq:1}
	A=U\Lambda U^{-1}
\end{equation}
\begin{equation} \label{eq:2}
	A^k=(U\Lambda U^{-1})(U\Lambda U^{-1})\cdots (U\Lambda U^{-1})=U\Lambda^kU^{-1}
\end{equation}
where the columns of $U$ are the eigenvectors $v_i$, and $\Lambda$ is diagonal with the eigenvalues $\lambda_i$ of $A$ along the diagonal. Multiplying Equation \ref{eq:2} on the right by $U$,
\begin{equation}
	A^kU=U\Lambda^k
\end{equation}
Randomly choosing a vector $x=Uy\in \mathbb{C}^n$, we may write
\begin{equation}
	A^kx=U\Lambda^ky=\lambda_1^k\left(\sum_{i=1}^nv_i\left(\frac{\lambda_i}{\lambda_1}\right)^ky_i\right)
\end{equation}
Here,  we assume that $\lambda_1$ is the largest eigenvalue of $A$, and $v_1$ is its associated eigenvector. With each factor of $A$, the components along the other eigenvectors are suppressed by a factor of $|\frac{\lambda_i}{\lambda_1}|<1$, and thus we expect $A^kx$ to become increasingly parallel to $v_1$.
\par The power iteration algorithm is usually expressed as below, where $x_0$ is drawn randomly and $f$ indicates the final value of $k$:\\
\begin{algorithm}[H]
\caption{Power Iteration}\label{alg:pi}
	\SetAlgoLined
	\LinesNumbered
	\SetKwInOut{Input}{Input}
	\Input{$A\in\mathbb{R}^{n\times n}$, tolerance $tol$}
	$x_0\in\mathbb{R}^n$\\
	$k\leftarrow 0$\\
	\SetKwRepeat{Do}{do}{while}
	\Do{$|x_{k+1}-x_{k}|>tol$}{
		$x_{k+1}\leftarrow \left(Ax_{k}\right)/\left(|Ax_{kz}|\right)$\\
		$k\leftarrow k+1$}
	\Return $(x_{f}^\dagger Ax_{f})/(x_{f}^\dagger x_{f})$ and $x_f$\\
	\SetKwInOut{Output}{Output}
	\Output{Rayleigh quotient estimate of the largest eigenvalue $\lambda$, estimated eigenvector $x$}
\end{algorithm}
However, there is a well-known algorithm for the computation of high powers of a matrix: exponentiation through squaring. Without loss of generality, we assume that $k=2^j, j\in \mathbb{N}$. $f$ again indicates the final value of $i$.\\
\begin{algorithm}[H]
	\caption{Matrix exponentiation through squaring}\label{alg:exp}
	\SetAlgoLined
	\LinesNumbered
	\SetKwInOut{Input}{Input}
	\Input{$A\in\mathbb{R}^{n\times n}$, desired power $k=2^j$}
	$A_0\leftarrow A$\\
	$i\leftarrow 0$\\
	\SetKwRepeat{Do}{do}{while}
	\Do{$i\leq j$}{
		$A_{i+1}\leftarrow A_i\cdot A_i$\\$i\leftarrow i+1$}
	\Return $A_i$
	\SetKwInOut{Output}{Output}
	\Output{$A_f=A^k$}
\end{algorithm}
\section{Material and Methods}
\subsection{Proposed algorithms}
We propose an algorithm which combines Algorithms \ref{alg:pi} and \ref{alg:exp} to achieve exponential convergence of the largest eigenvalue:\\
\begin{algorithm}[H]
	\caption{Power iteration with exponentiation}\label{alg:pie}
	\SetAlgoLined
	\LinesNumbered
	\SetKwInOut{Input}{Input}
	\Input{$A\in\mathbb{R}^{n\times n}$, tolerance $tol$}
	$x_0\in\mathbb{R}^n$\\
	$A_0\leftarrow A$\\
	$i\leftarrow 0$\\
	\SetKwRepeat{Do}{do}{while}
	\Do{$|A_{i+1}-A_{i}|>tol$}{
		$A_{i+1}\leftarrow A_i\cdot A_i$\\$A_{i+1}\leftarrow A_{i+1}/|A_{i+1}|$\\$i\leftarrow i+1$}
	$x_f\leftarrow A_fx_0$\\
	\SetKwInOut{Output}{Output}
	\Return $(x_{f}^\dagger A_0x_{f})/(x_{f}^\dagger x_{f})$ and $x_f$\\
	\Output{Rayleigh quotient estimate of the largest eigenvalue $\lambda$, estimated eigenvector $x$}
\end{algorithm}
\par To generalize Algorithms \ref{alg:pi} and \ref{alg:pie} to the problem of finding the largest $k$ eigenvectors in the case of a self-adjoint (Hermitian) matrix, we may perform a version of Gram-Schmidt orthonormalization carried out on the input matrix $A$, as shown in Algorithm \ref{alg:gs}.\\
\begin{algorithm}[H]
	\caption{Gram-Schmidt Orthonormalization}\label{alg:gs}
	\SetAlgoLined
	\LinesNumbered
	\SetKwInOut{Input}{Input}
	\Input{$A\in\mathbb{R}^{n\times n}$, desired number of largest eigenvalues $k$}
	$A_0\leftarrow A$\\
	$i\leftarrow 0$\\
	$B\leftarrow\{e_i\}$\\
	$\Lambda\leftarrow [\ ]$\\
	\SetKwRepeat{Do}{do}{while}
	\Do{$i\leq k$}{
		$\lambda, v\leftarrow \text{PowerIteration}(A_i)$\\
		Append $\lambda$ to $\Lambda$\\
		$e_i\leftarrow v/|v|$\\
		$j\leftarrow 0$\\
		$A_{i+1}\leftarrow A_{i}-\lambda e_ie_i^\dagger$
	}
	\Return $B$, $\Lambda$\\
	\SetKwInOut{Output}{Output}
	\Output{The largest $k$ eigenvectors and eigenvalues of $A$}
\end{algorithm}
To demonstrate Algorithm \ref{alg:gs}, assume we have computed the largest eigenvalue and eigenvector of $A$ in line 6 of Algorithm \ref{alg:gs} (by using either Algorithm \ref{alg:pi} or \ref{alg:pie}). After normalizing the eigenvector (line 8), Then we can remove that component from the matrix $A$ in line 10
\begin{equation} \label{eq:4}
	(A-\lambda_1v_1v_1^\dagger)v_1=\lambda_1v_1-\lambda_1v_1(v_1^\dagger v_1)=0
\end{equation}
Thus $v_1$ now has eigenvalue $0$ for the matrix $A-\lambda_1v_1v_1^T$. Because we have the additional assumption that $A$ is self-adjoint ($A=A^\dagger$), its eigendecomposition is guaranteed to be unitary, by the finite-dimensional spectral theorem \cite{st}. Therefore, the Gram-Schmidt process works since at each step, we do not change the span of the remaining eigenvectors.
\subsection{Implementation and computational resources}
\par We implemented these algorithms and visualized results in Python 3.8 \cite{python}, used the NumPy 1.19 package for linear algebra as reference \cite{numpy}, and created figures with Matplotlib 3.4 \cite{matplotlib}. The code is included in the supplemental data (\verb|*.py|). Matrices of various dimensions were generated randomly with entries drawn from the normal distribution (mean 0, standard deviation 1) and symmetrized, to guarantee real eigenvalues and eigenvectors in the case of real matrices. The largest eigenvalue of each matrix was computed using the NumPy linear algebra library (\verb|numpy.linalg.eigvals|). The matrix norms in Algorithms \ref{alg:pi} line 4 and Algorithm  \ref{alg:pie} line 6 are necessary to prevent numerical overflow, but are otherwise arbitrary, so we chose the efficient max norm (maximum matrix element).
\par We recorded the computation time and the number of iterations of Algorithms \ref{alg:pi} and \ref{alg:pie} required to reach a numerical tolerance of $10^{-10}$. Calculations were performed on 12 cores of an AMD Ryzen 9 3900X CPU, with 64 GB of RAM available, allowing for parallelized matrix-matrix and matrix-vector multiplication through the NumPy library.
\section{Results}
We observed significant speedups in using Algorithm \ref{alg:pie} as compared to Algorithm \ref{alg:pi} for both real and complex matrices, shown in Tables 1 and 2\footnote{Table 1 corresponds to the file \verb|test.py| and Table 2  to \verb*|testcomplex.py|.}. We also observed that it took far fewer iterations to reach numerical convergence using Algorithm \ref{alg:pie} compared to Algorithm \ref{alg:pi}. We observed several instances in which it took Algorithm \ref{alg:pi} over $10^6$ iterations to reach the desired tolerance, which would occasionally significantly skewed the timings ($n=100$, 300 matrices taking almost 60 s to complete). In contrast, Algorithm \ref{alg:pie} consistently reached convergence within 20 iterations, shown in Figure 1.
\begin{center}
\begin{table}[h]
	\centering
	\label{table:bench}
	\caption{Benchmarking results (real matrices)}
	\begin{tabular}{|l|l|l|l|l|}
		\hline&
		$n=100$ (300 matrices) &
		$n=1000$ (5 matrices) &
		$n=3000$ (1 matrix) &
		$n=5000$ (1 matrix) \\
		\hline
		Alg 1 &
		35 s (117 ms/matrix) &
		29 s (5.8 s/matrix) &
		59 s &
		110 s \\
		Alg 3 &
		0.54 s (1.8 ms/matrix) &
		0.77 s (153 ms/matrix) &
		2.8 s &
		9.7 s \\\hline
		speedup & 65$\times$ & 36$\times$ & 21$\times$ & 11$\times$\\
		\hline
	\end{tabular}
\end{table}
\end{center}
\begin{center}
	\begin{table}[h]
		\centering
		\label{table:bench2}
		\caption{Benchmarking results (complex matrices)}
		\begin{tabular}{|l|l|l|l|l|}
			\hline&
			$n=100$ (300 matrices) &
			$n=1000$ (5 matrices) &
			$n=3000$ (1 matrix) &
			$n=5000$ (1 matrix) \\
			\hline
			Alg 1 &
			67 s (223 ms/matrix) &
			69 s (14 s/matrix) &
			175 s &
			359 s \\
			Alg 3 &
			1.38 s (4.6 ms/matrix) &
			7.3 s (1.5 s/matrix) &
			25 s &
			95 s \\\hline
			speedup & 49$\times$ & 9.5$\times$ & 7$\times$ & 3.8$\times$\\
			\hline
		\end{tabular}
	\end{table}
\end{center}
Even though Algorithm \ref{alg:pie} was written in Python whereas NumPy code executes highly optimized LAPACK routines for eigendecomposition, we also observed that Algorithm \ref{alg:pie} (taken advantage of LAPACK matrix multiplication) is faster than NumPy's \verb|numpy.linalg.eigvals| when we desire only the largest eigenvalue (3$\times$ speed up on three hundred $100\times 100$ matrices). It may be beneficial to write a version of Algorithm \ref{alg:pie} in a lower level language like C or Fortran to perform a more direct comparison.
\section{Discussion}
Algorithm \ref{alg:pie} computes a high (normalized) power of $A$, which is used to project $x_0$ to $x_f$, which as mentioned in the introduction should be close to $v_1$. Crucially, although naive multiplication of $n\times n$ matrices in line 5 of Algorithm \ref{alg:pie} takes $O(n^3)$ time, the powers $\left(\frac{\lambda_i}{\lambda_1}\right)^k$ take $O(\lg k)$ steps to compute and thus there is an exponential increase in accuracy with each matrix multiplication performed. Overall, Algorithm \ref{alg:pie} takes $O(n^3\lg k)$ time, using naive matrix multiplication. In contrast, Algorithm \ref{alg:pi} takes $O(k)$ steps to compute $\left(\frac{\lambda_i}{\lambda_1}\right)^k$, and thus $O(n^2 k)$ time. Thus there is a tradeoff between the cost of matrix multiplication and desired accuracy, in which Algorithm \ref{alg:pie} appears to be more performant in moderately-sized practical computations ($n=100$).
\par Just as in the traditional power iteration algorithm, Algorithm \ref{alg:pie} relies on the choice of an appropriate $x_0$. Random choice of $x_0$ should prevent the degenerate case of $x_0$ orthogonal to $v_1$ except in rare cases. Algorithm \ref{alg:pie} may also be more efficient with sparse matrices, as the cost of $O(n^3)$ matrix-matrix multiplication may be greatly reduced, though further benchmarking is required to compare with sparse applications of Algorithm \ref{alg:pie}. For other applications, the throughput of GPU-accelerated matrix-matrix multiplication may further equalize the performance of matrix-matrix multiplication in Algorithm \ref{alg:pie} compared to the matrix-vector multiplication in Algorithm \ref{alg:pi}.
\par The major drawback of Algorithm \ref{alg:pie} is the same as in traditional power iteration: only the largest eigenvalue and associated eigenvector are computed. Other iterative methods such as the Lanczos algorithm \cite{lanczosorig, lanczos} and inverse iteration \cite{inverseit} may compute other eigenvalues. It may also be possible to incorporate Algorithm \ref{alg:exp} into these iterative methods to speed up convergence. We also provided a method for computing the $k$ largest eigenvalues and associated eigenvectors in Algorithm \ref{alg:gs} when applied to self-adjoint matrices, which we observed to work for small values of $k$ (see provided code). Algorithm \ref{alg:gs}\footnote{Toy code is shown in \verb|eigenbasis.py|.} may be able to compete with other iterative methods for small $k$ and large $n$, though benchmarking is needed.
\par Even with its drawbacks, Algorithm \ref{alg:pie} may have practical uses. The largest eigenvalue and associated eigenvector can be highly informative, for example in the graph similarity score (Equation 5) of Zager and Verghese \cite{graphsim}. There may be other specific use cases where Algorithm \ref{alg:pie} is preferred over the full eigendecomposition.
\par To our knowledge, our proposed modification to power iteration has not been reported in the literature. Work by Shi and Petrovic to improve power iteration convergence relies on incorporating information about the second eigenvalue, but does not demonstrate the exponential speed of our Algorithm \ref{alg:pie} \cite{modpi}.
\begin{figure}[h]
	\label{fig:first}
	\caption{Histogram of number of iterations needed to reach convergence ($n=100$, 300 matrices). A: real matrices, Algorithm \ref{alg:pi}. B: real matrices, Algorithm \ref{alg:pie}. C: complex matrices, Algorithm \ref{alg:pi}. D: complex matrices, Algorithm \ref{alg:pie}. The distribution of $\log_2$ iterations for convergence in Algorithm \ref{alg:pi} is similar to linear scale for iterations of Algorithm \ref{alg:pie}. Algorithm \ref{alg:pie} reaches convergence within 20 iterations due to the exponential growth of its accuracy. There is long tail to the right in the execution times of both algorithms, which is greatly exaggerated when performing naive power iteration, leading to slow and unpredictable convergence when using Algorithm \ref{alg:pi}.}
	\includegraphics[width=\linewidth]{composite.pdf}
\end{figure}
\section{Conclusions}
Modifying the power iteration algorithm to take advantage of matrix exponentiation by squaring produces a fast, practical, and robust method of determining the largest eigenvalue and its associated eigenvector for matrices. Our Algorithm \ref{alg:pie} outperforms traditional power iteration in convergence rate and speed on a variety of matrix sizes. We recommend Algorithm \ref{alg:pie} as a drop-in replacement for power iteration due to its favorable performance and simple implementation.
\section{Competing interests}
The authors have no competing interests to disclose.
\section{Funding}
We acknowledge support from the National Institutes for Health (R35 GM134864), National Science Foundation (2040667) and the Passan Foundation. This project is also funded, in part, under a grant with the Pennsylvania Department of Health using Tobacco CURE Funds. The Department specifically disclaims responsibility for any analyses, interpretations or conclusions.
\pagebreak
\bibliographystyle{ieeetr}

Numerical Analysis (math.NA); Disordered Systems and Neural Networks (cond-mat.dis-nn)


Homogeneous surfaces admitting invariant connections

Abstract: We compute all the simply connected homogeneous and infinitesimally homogeneous surfaces admitting one or more invariant affine connections. We find exactly six non equivalent simply connected homogeneous surfaces admitting more than one invariant connections and four classes of simply connected homogeneous surfaces admitting exactly one invariant connection.

\section{Introduction}

From the XIXth century on geometry has been understood by means of its transformation groups. An \emph{homogeneous} space $M$ is a smooth manifold endowed with a \emph{transitive smooth action} of a Lie group $G$. In particular, if $H$ is the stabilizer subgroup of a point $x\in M$ then the space $M$ can be recovered as the coset space $G/H$.  Since the group $G$ acting in $M$ is seen as a transformation group, i.e., a subgroup of ${\rm Diff}(M)$ there is no loss of generality in assuming, whenever it is required, that the action of $G$ in $M$ is faithful.

The notion of homogeneous space has an infinitesimal version. A \emph{infinitesimal homogeneous space} is a manifold endowed with a \emph{Lie algebra representation} of a Lie algebra $\mathfrak g$ into the Lie algebra of smooth vector fields $\mathfrak X(M)$. As before, since the lie Lie algebra $\mathfrak g$ is seen as a Lie algebra of vector fields, there is no loss of generality in assuming, whenever it is required, that the representation is faithful.

The heuristics of the celebrated F. Klein's \emph{Erlangen program} is that geometry should studied through the invariants of the action of $G$ on $M$. As example, the invariants of the group of euclidean movements in the euclidean space are the distances, volumes, angles, etc.

An \emph{affine connection} in a manifold $M$ is certain geometric construction that allows a notion of parallel transport of vectors. Affine connections are a kind of geometric structures, and then they are transformed covariantly by diffeomorphisms. The problem of construction of invariant connections in an homogeneous space has been treated by S. Kobayashi and K. Nomizu in a series of papers that are summarized in \cite{kobayashi1996foundations2} chapter X. In several examples of homogeneous spaces, there is a unique invariant connection.

We ask the following question.  Which homogeneous spaces of a fixed dimension do admit exactly one, or strictly more than one invariant connections? It is possible to give a complete list? We can solve this problem for low dimension manifolds. We start with the local problem, for infinitesimal homogeneous spaces. The point is that the structures of infinitesimal homogeneous spaces admitted by a surface are completely classified. S. Lie, who completed in \cite{Lie} the task for Lie algebras of analytic vector fields in $\mathbb C^2$ and $\mathbb C^3$. The local classification of finite dimensional Lie algebras of smooth vector fields in $\mathbb R^2$ was completed by González-López, Kamran and Olver in \cite{Olver}. The real list is larger than the complex one as some complex Lie algebra may have several possible real forms. A completely different approach leading to the same classifications was followed by Komrakov, Churyumov and Doubrov in \cite{komrakov}.
By means of the Lie derivative of connections (Definition \ref{df:LD_connection} and Lemma \ref{lm:Lie_connection_zero}) we compute the space of invariant connections by an infinitesimal action of Lie algebra. Then,
we go through the list of all possible structures of infinitesimal homogeneous surfaces (Tables \ref{tabla:acciones primitivas}, \ref{tabla:acciones no transitivas}, \ref{tabla:imprimitive actions}) obtaining the spaces of invariant connection for each local class of infinitesimal actions (Theorems \ref{th:primitive} and \ref{th:imprimitive}). We also perform the computation of the space of invariant connections for non-transitive actions, for the shake of completeness (Propositions \ref{pr:no_transitive1} and \ref{pr:no_transitive2}). Finally we integrate our results to obtain homogeneous surfaces admitting invariant connections. We obtain that there is a finite list of simply connected homogeneous surfaces admitting invariant connections. In particular there are $6$ non-equivalent simply connected homogeneous surfaces admitting more than one invariant connection. Our main results are the following:

\medskip

\noindent{\bf Theorem \ref{th:hs}} \emph{
Let $M$, endowed with an action of a connected Lie group $G$, be a simply connected homogeneous surface. Let us assume that $M$ admits at least two $G$-invariant connections. Then, $M$ is equivalent to one of the following cases:
\begin{enumerate}
\item[(a)] The affine plane $\mathbb R^2$ with one of the following transitive groups of affine transformations:
$${\rm Res}_{(2:1)}(\mathbb R^2) = \left\{ \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} \lambda^2 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\},$$
$${\rm Trans}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right] \mid b_1,b_2\in\mathbb R \right\},$$
$${\rm Res}_{(0:1)}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} 1 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\}.$$
\item[(b)] ${\rm SL}_2(\mathbb R)/U$ where $U$ is the subgroup of superior unipotent matrices
$$ U = \left\{ A\in {\rm SL}_2(\mathbb R) \mid A =
\left[ \begin{array}{cc} 1 & \lambda \\ 0 & 1 \end{array} \right]
\right\}.$$
\item[(c)] $\mathbb R\ltimes \mathbb R$ acting on itself by left translations.
\item[(d)] $G/H$ with $G = \mathbb R^2\ltimes \mathbb R$ and $H = (\mathbb R\times 0)\ltimes 0$.
\end{enumerate}
}

\medskip

\noindent{\bf Theorem \ref{th:hs2}} \emph{
Let $M$, with the action of $G$, be a simply connected homogeneous surface. Let us assume that $M$ admits exactly one $G$-invariant connection. Then, $M$ is equivalent to one of the following cases:
\begin{enumerate}
\item[(a)] The affine plane $\mathbb R^2$ with $G$ any connected transitive subgroup of the group ${\rm Aff}(\mathbb R^2)$ of affine transformations containing the group of translations and not conjugated with any of the groups,
$${\rm Res}_{(2:1)}(\mathbb R^2) = \left\{ \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} \lambda^2 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\},$$
$${\rm Trans}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right] \mid b_1,b_2\in\mathbb R \right\},$$
$${\rm Res}_{(0:1)}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} 1 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\}.$$
(this case includes the euclidean plane)
\item[(b)] ${\rm SL}_2(\mathbb R)/H$ where $H$ is the group of special diagonal matrices,
$$H = \left\{ A \in {\rm SL}_{2}(\mathbb R) \mid
A =  \left[ \begin{array}{cc} \lambda & 0 \\ 0 & \lambda^{-1} \end{array} \right], \,\, \lambda>0 \right\}.$$
\item[(c)] The hyperbolic plane
$$\mathbb H = \{z\in\mathbb C \mid {\rm Im}(z)>0 \}$$
with the group ${\rm SL}_2(\mathbb R)$ of hyperbolic rotations.
\item[(d)] Spherical surface,
$$S^2 = \{(x,y,z)\in \mathbb R^3\mid x^2 + y^2 + z^2 =1 \}$$
with its group ${\rm SO}_3(\mathbb R)$ of rotations.
\end{enumerate}
}

\medskip

Some related work has been presented by Kowalski, Opozda, Vl\'a\v{s}ek and Arias-Marco \cite{kowalski2008, kowalski2004, opozda2004} who gave answer to a dual question in the local case: what are the local canonical forms of affine connections in surfaces whose symmetries act transitively? Their methods are similar to ours in the following sense: their results and ours are obtained through a careful analysis of the local classification of Lie algebra actions given in \cite{Olver}.

\section{Invariant connections}

Here we review the construction of the space of connections, the bundle of connections, and the action of diffeomorphisms and vector fields on them, see for instance \cite{castrillon, garcia}. Let $M$ be a smooth manifold, $\mathfrak X(M)$ the Lie algebra of smooth vector fields in $M$ and ${\rm End}_M(\mathfrak X(M))$ the module of $\mathcal C^{\infty}(M)$-linear endomorphisms of $\mathfrak X(M)$. An \emph{affine connection} in $M$ is a $\mathbb R$-linear map
$$\nabla \colon \mathfrak X(M)\to {\rm End}_M(\mathfrak X(M)),$$
such that $\nabla(fX) = df\otimes X + f\nabla X$.\footnote{In order to keep the usual notation for covariant derivatives we have $\nabla(X)(Y) = \nabla_Y X$.}
Let ${\rm Cnx}(M)$ the space of all affine connections in $M$. It is easy to check that if $\nabla\in {\rm Cnx}(M)$ is an affine connection and $\theta\in \Omega^1(M,{\rm End}(TM))$ is a $1$-form in $M$ with values endomorphisms of $TM$ then $\nabla+\theta$ is an affine connection in $M$. Indeed, the difference between two connections in a $1$-form with values endomorphisms of $TM$. Therefore, we have a free and transitive additive action,
$$\Omega^1(M,{\rm End}(TM))\times {\rm Cnx}(M) \to {\rm Cnx}(M),\quad
(\theta,\nabla)\to \nabla + \theta,$$
that gives to ${\rm Cnx}(M)$ the structure of an affine space modeled over the vector space $\Omega^1(M,{\rm End}(TM))$

It is clear the connections are local objects, they can be restricted to open subsets of $M$, and they are determined by its restrictions to a covering family of open subsets. The following construction is local.
Given a global frame\footnote{That is, and ordered base of sections of the tangent bundle of $M$.} $s = (X_1,\ldots,X_n)$ in $M$ there is an associated connection $\nabla^s$ such that $\nabla^s(X_i)=0$ for $i\in \{1,\ldots,n\}$.
We taking $\nabla^s$ as the initial point of ${\rm Cnx}(M)$ we have an identification,
$$\Gamma_s \colon {\rm Cnx}(M) \xrightarrow{\sim} \Omega^1(M,{\rm End}(TM)), \quad \nabla \mapsto \Gamma_s(\nabla) = \nabla - \nabla^s.$$
Here $\Gamma_s(\nabla)$ is the so-called Christoffel tensor of $\nabla$ with respect to the frame $s$. We say that two connections $\nabla$ and $\bar\nabla$ take the same value at the point $p$ of $M$ if their Christofell tensors with respect to any frame coincide on $p$. The set $CM$ of the values at points of $M$ of affine connections is therefore an affine bundle over $M$ modeled over $T^*M\otimes {\rm End}(TM)$. An affine connection $\nabla$ is thus seen in a canonical way as a global section of the affine bundle $CM\to M$.

Given a diffeomorphism $f\colon M\to N$ the push forward of connections is an isomorphism $f_*\colon {\rm Cnx}(M)\to {\rm Cnx}(N)$ defined in terms of the push forward of vector fields by $(f_*\nabla)_XY = f_*(\nabla_{f^{-1}_*X} f^{-1}_*Y)$. The push forward of connections is compatible with the affine structure, in the sense that $f_*(\nabla + \theta) = f_*(\nabla) + f_*(\theta)$ for a connection $\nabla$ and a $1$-form of endomorphisms $\theta$.

If we look at the connections as sections of the affine bundle $CM$, then we have that the push forward is given by a natural transformation $Cf$ of affine bundles,
\begin{equation}\label{eq:diagrama1}
\xymatrix{ CM\ar[d] \ar[r]^-{Cf} & CN \ar[d] \\
M \ar[r]^-{f} \ar@/^20pt/[u]^-{\nabla} & N \ar@/^-20pt/[u]_-{f_*\nabla}}
\end{equation}
here $(Cf)(\nabla(p)) = (f_*\nabla)(f(p))$.

Let us fix an smooth action\footnote{By convention, we consider the action on the left side, we use the standard notation $gp = L_g(p)$.} of a Lie group $G$ on $M$. A tensor $\theta$ is $G$-invariant if $(L_g)_*\theta = \theta$ for all $g$ in $G$. The space of $G$-invariant $1$-forms of endomorphisms is denoted by $\Omega^1(M,{\rm End}(TM))^G$. Analogously, we say that a connection $\nabla\in{\rm Cnx}(M)$ is $G$-invariant if $(L_g)_*\nabla=\nabla$, for all $g\in G$; we denote by ${\rm Cnx}(M)^G$ the set of $G$-invariant connections in $M$. It is clear that the sum of a $G$-invariant connection and a $G$-invariant $1$-form of endomorphisms yields a $G$-invariant connection. So that, ${\rm Cnx}(TM)^G$ is either empty or an a affine space modeled over the space  $\Omega^1(M,\textrm{End}(TM))^G$.

Let us denote by $G_p$ the stabilizer\footnote{That is, the subgroup of $G$ formed by the elements $g\in G$ such that $gp = p$.} of a point $p\in M$. We have an action of $G_p$ on the fiber $(CM)_p$ by affine transformations.
There is also a natural linear representation of $G_p$ in $T_p^*M \otimes {\rm End}(T_pM)$.

\begin{proposition}\label{pr:inv1}
 If $G$ acts transitively on $M$ then ${\rm Cnx}(M)^G$ has finite real dimension $\leq (\dim M)^3$. In such case:
 \begin{enumerate}
     \item ${\rm Cnx}(M)^G \simeq (CM)_p^{G_p}$ for any $p\in M$
     \item If ${\rm Cnx}(M)^G\neq \emptyset$ then
     $\dim {\rm Cnx}(M)^G = \dim \left(T_p^*M \otimes {\rm End}(T_pM)\right)^{G_p}$.
 \end{enumerate}
\end{proposition}

\begin{proof}
(1) There is a natural map ${\rm Cnx}(M)\to (CM)_p$ of evaluation at $p$, $\nabla\mapsto \nabla(p)$. It is clear that it maps ${\rm Cnx}(M)^G$ on $(CM)_p^G$. By the action of $G$ on $M$ we construct an inverse map,
$$(CM)_p^G \xrightarrow{\,\sim\,} {\rm Cnx}(M), \quad c_p\mapsto \nabla$$
where $\nabla$ is defined as $\nabla(gp) = C(L_g)(c_p)$.

(2) It is also clear that if $(CM)_p$ is a linear affine space modeled over $T_p^*M \otimes {\rm End}(T_pM)$. The action of $G_p$ is compatible with the affine structure, therefore $(CM)_p^G$, if not empty, is a linear affine space modeled over $(T_p^*M \otimes {\rm End}(T_pM))^{G_p}$.
\end{proof}

The previous situation can be considered infinitesimally. Let us recall that an action of a Lie algebra $\g$ in $M$ is a Lie algebra morphism  $\phi:\g \to \mathfrak{X}(M)$. Without loss of generality we may assume that the action is faithful, that is, that $\phi$ is inyective. In such case we see $\mathfrak g\subset\mathfrak X(M)$ as a Lie algebra of vector fields in $M$. Therefore, from now on we will consider the elements of $\mathfrak g$ as vector fields in $M$.

We say that a tensor $\theta$ in $M$ is $\mathfrak g$-invariant if for any local diffeomorphism $\sigma \colon U\xrightarrow{\sim} V$ that belongs to the flow pseudogroup of a vector field $X\in \mathfrak g$ we have $\sigma_*(\theta)|_{V} = \theta|_{V}$. The analogous definition of $\mathfrak g$-invariance applies to connections. As before, the space of $\mathfrak g$-invariant connections ${\rm Cnx}(M)^{\mathfrak g}$ is either empty of an affine space modeled over $\Omega^1(M,\textrm{End}(T(M)))^{\mathfrak g}$.

Let us recall that the $\mathfrak g$ acts transitively on $M$ if for all $p\in M$ the map $\phi_p\colon \mathfrak g\to T_pM$ $X\mapsto X_p$ is surjective. This implies that, for connected $M$, the flow pseudogroup of the action is also transitive.

Diagram \eqref{eq:diagrama1} in the particular case of $f = \sigma_t$, the time $t$ flow of a vector field $X$ in $M$, gives us the prolongation $\tilde X\in \mathfrak X(CM)$,
$$\tilde X = \left.\frac{d}{dt}\right|_{t=0}C\sigma_t.$$
It is clear that $\tilde X$ projects onto $X$ and the flow of $\tilde X$ gives affine transformations between the fibers of $CM\to M$. For a given $p\in M$ the kernel $\ker(\phi_p) = \mathfrak g_p$ is the so-called \emph{stabilizer algebra} of the point $p$. There is a natural representation,
$$\tilde \phi|_{CM_p}\colon \mathfrak g_p \to \mathfrak X(CM_p)$$
the set of zeroes in $CM_p$ of these vector fields is an affine subspace denoted $CM_p^{\mathfrak g_p}$.

\begin{proposition}\label{prop:finitedim_inf}
Let us assume that $\mathfrak g$ acts transitively in a connected manifold $M$. Then the space ${\rm Cnx}(M)^{\g}$ has finite real dimension. In such case
${\rm Cnx}(M)^{\g} \simeq  CM_p^{\mathfrak g_p}$ for any $p\in M$.
\end{proposition}

\begin{proof}
It is a consequence of the same argument we exposed in Proposition \ref{pr:inv1}, but in this case we use the flow pseudogroup of $\mathfrak g$ instead of the Lie group $G$.
\end{proof}

Let us recall that given an action of $G$ in $M$ there is an associated infinitesimal action of ${\rm Lie}(G)$ given by,
$$\phi(A)_p = \left.\frac{d}{dt}\right|_{t=0} \exp(tA)\star p.$$
There is a natural relation between the invariants of an action and that of its associated infinitesimal action. In particular, for invariant connections, we have that if $G$ is a connected Lie group acting on $M$ then ${\rm Cnx}(M)^G$ $=$ ${\rm Cnx}(M)^{{\rm Lie}(G)}$.

\subsection{Lie derivative of a connection}

In this section we develop a method for computing the invariant connections of an infinitesimal action. The well known notion of Lie derivative for tensors can be extended to sections of natural bundles as in \cite{Kolar}. In the particular case of connections, it can be defined by as follows.

\begin{definition}\label{df:LD_connection}
The Lie derivative of a connection $\nabla$ in the direction of a field $X$ is defined as:
$$
\mathcal{L}_X\nabla = \lim_{t\to 0} \frac{\sigma_{-t*}\nabla - \nabla}{t},
$$
where $\{\sigma_t\}_{t\in\mathbb R}$  is the flow of the field $X.$
\end{definition}

Note that for an affine connection $\nabla$ and a vector field $X$ the Lie derivative $\mathcal L_X\nabla\in \Omega^1(M,{\rm End}(TM))$ is not a connection but a $1$-form of endomorphisms.

\begin{proposition}
The Lie derivative of $\nabla$ has the following properties:
\begin{enumerate}\label{leibniz}
    \item (Linearity) $\mathcal{L}_{fX+gY}\nabla = f(\mathcal{L}_X\nabla) + g(\mathcal{L}_Y\nabla)$.
    \item (Leibniz formula) $(\mathcal{L}_X\nabla)(Y,Z) = [X,\nabla_Y Z] - \nabla_{[X,Y]}Z - \nabla_Y[X,Z]$.
\end{enumerate}
\end{proposition}
\begin{proof}
(1) can be easily checked from the definition. Let us prove (2). Without lose of generality let us assume that $X$ is complete and $\{\sigma_t\}_{t\in\mathbb R}$ is its flow.
$$(\mathcal{L}_X\nabla)(Y,Z) = \lim_{t\to 0} \frac{\sigma_{-t*}\nabla - \nabla}{t}(Y,Z)
= \lim_{t\to 0} \frac{(\sigma_{-t*}\nabla)_YZ - \nabla_YZ}{t} = $$
$$ \lim_{t\to 0} \frac{\sigma_{-t*}(\nabla_YZ) - \nabla_YZ}{t} + \lim_{t\to 0} \frac{\sigma_{-t*}(\nabla_{\sigma_{t*}Y}\sigma_{t*}Z) - \sigma_{-t*}(\nabla_YZ)}{t} =$$
$$[X,\nabla_YZ] +  \lim_{t\to 0} \sigma_{-t*} \frac{\nabla_{\sigma_{t*}Y}\sigma_{t*}Z - \nabla_YZ}{t} = $$
$$ [X,\nabla_Y Z]+ \lim_{t\to 0} \frac{\nabla_{\sigma_{t*}Y}\sigma_{t*}Z - \nabla_Y\sigma_{t*}Z}{t} +
\lim_{t\to 0}\frac{\nabla_Y\sigma_{t*}Z - \nabla_YZ}{t} = $$
$$[X,\nabla_Y Z] + \lim_{t\to 0} \nabla_{\frac{\sigma_{*t}Y-Y}{t}} \sigma_{t*}Z + \lim_{t\to 0} \nabla_Y \frac{\sigma_{t*}Z-Z}{t}=$$
$$[X,\nabla_Y Z] - \nabla_{[X,Y]}Z - \nabla_Y[X,Z].$$
\end{proof}

\begin{lemma}\label{lm:Lie_connection_zero}
Let $X$ be a vector field in $M$
and $\nabla$ be a connection. The following are equivalent:
\begin{enumerate}
    \item $\mathcal{L}_X \nabla = 0$.
    \item $\nabla$ is invariant by the flow of $X$.
\end{enumerate}

\begin{proof}
$(2)\Rightarrow(1)$ is clear from the definition. Let us see $(1)\Rightarrow(2)$.
Without lose of generality let us assume that $X$ is complete, and let $\sigma_t$ be its time $t$ flow. Let us define $\Gamma(t) = \sigma_{t*}(\nabla)-\nabla$. By hypothesis we have $\Gamma(0) = 0$ and $\left.\frac{d}{dt}\right|_{t=0}\Gamma(t)=0$. Moreover, for any $t$,
$$\frac{d}{dt}\Gamma(t) =
\lim_{s\to 0} \frac{\Gamma(t+s) - \Gamma(t)}{s} =
\lim_{s\to 0}
\frac{\sigma_{(t+s)*}\nabla - \sigma_{t*}\nabla}{s} = \sigma_{t*}(- \mathcal{L}_X(\nabla)) = 0.$$
therefore, $\frac{d}{dt}\Gamma(t) = 0$ and thus $\Gamma(t) = 0$.
\end{proof}

\end{lemma}\label{lm:inv}
\begin{theorem}
Let us consider $\mathfrak g$  a Lie algebra of smooth vector fields in a manifold $M$. The following are equivalent:
\begin{enumerate}
    \item $\nabla$ is $\mathfrak g$-invariant.
    \item $\mathcal{L}_{A}\nabla = 0$, for all $A\in\mathfrak g$.
    \item  $\mathcal{L}_{A_i}\nabla = 0$, for all $i=1,\ldots,n$, where $\{A_1,\ldots,A_n\}$ is a system of generators of  $\mathfrak g$ as Lie algebra.
\end{enumerate}
\end{theorem}

\begin{proof}
If $\nabla$ is $\mathfrak g$-invariant, then $\sigma_{-t*}(\nabla) = \nabla$ for the flow of any vector field of the form $\phi(A)$ with $A\in\mathfrak g$. By definition of Lie derivative we have $\mathcal{L}_{A}\nabla = 0$, and $(1)\Rightarrow(2)$. We also have $(2)\Rightarrow (3)$. Finally to prove $(3)\Rightarrow (1)$ it is enough to note that, from Lemma \ref{lm:inv}, $\nabla$ is invariant with respect to the flow of the vector fields $A_i$. Thus, it is invariant with respect to any composition of these flows, and then with respect to the flow of any vector field $A\in\mathfrak g$.
\end{proof}

\begin{lemma}
Let us consider a Lie algebra $\mathfrak g$ of vector fields in an open subset
$U\subseteq \mathbb R^n$. If $\mathfrak g$ contains the translation vector field $\partial_{x_i}$ then for any $\mathfrak g$-invariant connection $\nabla$ the Christoffel symbols $\Gamma_{ij}^k$ are independt from $x_i$.
\end{lemma}
\begin{proof}
Using the Leibniz formula of \ref{leibniz} we have
$$
\left(\mathcal{L}_{\partial_{x_i}} \nabla \right)_{\partial_{x_j}} {\partial_{x_k}} = \left[\partial_{x_i},\nabla_{\partial_{x_j}}\partial_{x_k}\right] - \nabla_{\left[\partial_{x_i},\partial_{x_j}\right]}\partial_{x_k} - \nabla_{\partial_{x_j}}\left[\partial_{x_i},\partial_{x_k}\right],
$$
\noindent for $i,j, k \in \{1,2\}$. As $\left[\partial_{x_i},\partial_{x_j}\right]=0$, for any $i, j \in \{1,2\}$, the previous equality is reduced to
$$
\left(\mathcal{L}_{\partial_{x_i}} \nabla \right)_{\partial_{x_j}} {\partial_{x_k}} = \left[\partial_{x_i},\nabla_{\partial_{x_j}}\partial_{x_k}\right].
$$
If $\left[\partial_{x_i},\nabla_{\partial_{x_j}}\partial_{x_k}\right]=0$ then
$\partial_{x_i} \Gamma_{jk}^l = 0$, for $i,j,k,l \in \{1,2\}$.
\end{proof}

\begin{remark}\label{constante}
If the  Lie algebra contains all the translations  $\partial_{x_i}$, then the Christoffel symbols are constants.
Moreoever if all of them are null, the only invariant connection is the usual one.
\end{remark}

\subsection{Classification of finite dimensional Lie algebra actions on germs of surfaces}

The local classification of infinitesimal actions of finite dimensional Lie algebras in manifolds of complex dimension $2$ and $3$ was given by S. Lie in the XIX century. The real classification in dimension $2$ was completed in \cite{Olver} and  \cite{komrakov}.

In Tables \ref{tabla:acciones primitivas}, \ref{tabla:acciones no transitivas} and \ref{tabla:imprimitive actions} we reproduce\footnote{
In Tables \ref{tabla:acciones primitivas},  \ref{tabla:acciones no transitivas} and \ref{tabla:imprimitive actions} we respect the numeration and cases of \cite{Olver}. However, since we diferenciate the transitive and non-transitive cases, some cases are listed in different order. This explains the gaps in the tables.
}
the results of \cite{Olver}: the local classification of  faithful actions of Lie algebras of finite dimension over opens of the real plane.

\begin{table}[ht]
\centering
\begin{tabular}{p{0.1cm} p{9cm} p{2.5cm}}
\hline
& Generators  & Structure   \\
\hline
1.& $\{\partial_x,\partial_y,\alpha(x\partial_x+y\partial_y)+y\partial_x-x\partial_y\}$, $\alpha \geqslant 0 $ &  $\mathbb{R} \ltimes \mathbb{R}^2$ \\
2.& $\{\partial_x,x\partial_x+y\partial_y,\left(x^2-y^2\right)\partial_x+2xy\partial_y\}$ & $\mathfrak{sl}(2)$ \\
3.& $\{y\partial_x-x\partial_y, (1+x^2-y^2)\partial_x+2xy\partial_y,2xy\partial_x+(1+y^2-x^2)\partial_y\}$ & $\mathfrak{so}(3)$ \\
4.& $\{\partial_x,\partial_y,x\partial_x+y\partial_y,y\partial_x-x\partial_y\}$ & $\mathbb{R}^2 \ltimes \mathbb{R}^2 $ \\
5.& $\{\partial_x, \partial_y,x\partial_x-y\partial_y, y\partial_x, x\partial_y \}$& $\mathfrak{sl}(2)\ltimes \mathbb{R}^2$  \\
6.& $\{\partial_x, \partial_y, x\partial_x, y\partial_y, x\partial_y,y\partial_y \}$& $\mathfrak{gl}(2)\ltimes \mathbb{R}^2$ \\
7.& $\{\partial_x, \partial_y, x\partial_x+y\partial_y, y\partial_x-x\partial_y, \left(x^2-y^2\right)\partial_x+2xy\partial_y, 2xy\partial_x+(y^2-x^2)\partial_y \}$& $\mathfrak{sl}(3,1)$ \\
8.& $\{\partial_x, \partial_y, x\partial_x, x\partial_y, y\partial_x, y\partial_y, x^2\partial_x+xy\partial_y, xy\partial_x+y^2\partial_y\}$& $\mathfrak{sl}(3)$ \\
\hline
\end{tabular}
\medskip
\caption{Local classification of faithful primitive actions of finite dimensional Lie algebras on the real plane \cite{Olver}.}
\label{tabla:acciones primitivas}
\end{table}

Table \ref{tabla:acciones primitivas} contains the classification of primitive actions. Let us recall that a Lie algebra action in a surface $M$ is primitive if the induced action in the projective bundle of directions in $M$, $\mathbb{P}(T_pM)$ has no fixed points. This is equivalent to say that the action is not by infinitesimal symmetries of a foliation in $M$. In physical terms, it also means that the we consider an \emph{isotropic} geometry in the surface.  Therefore, the cases 1-8 correspond to classical 2-dimensional geometries, namely:
\begin{enumerate}
\item It depends on the parameter $\alpha$. The case $\alpha=0$ corresponds to the euclidean geometry. The case $\alpha\neq 0$ correspond to a primitive subgroup of the affine transformations of the complex plane spanned by translations and the exponential of a complex number of norm different from $1$.
\item Hyperbolic transformations of the half plane.
\item  Rotations of the sphere.
\item  Affine transformations of the complex plane.
\item  Volume preserving affine  transformations of the real plane.
\item  Affine transformations of the real plane.
\item  Conformal transformations of the Riemann sphere.
\item  Projective transformations of the real plane.
\end{enumerate}

\begin{table}[ht]
\centering
\begin{tabular}{p{0.1cm} p{9cm} p{2.5cm}}
\hline
& Generators   & Structure  \\
\hline
9. & $\{\partial_x\}$ & $\mathbb{R}$\\
10.& $\{\partial_x, x\partial_x \}$ & $\mathfrak{h}_2$\\
11. & $\{\partial_x, x\partial_x, x^2\partial_x\}$& $\mathfrak{sl}(2)$\\
20. & $\{\partial_y, \xi _1(x)\partial_y,\cdots, \xi _r(x)\partial_y\}, r\geq 1$& $\mathbb{R}^{r+1}$\\
21. & $\{\partial_y, y\partial_y, \xi_1(x)\partial_y,\cdots, \xi_r(x)\partial_y\}$, con $r\geq 1$ & $\mathbb{R}\ltimes \mathbb{R}^{r+1}$\\
\hline
\end{tabular}
\medskip
\caption{Local classification of non-transitive faithful actions of finite dimensional Lie algebras in the real plane \cite{Olver}.
Functions $\xi_j$ are linearly independent. }
\label{tabla:acciones no transitivas}
\end{table}

\begin{table}[ht]
\centering
\begin{tabular}{p{0.1cm} p{9.3cm} p{2.5cm}}
\hline
& Generators   & Structure  \\
\hline
12. & $\{\partial_x, \partial_y,x\partial_x+\alpha y\partial_y\}$& $\mathbb{R} \ltimes \mathbb{R}^2$\\
13. & $\{\partial_x,\partial_y, x\partial_x, y\partial_y \}$& $\mathfrak{h}_2\oplus \mathfrak{h}_2$ \\
14. & $\{\partial_x, \partial_y, x\partial_x, x^2\partial_x\}$& $\mathfrak{gl}(2)$\\
15. & $\{\partial_x,\partial_y, x\partial_x, y\partial_y, x^2\partial_x, y^2\partial_y\}$& $\mathfrak{sl}(2)\oplus \mathfrak{sl}(2)$\\
16. & $\{\partial_x,\partial_y, x\partial_x, y\partial_y, x^2\partial_x,\}$&$\mathfrak{sl}(2)\oplus \mathfrak{h}_2$ \\
17. & $\{\partial_x+\partial_y,  x\partial_x+y\partial_y, x^2\partial_x+y^2\partial_y  \}$& $\mathfrak{sl}(2)$\\
18. & $\{\partial_x, 2x\partial_x+y\partial_y, x^2\partial_x+xy\partial_y\}$& $\mathfrak{sl}(2)$ \\
19. & $\{\partial_x, x\partial_x, y\partial_y, x^2\partial_x+xy\partial_y\}$& $\mathfrak{gl}(2)$\\
22. & $\{\partial_x, \eta_1(x)\partial_y, \cdots, \eta_r(x)\partial_y \}, r\geq 1$& $\mathbb{R}\ltimes \mathbb{R}^{r} $\\
23. & $\{\partial_x, y\partial_y, \eta_1(x)\partial_y, \cdots, \eta_r(x)\partial_y   \}, r\geq 1$& $\mathbb{R}^2\ltimes \mathbb{R}^r$\\
24. & $\{\partial_x, \partial_y, x\partial_x+\alpha y\partial_y, x\partial_y, \cdots, x^r\partial_y\}, r\geq 1$
& $\mathfrak{h}_2\ltimes \mathbb{R}^{r+1}$\\
25. & $\{\partial_x, \partial_y, x\partial_y, \cdots, x^{r-1}\partial_y, x\partial_x+\left(ry+x^r\right)\partial_y \}, r\geq 1$& $\mathbb{R} \ltimes(\mathbb{R}\ltimes \mathbb{R}^r)$\\
26. & $\{\partial_x, \partial_y, x\partial_x, x\partial_y, y\partial_y, x^2\partial_y, \cdots, x^r\partial_y \}, r\geq 1$ & $(\mathfrak{h}_2\oplus \mathbb{R})\ltimes \mathbb{R}^{r+1}$\\
27. & $\{\partial_x, \partial_y, 2x\partial_x+ry\partial_y, x\partial_y, x^2\partial_x+rxy\partial_y, x^2\partial_y, \cdots, x^r\partial_y\}, r\geq 1$& $\mathfrak{sl}(2)\ltimes \mathbb{R}^{r+1}$\\
28. & $\{\partial_x, \partial_y, x\partial_x, x\partial_y, y\partial_y, x^2\partial_x+rxy\partial_y, x^2\partial_y,\cdots, x^r\partial_y\}, r\geq 1$& $\mathfrak{gl}(2)\ltimes \mathbb{R}^{r+1}$\\
\hline
\end{tabular}
\medskip
\caption{Local classification of faithful transitive actions of finite dimensional Lie algebras on the real plane \cite{Olver}. Functions  $\eta_j$ are a base of solutions of a lineal differential equation of order $r$, with constant coefficients.
}
\label{tabla:imprimitive actions}
\end{table}

Table \ref{tabla:acciones no transitivas} contains the local classification of non transitive actions. They are, by necessity, imprimitive. Here we can find the classical one-dimensional goeometries: euclidean (case 9), affine (case 10) and projective (case 11). In such cases Proposition \ref{prop:finitedim_inf} does not apply and we will obtain infinite dimensional spaces of invariant connections. Finally, Table \ref{tabla:imprimitive actions} contains the local classification of transitive imprimitive actions.

Finally we will compute the spaces of invariant connections for lie algebra actions on connected surfaces.

\section{Invariant connections for Lie algebra actions on connected surfaces}

\subsection{Primitive Lie algebra actions}

For this classical cases, the existence of invariant connections is well known. By application of Lemma \ref{lm:inv}, we can also recover the following result.

\begin{theorem}\label{th:primitive}
Let $M$ be a connected surface endowed with faithful primitive Lie algebra action of a finite dimensional Lie algebra $\mathfrak g$ there is either one or none $\mathfrak g$-invariant connection. Moreover, only one of the following cases hold:
\begin{itemize}
\item[(a)] $\mathfrak g$ is isomorphic to a Lie sub algebra of the Lie algebra of infinitesimal affine transformations of the plane. There is one $\mathfrak g$-invariant connection; it is flat and torsion free.
\item[(b)] $\mathfrak g$ is isomorphic to the Lie algebra of infinitesimal isometries of a surface of non vanishing constant curvature. There is one $\mathfrak g$-invariant connection; it is torsion free and of constant curvature.
\item[(c)] $\mathfrak g$ is isomorphic to either the Lie algebra of infinitesimal conformal transformations of the Riemann sphere or the Lie algebra of infinitesimal projective transformations of the real plane. There are no $\mathfrak g$-invariant connections.
\end{itemize}
\end{theorem}

\begin{proof}
As in the case (1), $\partial_x$ and $\partial_y$ are in $\g$ then $\Gamma_{i,j}^k$ are constants. If we consider $X=\alpha(x\partial_x+y\partial_y)+y\partial_x-x\partial_y$. Since $\left(L_X \nabla \right)_{\partial_{x_i}}\partial_{x_j}=0$  we have the following equations:
\begin{multicols}{2}

\begin{align*}
\ \alpha \Gamma_{11}^1-\Gamma_{11}^2-\Gamma_{12}^1-\Gamma_{21}^1&=0\\
\alpha \Gamma_{11}^2+\Gamma_{11}^1-\Gamma_{12}^2-\Gamma_{21}^2&=0
\end{align*}

\begin{align*}
\alpha \Gamma_{12}^1-\Gamma_{12}^2-\Gamma_{22}^1+\Gamma_{11}^1&=0 \\
\alpha\Gamma_{12}^2+\Gamma_{12}^1-\Gamma_{22}^2+\Gamma_{11}^2&=0
\end{align*}

\begin{align*}
\alpha \Gamma_{21}^1-\Gamma_{21}^2+\Gamma_{11}^1-\Gamma_{22}^1&=0 \\
\alpha \Gamma_{21}^2+\Gamma_{21}^1+\Gamma_{11}^2-\Gamma_{22}^2&=0
\end{align*}

\begin{align*}
\alpha \Gamma_{22}^1-\Gamma_{22}^2+\Gamma_{12}^1+\Gamma_{21}^1&=0\\
\alpha \Gamma_{22}^2+\Gamma_{22}^1+\Gamma_{12}^2+\Gamma_{21}^2&=0
\end{align*}
\end{multicols}

We can represent these systems in the following matrix array: \\
\begin{equation*}
\left[\begin{array}{rrrrrrrr}
\alpha &-1&-1&0&-1&0&0&0 \\
1 & \alpha & 0 & -1 & 0 & -1 & 0 &0\\
1&0&\alpha&-1&0&0&-1&0\\
0&1&1&\alpha&0&0&0&-1\\
1&0&0&0&\alpha&-1&-1&0 \\
0&1&0&0&1&\alpha&0&-1\\
0&0&1&0&1&0&\alpha&-1 \\
0&0&0&1&0&1&1&\alpha
\end{array}\right]
 \begin{bmatrix}
 \Gamma_{11}^1\\
 \Gamma_{11}^2\\
\Gamma_{12}^1\\
 \Gamma_{12}^2\\
 \Gamma_{21}^1\\
 \Gamma_{21}^2\\
 \Gamma_{22}^1\\
 \Gamma_{22}^2
 \end{bmatrix}=
 \begin{bmatrix}
 0\\0\\0\\0\\0\\0\\0\\0
 \end{bmatrix}
\end{equation*}
The determinant of the matrix is given by the polynomial $\alpha^8 + 12 \alpha^6 + 30\alpha^4 + 28 \alpha^2+9 $. Since this determinant is non-zero for $\alpha \geq 0$, then the system makes sense when $ \Gamma_{ij}^l=0 $ for all $i, j, l \in \{1,2\}. $

\end{proof}

\subsection{Non-transitive Lie algebra actions on germs of surfaces}

\begin{table}[ht]
\begin{tabular}{|p{2.5cm}|p{9.3cm}|}
\hline
Case & Christoffel symbols
\\
\hline \hline
9 & $\Gamma_{ij}^l$ are functions of $y.$
\\
\hline
10& $\Gamma_{ij}^l=0$ except $\Gamma_{22}^2, \Gamma_{21}^1, \Gamma_{12}^1$  that are functions of y $y.$
\\
\hline
20, with $r=1$&
{
\begin{flushleft}
\begin{align*}
&\Gamma_{22}^1=\Gamma_{21}^1=\Gamma_{12}^1=\Gamma_{22}^2=0,\\
&\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1=-\frac{\partial_x^2 \xi_k}{\partial_x \xi_k},
\end{align*}
\end{flushleft}
}
with $\Gamma_{11}^2, \Gamma_{12}^2, \Gamma_{21}^2$ y $\Gamma_{11}^1$ functions of $x.$
\\
\hline
21, with $r=1$&
{\begin{align*}
&\Gamma_{22}^1=\Gamma_{21}^1=\Gamma_{12}^1=\Gamma_{22}^2=\Gamma_{11}^2=0,\\
&\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1=-\frac{\partial_x^2 \xi_k}{\partial_x \xi_k},
\end{align*}
}
with $\Gamma_{12}^2, \Gamma_{21}^2$ y $\Gamma_{11}^1$ functions of  $x.$
\\
\hline
\end{tabular}
\caption{Christofell symbols for invariant connections of non-transitive Lie algebra actions on surfaces in canonical coordinates.}\label{tabla:Christofell_nontransitive}
\end{table}

For non-transitive Lie algebra actions we have the following results.

\begin{proposition}\label{pr:no_transitive1}
Let us consider a non-transitive Lie algebra action of $\mathfrak g\simeq \mathbb{R}^{r+1}$ on an open subset $M\subseteq \mathbb R^2$ to case (20) in Table \ref{tabla:acciones no transitivas}. If ${\rm Cnx}(M)^{\mathfrak g}\neq \emptyset$ then the dimension of $\mathfrak g$ is equal to 2 (r=1). In such case, Christoffel symbols of $\mathfrak g$-invariant connections are characterized by the equations:
{\begin{align*}
&\Gamma_{22}^1=\Gamma_{21}^1=\Gamma_{12}^1=\Gamma_{22}^2=0\\
&\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1=-\frac{\partial_x^2 \xi}{\partial_x \xi},
\end{align*}
}
with $\Gamma_{11}^2, \Gamma_{12}^2, \Gamma_{21}^2$ y $\Gamma_{11}^1$ functions of $x.$
\end{proposition}

\begin{proof}
Let us consider $\mathfrak g = \langle \partial_y, \xi_1(x)\partial_y,\ldots, \xi_r(x)\partial_y \rangle$. By taking components of $$\na{\xi_k(x)\partial_y}{\partial_{x_i}}{\partial_{x_j}} $$
we obtain the following system:
\begin{align*}
\left(\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1\right)\partial_x \xi_k(x)+\partial_x^2\xi_k(x)&=0,
\\
\left(\Gamma_{21}^1-\Gamma_{22}^2 \right)\partial_x \xi_k(x)&=0,
\\
\left(\Gamma_{12}^1+\Gamma_{21}^1\right)\partial_x \xi_k(x)&=0,
\\
\left(\Gamma_{22}^2-\Gamma_{12}^1 \right)\partial_x \xi_k(x)&=0,
\\
\Gamma_{22}^1\partial_x \xi_k(x)&=0,
\\
\Gamma_{22}^2\partial_x \xi_k(x)&=0.
\end{align*}

This system is  compatible if for $k\neq l$ we have
$$\frac{\partial_x^2 \xi_k}{\partial_x \xi_k} =
\frac{\partial_x^2 \xi_l}{\partial_x \xi_l}.$$
So that functions $\xi_k(x)$ and $\xi_l(x)$ are related by an affine transformation $\xi_l(x) = a\xi_k(x) + b$. Therefore, by taking $\xi = \xi_1$ we have that $\mathfrak g$ is spanned by $\partial_y$, $\xi(x)\partial_y$ and it corresponds to the case $r=1$. We obtain that the $\Gamma^k_{ij}$ are functions of $x$ satisfying the following relations:
\begin{subequations}\label{21e1}
\begin{align}
&\Gamma_{22}^1=\Gamma_{21}^1=\Gamma_{12}^1=\Gamma_{22}^2=0,\\
&\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1=-\frac{\partial_x^2 \xi}{\partial_x \xi}.
\end{align}
\end{subequations}

\end{proof}

\begin{proposition}\label{pr:no_transitive2}
Let us consider a non-transitive Lie algebra action of $\mathfrak g \simeq \mathbb{R}\ltimes \mathbb{R}^{r+1}$ on an open subset $M\subseteq\mathbb R^2$ corresponding to case (21) in Table \ref{tabla:acciones no transitivas}. If ${\rm Cnx}(M)^{\mathfrak g}\neq \emptyset$ then the dimension of $\mathfrak g$ is equal to 3 (r=1). In such case, Christoffel symbols of $\mathfrak g$-invariant connections are characterized by the equations:
{\begin{align*}
&\Gamma_{22}^1=\Gamma_{21}^1=\Gamma_{12}^1=\Gamma_{22}^2=\Gamma_{11}^2=0\\
&\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1=-\frac{\partial_x^2 \xi}{\partial_x \xi}.
\end{align*}
}
with $\Gamma_{12}^2, \Gamma_{21}^2$ y $\Gamma_{11}^1$ functions of  $x.$
\end{proposition}

\begin{proof}
This algebra contains that of case 20. Therefore, we have that $r=1$ and the system of equations \ref{21e1} are satisfied. There is an additional equation $\na{y\partial_y}{\partial_{x_i}}{\partial_{x_j}}$ yielding
$\Gamma_{11}^2=0.$ We conclude that $\Gamma_{12}^2, \Gamma_{21}^2$ and $\Gamma_{11}^1$ are functions of $x$ and the following relations are satisfied:
\begin{subequations}
\begin{align}
&\Gamma_{22}^1=\Gamma_{21}^1=\Gamma_{12}^1=\Gamma_{22}^2=\Gamma_{11}^2=0,\\
&\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1=-\frac{\partial_x^2 \xi_k}{\partial_x \xi_k}.
\end{align}
\end{subequations}
\end{proof}

Lie algebra actions corresponding to 9, 10, and 11 are well known one dimensional geometries. Case 11 corresponds to the projective geometry of the real line and it does not admit invariant connections. A direct computation yields the space of invariant connections in canonical coordinates.
Summarizing, the following Table \ref{tabla:Christofell_nontransitive}, contains the computation of Christoffel symbols of invariant connections in canonical coordinates.

\subsection{Transitive imprimitive Lie algebra actions}

\begin{theorem}\label{th:imprimitive}
Let us consider a faithful transitive imprimitive action of a Lie algebra $\mathfrak g$ in a connected surface $M$. Then, if the affine space ${\rm Cnx}(M)^{\mathfrak g}$ is not empty, then it falls in one of the following cases:
\begin{enumerate}
\item[(a)] The action corresponds to one of the following cases of Table \ref{tabla:imprimitive actions}:
    \begin{enumerate}
        \item[(i)] Case (12) with $\alpha\neq \frac{1}{2}$,
        \item[(ii)] Case (13),
        \item[(iii)] Case (24) with $r=1$,
        \item[(iv)] Case (25) with $r=1$,
        \item[(v)] Case (26) with $r=1$.
    \end{enumerate}
     For any such cases, the only invariant connection, in canonical coordinates, is the standard affine connection.
\item[(a')] The action corresponds to case (17). There is only an invariant connection whose Christoffel symbols, in canonical coordinates are:
\begin{align*}
\Gamma_{11}^2&=\Gamma_{12}^1=\Gamma_{12}^2=\Gamma_{21}^1=\Gamma_{21}^2=\Gamma_{22}^1=0,\\
\Gamma_{11}^1&=-\frac{2}{x-y},\\
\Gamma_{22}^2&=-\frac{2}{y-x}.
\end{align*}
\item[(b)] The action corresponds to case (12) of Table \ref{tabla:imprimitive actions} with $\alpha =\frac{1}{2}$. The space ${\rm Cnx}(M)^{\mathfrak g}$ has dimension $1$. The equations for the Christoffel symbols in canonical coordinates are:
    $$\Gamma_{22}^1 \,\, \mathrm{cte}, \mbox{ for all other symbols }\Gamma_{ij}^k = 0.$$
\item[(c)] The action corresponds to case (18). The affine space ${\rm Cnx}(M)^{\mathfrak g}$ has dimension $3$. The equations for the Christoffel symbols in canonical coordinates are:
    {\begin{align*}
\Gamma_{11}^1&=\frac{a+b}{y^2},\quad \Gamma_{11}^2=\frac{c}{y^3},\\
\Gamma_{12}^2&=\frac{a}{y^2},\quad \Gamma_{21}^2=\frac{b}{y^2},\\
\Gamma_{22}^2&=-\frac{2}{y}\quad\Gamma_{22}^1=0\\
\Gamma_{12}^1&=\Gamma_{21}^1=-\frac{1}{y}.
\end{align*}}
    for arbitrary constants $a,b,c$.
\item[(d)] The action corresponds to case (22) with $r=1$ and $\eta_1(x) = e^{\alpha x}$. The affine space ${\rm Cnx}(M)^{\mathfrak g}$ has dimension $8$. The equations for the Christoffel symbols in canonical coordinates are:
    {\begin{align*}
\Gamma_{11}^2&=c_{22}^1\alpha^3y^3-c_{22}^2\alpha^2 y^2+(c_{11}^1-c_{21}^2-c_{12}^2)\alpha y-\alpha^2 y+c_{11}^2
\\
\Gamma_{11}^1&=c_{22}^1\alpha^2 y^2-(c_{12}^1+c_{21}^1)\alpha y+c_{11}^1
\\
\Gamma_{12}^2&=-c_{22}^1\alpha^2 y^2-(c_{22}^2-c_{12}^1)\alpha y+c_{12}^2
\\
\Gamma_{21}^2&=-c_{22}^1\alpha^2 y^2-(c_{22}^2+c_{21}^2)\alpha y+c_{21}^2
\\
\Gamma_{12}^1&=-c_{22}^1\alpha y+c_{12}^1
\\
\Gamma_{21}^1&=-c_{22}^1\alpha y+c_{21}^1
\\
\Gamma_{22}^2&=c_{22}^1\alpha y+c_{22}^2
\\
\Gamma_{22}^1&=c_{22}^1.
\end{align*}}
    for arbitrary constants $c_{ij}^k$, with $i,j,k \in \{1,2\}$.
\item[(e)] The action corresponds to case (23) with $r=1$ and $\eta_1(x) = e^{\alpha x}$.  The affine space ${\rm Cnx}(M)^{\mathfrak g}$ has dimension $4$. The equations for the Christoffel symbols in canonical coordinates are:
{\begin{align*}
\Gamma_{22}^2&=\Gamma_{12}^1=\Gamma_{21}^1=\Gamma_{22}^1=0\\
\Gamma_{11}^1&=a, \Gamma_{12}^2=c, \Gamma_{21}^2=d  \\
\Gamma_{11}^2&=-\alpha (d+c-a)y-\alpha^2y+b.
\end{align*}
}
for arbitrary constants $a,b,c,d.$
\end{enumerate}
\end{theorem}

\begin{proof}
The proof is based in an analysis of the Lie derivative of a general connections by the generators of the Lie algebra action in canonical coordinates for each case appearing in Table \ref{tabla:imprimitive actions}.

\begin{enumerate}
\item [(a)] Let  $\mathfrak g_{6}$, $\mathfrak g_{12,\alpha\neq 1/2}$, $\mathfrak g_{13}$, $\mathfrak g_{24,r=1}$, $\mathfrak g_{25,r=1}$, $\mathfrak g_{26,r=1}$ be Lie algebras correspond to their corresponding cases in the tables  \ref{tabla:acciones primitivas}, \ref{tabla:imprimitive actions}. By the last result, the only invariant connection for the algebra $\mathfrak g_{6}$ is the affine standard connection. As the other algebras are contained in this algebra forming the lattice:
$$\xymatrix{
\mathfrak{g}_6 \\ \mathfrak g_{26,r=1} \ar@{^{(}->}[u] \\ \mathfrak g_{24,r=1} \ar@{^{(}->}[u] \\ \mathfrak g_{13} \ar@{^{(}->}[u] & \ \ \ \ \ \ \ \  \mathfrak g_{25,r=1} \ar@{^{(}->}[ul] \\  \mathfrak g_{12,\alpha\neq 1/2} \ar@{^{(}->}[u]
}$$
then is sufficient to show the result for the cases
 $12$ with  $\alpha\neq 1/2$, $25$ with $r=1$.

\begin{itemize}

\item Case (12), $\g=\left \{\partial_x, \partial_y,x\partial_x+\alpha y\partial_y\right \},$ $0<|\alpha|\leq 1.$

The coefficients $\Gamma_{ij}^l$ are constants by \ref{constante}. If $X=x\partial_x+\alpha y\partial_y$, with $\alpha \neq \frac{1}{2}$, then from that $\na{X}{\partial_{x_i}}{\partial_{x_j}}$ it follows  $\Gamma_{ij}^l=0$.

\item Case (25), $r=1$. in this case the algebra is $\g=\{\partial_x, \partial_y, x\partial_x+\left(y+x\right)\partial_y \}$. As $\partial_x$ and $\partial_y$ are in $ \g$, then $\Gamma_{ij}^l$ are constants. Taking the field $Y=\partial_x+\left(y+x\right)\partial_y$, from $\na{Y}{\partial_{x_i}}{\partial_{x_j}}$, we have the system
\begin{align*}
-\Gamma_{11}^1&+\Gamma_{11}^2+\Gamma_{12}^2+\Gamma_{21}^2=0,\\
\Gamma_{11}^1&+\Gamma_{12}^1+\Gamma_{21}^1=0,\\
\Gamma_{21}^2&-\Gamma_{21}^1+\Gamma_{22}^2=0,\\
\Gamma_{12}^2&-\Gamma_{12}^1+\Gamma_{22}^2=0,\\
\Gamma_{12}^1&+\Gamma_{22}^1=0,\\
\Gamma_{21}^1&+\Gamma_{22}^1=0,\\
\Gamma_{22}^2&=\Gamma_{22}^1=0.
\end{align*}
With solution $\Gamma_{ij}^l=0$.

\end{itemize}

\item[(a')]  Case (17), $\g=\left\{\partial_x+\partial_y,  x\partial_x+y\partial_y, x^2\partial_x+y^2\partial_y \right\}$.
Considering $X=\partial_x+\partial_y$, $Y=x\partial_x+y\partial_y$ and  $Z=x^2\partial_x+y^2\partial_y$,
from $\na{X}{\partial_{x_i}}{\partial_{x_j}}$ and $\na{Y}{\partial_{x_i}}{\partial_{x_j}}$, we obtain for $i,j,l\in \{1,2\}$  the system
\begin{align*}
\partial_x\Gamma_{ij}^l=-\partial_y\Gamma_{ij}^l,\\
(x-y)\partial_x\Gamma_{ij}^l+\Gamma_{ij}^l=0,\\
(y-x)\partial_y\Gamma_{ij}^l+\Gamma_{ij}^l=0.
\end{align*}
Replacing those equations in  $\na{Z}{\partial_{x_i}}{\partial_{x_j}}$, we get the system
\begin{align*}
\Gamma_{11}^2&=\Gamma_{12}^1=\Gamma_{12}^2=\Gamma_{21}^1=\Gamma_{21}^2=\Gamma_{22}^1=0,\\
\Gamma_{11}^1&=-\frac{2}{x-y},\\
\Gamma_{22}^2&=-\frac{2}{y-x}.
\end{align*}

\item[(b)] We have that $\Gamma_{ij}^l$ are constants, from $\na{X}{\partial_{x_i}}{\partial_{x_j}}$, with $X=x\partial_x+\alpha y\partial_y$, we have the result.

\item[(c)] Case (12), $\g=\{\partial_x, 2x\partial_x+y\partial_y, x^2\partial_x+xy\partial_y\}$. As $\partial_x$ is in the algebra, then all the symbols  $\Gamma_{ij}^l$ are functions of  $y$. Taking  $Y=2x\partial_x+y\partial_y$ and $Z=x^2\partial_x+xy\partial_y$,
from $\na{Y}{\partial_{x_i}}{\partial_{x_j}}$ and  $\na{Z}{\partial_{x_i}}{\partial_{x_j}}$, we have the system:

\begin{multicols}{2}
\begin{align*}
y\partial_y\Gamma_{11}^1+2\Gamma_{11}^1&=0,\\
y\partial_y\Gamma_{11}^2+3\Gamma_{11}^2&=0,\\
y\partial_y\Gamma_{12}^1+\Gamma_{12}^1&=0,\\
y\partial_y\Gamma_{12}^2+2\Gamma_{12}^2&=0, \\
y\partial_y\Gamma_{21}^1+\Gamma_{21}^1&=0,\\
y\partial_y\Gamma_{21}^2+2\Gamma_{21}^2&=
\end{align*}

\begin{align*}
\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1&=0,\\
y\Gamma_{22}^2-y\Gamma_{12}^1+1&=0,\\
y\Gamma_{22}^2-y\Gamma_{21}^1+1&=0, \\
y\Gamma_{21}^1+y\Gamma_{12}^1+2&=0,\\
\Gamma_{22}^1&=0.
\end{align*}
\end{multicols}

Where the general solution are expressed in function of  arbitrary constants
 $a$, $b$, $c$ $\in\mathbb{R}$:

\begin{align*}
\Gamma_{11}^1&=\frac{a+b}{y^2},\quad \Gamma_{11}^2=\frac{c}{y^3},\\
\Gamma_{12}^2&=\frac{a}{y^2},\quad \Gamma_{21}^2=\frac{b}{y^2},\\
\Gamma_{22}^2&=-\frac{2}{y}\quad\Gamma_{22}^1=0,\\
\Gamma_{12}^1&=\Gamma_{21}^1=-\frac{1}{y}.
\end{align*}

\item[(d)] $\g=\left\langle\partial_x, \eta_1(x)\partial_y, \cdots, \eta_r(x)\partial_y \right\rangle,$ with $r\geq 1.$

Taking  $k$ such that  $1\leq k \leq r$.
The symbols  $\Gamma_{ij}^l$ depends of $y$ because $\partial_x$ is in the algebra. From  $\na{\eta_k(x)\partial_y}{\partial_{x_i}}{\partial_{x_j}}$, obtain the system

\begin{align*}
\eta_k(x)\partial_y\Gamma_{11}^1+\partial_x\eta_k(x)\left(\Gamma_{12}^2+\Gamma_{21}^2-\Gamma_{11}^1\right)+\partial_x^2\eta_k(x)&=0,
\\
\eta_k(x)\partial_y\Gamma_{11}^1+\partial_x\eta_k(x)\left(\Gamma_{21}^1+\Gamma_{12}^1\right)&=0,
\\
\eta_k(x)\partial_y\Gamma_{12}^1+\Gamma_{22}^1\partial_x\eta_k(x)&=0,
\\
\eta_k(x)\partial_y\Gamma_{12}^2+\partial_x\eta_k(x)\left(\Gamma_{22}^2-\Gamma_{12}^1\right)&=0,
\\
\eta_k(x)\partial_y\Gamma_{21}^1+\Gamma_{22}^1\partial_x\eta_k(x)&=0,
\\
\eta_k(x)\partial_y\Gamma_{21}^2+\partial_x\eta_k(x)\left(\Gamma_{22}^2-\Gamma_{21}^1\right)&=0,
\\
\eta_k(x)\partial_y\Gamma_{22}^2-\Gamma_{22}^1\partial_x\eta_k(x)&=0,
\\
\eta_k(x)\partial_y\Gamma_{22}^1&=0.
\end{align*}

Using this equations we obtain that  $\alpha_k:=\frac{\partial_x\eta_k(x)}{\eta_k(x)}$ and $\alpha^2_k:=\frac{\partial_x^2\eta_k(x)}{\eta_k(x)}$ are constants.
Therefore $\eta_k(x)$ is  multiple of  $e^{\alpha_kx}$.
Finally, for  $k$ fixed, we can solve the symbols in function of  $8$ arbitrary constants  $c_{ij}^k$:

\begin{subequations}
\begin{align}
\Gamma_{11}^2&=c_{22}^1\alpha^3_ky^3+(c_{22}^2-c_{12}^1-c_{21}^1)\alpha^2_ky^2+(c_{11}^1-c_{21}^2-c_{12}^2)\alpha_ky-\alpha^2_ky+c_{11}^2, \label{simbolos22}
\\
\Gamma_{11}^1&=c_{22}^1\alpha^2_ky^2-(c_{12}^1+c_{21}^1)\alpha_ky+c_{11}^1,
\\
\Gamma_{12}^2&=-c_{22}^1\alpha^2_ky^2-(c_{22}^2-c_{12}^1)\alpha_ky+c_{12}^2,
\\
\Gamma_{21}^2&=-c_{22}^1\alpha^2_ky^2-(c_{22}^2-c_{21}^1)\alpha_ky+c_{21}^2,
\\
\Gamma_{12}^1&=-c_{22}^1\alpha_ky+c_{12}^1,
\\
\Gamma_{21}^1&=-c_{22}^1\alpha_ky+c_{21}^1,
\\
\Gamma_{22}^2&=c_{22}^1\alpha_ky+c_{22}^2,
\\
\Gamma_{22}^1&=c_{22}^1. \label{simbolos22b}
\end{align}
\end{subequations}

This system is compatible if the constants $\alpha_k$ are equals for all $k$. In this case the functions  $\eta_k(x)$ spam a space of dimension $1$, so $r=1$. That is, if $r=1$ and $\eta_1(x) = e^{\alpha_k x}$, there is a  $8$-dimensional space of invariant connections. Otherwise, there is not invariant connections.

\item[(e)]
As this algebra contains the algebra of the case (22), then  $r=1$ and $\eta_1(X) = e^{\alpha_1 x}$. We obtain a system of equations including
\eqref{simbolos22} -- \eqref{simbolos22b} and also from $\na{y\partial_y}{\partial_{x_i}}{\partial_{x_j}}$, we obtain additional equations:
\begin{align}\label{e23-1}
y\partial_y\Gamma_{11}^1=y\partial_y\Gamma_{12}^2=y\partial_y\Gamma_{21}^2=0
\end{align}
and the system
\begin{subequations}\label{e23-2}
\begin{align}
y\partial_y\Gamma_{11}^1-\Gamma_{11}^1&=0\label{e23-2-1},
\\
y\partial_y\Gamma_{12}^1+\Gamma_{12}^1&=0\label{e23-2-2},
\\
y\partial_y\Gamma_{21}^1+\Gamma_{21}^1&=0\label{e23-2-3},
\\
y\partial_y\Gamma_{22}^1+2\Gamma_{22}^1&=0\label{e23-2-4},
\\
y\partial_y\Gamma_{22}^2+\Gamma_{22}^2&=0\label{e23-2-5}.
\end{align}
\end{subequations}
From \ref{e23-1}, $\Gamma_{11}^1, \Gamma_{12}^2, \Gamma_{21}^2$ are constants. As $\Gamma_{22}^1$ is constant, from \ref{e23-2-4}, $\Gamma_{22}^1=0$. Combining this with the equations from the previous case we obtain $\Gamma_{22}^2=\Gamma_{21}^1=\Gamma_{12}^1=0$. So we have:
\begin{align*}
\Gamma_{22}^2&=\Gamma_{12}^1=\Gamma_{21}^1=\Gamma_{22}^1=0,\\
\Gamma_{21}^2&=c_{21}^2, \Gamma_{12}^2=c_{12}^2, \Gamma_{11}^1=c_{11}^1,\\
\Gamma_{11}^2&=-\alpha_1(c_{21}^2+c_{12}^2-c_{11}^1)y-\alpha ^2_1y+c_{11}^2,
\end{align*}
where  $c_{21}^2, c_{12}^2, c_{11}^1$ and $c_{11}^2$ are arbitrary constants.

\end{enumerate}

It remains to check that all other cases of transitive imprimitive infinitesimal actions, namely cases (14), (15), (16), (19), (27) and (28) do not admit invariant connections.
The Lie algebra of case (14) is contained in that of cases (15) and (16). Thus, it suffices to show the case (14). In such case, since $\partial_x$ and $\partial_y$ are in the algebra, then $\Gamma_{ij}^l$ are constants. From $\na{x\partial_x}{\partial_{x_i}}{\partial_{x_j}}$, $\Gamma_{ij}^l=0$ , except the  symbols $\Gamma_{12}^1, \Gamma_{21}^1, \Gamma_{22}^2$. As $\na{x^2\partial_x}{\partial_x}{\partial_x}$ implies that $2\partial_x=0$, this is impossible, then in this case there is not connection.

For the case (19),  $\Gamma_{ij}^l$ depends of $y$. From $\na{x\partial_x}{\partial_{x_i}}{\partial_{x_j}}$ it follows that  $\Gamma_{ij}^l=0$, except  $\Gamma_{12}^1, \Gamma_{21}^1, \Gamma_{22}^2$.
From $\na{y\partial_y}{\partial_{x_i}}{\partial_{x_j}}$, we have the system
\begin{align*}
y\partial_y\Gamma_{12}^1+\Gamma_{12}^1&=0\\
y\partial_y\Gamma_{21}^1+\Gamma_{21}^1&=0\\
y\partial_y\Gamma_{22}^2+\Gamma_{22}^2&=0
\end{align*}
Using this in $\na{Y}{\partial_{x_i}}{\partial_{x_j}}$, with $Y=x^2\partial_x+xy\partial_y$ we have the system
\begin{align*}
-y\Gamma_{12}^1+y\Gamma_{22}^2+1&=0\\
-y\Gamma_{21}^1+y\Gamma_{22}^2+1&=0\\
xy\partial_y\Gamma_{22}^2+y\Gamma_{22}^2+1&=0\\
y\Gamma_{21}^1+y\Gamma_{12}^1+2&=0\\
\Gamma_{21}^1&=0
\end{align*}
Which is inconsistent, in this case there is not connection.

In the case (27), $\Gamma_{ij}^l$ are constants. For $Y=2x\partial_x+ky\partial_y$ with $1\leq k\leq r$, from $\na{Y}{\partial_{x_i}}{\partial_{x_j}}$ we have the system:
\begin{align*}
2\Gamma_{11}^1\partial_x+(4-k)\Gamma_{11}^2\partial_y=0,\\
k\Gamma_{12}^1\partial_x+2\Gamma_{12}^2\partial_y=0,\\
k\Gamma_{21}^1\partial_x+2\Gamma_{21}^2\partial_y=0,\\
(2k-2)\Gamma_{22}^1\partial_x+k\Gamma_{22}^2\partial_y=0.
\end{align*}
If $k=1$, then $\Gamma_{ij}^l=0$ except $\Gamma_{22}^1$,  but from $\na{x\partial_y}{\partial_y}{\partial_y}$, $\Gamma_{22}^1=0.$
If $r=2$, from $\na{x^2\partial_y}{\partial_x}{\partial_x}$ we have a contradiction. So $r=1$, as $\Gamma_{ij}^l=0$ from $\na{Z}{\partial_x}{\partial_x}$, with $Z=x^2\partial_x+xy^2\partial_y$ we have also a contradiction. Therefore there are not invariant connections in this case.

Finally the Lie algebra of case (28) is contained in that of case (13), then  $\Gamma_{ij}^l=0$. From $\na{Z}{\partial_x}{\partial_x}$, with $Z=x^2\partial_x+rxy\partial_y$, we obtain the incompatibility of the system for the Christoffel symbols and there are no invariant connections.
\end{proof}

\section{Homogeneous surfaces}

By an homogeneous manifold we understand an smooth manifold $M$ endowed with a transitive smooth action $\rho\colon G\to {\rm Diff}(M)$ of a connected Lie group $G$. As it is well known the surface can be recovered as the quotient $M\simeq G/H$ where $H$ is the stabilizer of a point in $M$. We say that two action
$\rho\colon G\to {\rm Diff}(M)$ and $\rho'\to {\rm Diff}(M')$ are equivalent if they induce the same transformation group in $M$, that is, $\rho(G) = \rho(G')$. Any action is always equivalent to a faithful action: we may consider the exact sequence,
$${\rm Id}\to {\rm ker}(\rho) \to  G \xrightarrow{\rho} {\rm Diff}(M)$$
and replace $G$ by $\bar G = G/\ker{\rho}$.
Given a faithful action of $G$ on $M$ we can replace $G$ by its universal cover. The action of the universal cover of $G$ in $M$ is not faithful but at least infinitesimally faithful. Therefore, there is no loss of generality in assuming that the $G$ is simply connected and the action of $G$ on $M$ is infinitesimally faithful.

\begin{lemma}
Let $H$ be a Lie subgroup of a simply connected Lie group $G$. Then, the homogeneous manifold $G/H$ is simply connected if and only if $H$ is connected.
\end{lemma}

\begin{proof}
First let us see that if $G/H$ is simply connected, then $H$ is connected. Reasoning by contradiction let us assume that $H$ is not connected a, and let $H_0$ be its connected component of the the identity. Then, $G/H_0\to G/H$ is a non-trivial connected (since $G$ is connected) covering space. Therefore $G/H$ is not simply connected.

Let us assume now that $H$ is connected. Let us denote by $x_0$ the class $H$ in $G/H$. Let $\gamma\colon [0,1]\to G/H$ is a loop based on $x_0$. We can lift $\gamma$ to a path $\tilde \gamma$ in $G$ such that $\gamma(0) = e$ and $\gamma(1)\in H$. Since $H$ is connected there is path $\tau\colon [0,1]\to H$ such that $\tau(0) = e$ and $\tau(1) = \tilde\gamma(1)$. Since $G$ is simply connected there is an homotopy with fixed extremal points $\tilde\gamma \sim \tau$. The projection of the homotopy onto $G/H$ tell us that $\gamma$ is contractible.
\end{proof}

Therefore, simply connected homogeneous manifolds arise as quotients of simply connected Lie groups by connected Lie subgroups. On the other hand let us consider $M$ an homogeneous manifold, and $\pi\colon \tilde M \to M$ its universal cover. Since each diffeomorphism of $M$ can be lifted, up to choice of two points in the fibers of $\pi$, to a diffeomorphism of $\tilde M$, we have an exact sequence:
$${\rm Id} \to {\rm Aut}(\tilde M/M)\to {\rm Diff}(\tilde M/M)\xrightarrow{\pi_*} {\rm Diff}(M) \to {\rm Id}$$
where ${\rm Diff}(\tilde M/M)$ is the group of diffeomorphisms of $\tilde M$ that respect the fibers of $\pi$. Therefore, by taking $\tilde G$ the connected component of $\pi_*^{-1}(G)$, we have that $\tilde M$ is a simply connected homogeneous manifold with the action of $\tilde G$. Therefore, homogeneous manifold can be seen as quotients of simply connected homogeneous manifolds.

The analysis of the invariant connections for Lie algebra actions allow us to classify, up to equivalence, all the simply connected homogeneous surfaces having more than one, or exactly one, invariant connections.

\begin{theorem}\label{th:hs}
Let $M$, endowed with an action of a connected Lie group $G$, be a simply connected homogeneous surface. Let us assume that $M$ admits at least two $G$-invariant connections. Then, $M$ is equivalent to one of the following cases:
\begin{enumerate}
\item[(a)] The affine plane $\mathbb R^2$ with one of the following transitive groups of affine transformations:
$${\rm Res}_{(2:1)}(\mathbb R^2) = \left\{ \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} \lambda^2 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\},$$
$${\rm Trans}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right] \mid b_1,b_2\in\mathbb R \right\},$$
$${\rm Res}_{(0:1)}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} 1 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\}.$$
\item[(b)] ${\rm SL}_2(\mathbb R)/U$ where $U$ is the subgroup of superior unipotent matrices
$$ U = \left\{ A\in {\rm SL}_2(\mathbb R) \mid A =
\left[ \begin{array}{cc} 1 & \lambda \\ 0 & 1 \end{array} \right]
\right\}.$$
\item[(c)] $\mathbb R\ltimes \mathbb R$ acting on itself by left translations.
\item[(d)] $G/H$ with $G = \mathbb R^2\ltimes \mathbb R$ and $H = (\mathbb R\times 0)\ltimes 0$.
\end{enumerate}
\end{theorem}

\begin{proof}
Let $M$, endowed with an action of a connected Lie group $G$, be a simply connected homogeneous surface. Let us consider the infinitesimal lie algebra action induced by the action of $G$ in $M$. Since $G$ is connected then the space of $G$-invariant connections coincide with that of ${\rm Lie}(G)$-invariant connections.

In virtue of Theorems \ref{th:primitive} and  \ref{th:imprimitive} if the infinitesimal action has more than one invariant connection, then it corresponds to cases (12) with $\alpha = \frac{1}{2}$, (18), (22) with $r=1$ or (23) with $r=1$ in table \ref{tabla:imprimitive actions}. Without loss of generality, we assume that $G$ is simply connected. Then, by third Lie theorem, it is completely determined by its Lie algebra. Therefore, by integrating the respective Lie algebras, we deduce the following:
\begin{itemize}
    \item Any homogeneous surface corresponding to case (12) with $\alpha\neq 0$ or cases (22, 23) with trivial semidirect product in Table \ref{tabla:imprimitive actions}, is equivalent to one listed in the case (a) of the statement;
    \item any homogeneous surface corresponding to case (18) in Table \ref{tabla:imprimitive actions}, is equivalent to that of case (b);
    \item any homogeneous surface corresponding to case (22) with $r=1$ in Table \ref{tabla:imprimitive actions} and non trivial semidirect product is equivalent to that of case (c);
    \item any homogeneous surface corresponding to case (23) with $r=1$ in Table \ref{tabla:imprimitive actions} and non trivial semidirect product is equivalent of that of case (d).
\end{itemize}
This completes the proof.
\end{proof}

\begin{remark}
In the cases (c) and (d) of Theorem \ref{th:hs} we assume that the semidirect product is not trivial. Otherwise we fall in the case (a).
\end{remark}

\begin{theorem}\label{th:hs2}
Let $M$, with the action of $G$, be a simply connected homogeneous surface. Let us assume that $M$ admits exactly one $G$-invariant connection. Then, $M$ is equivalent to one of the following cases:
\begin{enumerate}
\item[(a)] The affine plane $\mathbb R^2$ with $G$ any connected transitive subgroup of the group ${\rm Aff}(\mathbb R^2)$ of affine transformations containing the group of translations and not conjugated with any of the groups,
$${\rm Res}_{(2:1)}(\mathbb R^2) = \left\{ \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} \lambda^2 & 0 \\ 0 & \lambda \end{array} \right],\,\lambda>0
\right\},$$
$${\rm Trans}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right] \mid b_1,b_2\in\mathbb R \right\},$$
$${\rm Res}_{(0:1)}(\mathbb R^2) = \left\{  \left[ \begin{array}{c}x\\ y\end{array}\right] \mapsto A  \left[ \begin{array}{c}x\\ y\end{array}\right] +  \left[ \begin{array}{c}b_1\\ b_2\end{array}\right]\mid A =
\left[ \begin{array}{cc} 1 & 0 \\ 0 & \lambda \end{array} \right],\, \lambda>0
\right\}.$$
(this case includes the euclidean plane)

\item[(b)] ${\rm SL}_2(\mathbb R)/H$ where $H$ is the group of special diagonal matrices,
$$H = \left\{ A \in {\rm SL}_{2}(\mathbb R) \mid
A =  \left[ \begin{array}{cc} \lambda & 0 \\ 0 & \lambda^{-1} \end{array} \right], \,\, \lambda>0 \right\}.$$
\item[(c)] The hyperbolic plane
$$\mathbb H = \{z\in\mathbb C \mid {\rm Im}(z)>0 \}$$
with the group ${\rm SL}_2(\mathbb R)$ of hyperbolic rotations.
\item[(d)] Spherical surface,
$$S^2 = \{(x,y,z)\in \mathbb R^3\mid x^2 + y^2 + z^2 =1 \}$$
with its group ${\rm SO}_3(\mathbb R)$ of rotations.
\end{enumerate}
\end{theorem}

\begin{proof}
We follow the same reasoning that in the proof of Theorem \ref{th:hs}.
In virtue of Theorems \ref{th:primitive} and  \ref{th:imprimitive} if the infinitesimal action has exactly one one invariant connection, then it corresponds to cases (1), (3), (5), (6), (12) with $\alpha \neq \frac{1}{2}$, (13), (24) with $r=1$, (25) with $r=1$, (26) with $r=1$, (17), (2) or (3). Then we check that cases (1), (3), (6), (5),(12) with $\alpha\neq 1/2$, (13), (24) with $r=1$, (25) with $r=1$ and (26) with $r=1$, all ot them correspond to case (a) in the statement. Finally, case (17) corresponds to case (b), case (2) corresponds to case (c) and case (3) corresponds to case (d).
\end{proof}

\begin{remark}
Note that the hyperbolic plane, case (c) in Theorem \ref{th:hs2}, corresponds to the remaining $2$-dimensional simply connected quotient of ${\rm SL}_2(\mathbb R)$; $\mathbb H \simeq {\rm SL}_2(\mathbb R)/H$ where
$$H = \left\{  \left[ \begin{array}{cc} a & -b \\ b & a \end{array} \right] \mid a^2 + b^2 = 1 \right\}.$$
\end{remark}

\subsection*{Acknowledgements}

The authors acknowledge the support of their host institutions Universidad de Antioquia and Universidad Nacional de Colombia - Sede Medell\'in. The research of D.B.-S. has been partially funded by Colciencias project ''Estructuras lineales en geometr\'ia and Topolog\'ia'' 776-2017 57708 (HERMES 38300).

\bibliographystyle{plain}


Sinkhorn normal form for unitary matrices

Abstract: Sinkhorn proved that every entry-wise positive matrix can be made doubly stochastic by multiplying with two diagonal matrices. In this note we prove a recently conjectured analogue for unitary matrices: every unitary can be decomposed into two diagonal unitaries and one whose row- and column sums are equal to one. The proof is non-constructive and based on a reformulation in terms of symplectic topology. As a corollary, we obtain a decomposition of unitary matrices into an interlaced product of unitary diagonal matrices and discrete Fourier transformations. This provides a new decomposition of linear optics arrays into phase shifters and canonical multiports described by Fourier transformations.

\section{Introduction}
For every $n\times n$ matrix $A$ with positive entries there exist two diagonal matrices $L,~R$ such that $LAR$ is doubly stochastic, i.e. the entries of each column and row sum up to one. This result was first obtained by Sinkhorn \cite{sin64}, who also gave an algorithm how to compute $L$ and $R$ by iterated left and right multiplication of diagonal matrices.

Recently, De Vos and De Baerdemacker studied the same problem for unitary matrices \cite{vos14a}. They conjectured that for every $n\times n$ unitary $U$ there exist two unitary diagonal matrices $L, R$ such that $LUR$ has all row and column sums equal to one. To support their conjecture, they construct an algorithm similar to the iteration procedure for matrices with positive entries from \cite{sin64,sin67}. They also provide numerical evidence that the algorithm always converges to a unitary matrix with row and column sums equal to one.

The goal of this paper is to prove the conjecture of De Vos and De Baerdemacker that such a normal form always exists by reformulating the problem in terms of symplectic topology. It turns out that the reformulated problem is a special case of the Arnold (sometimes Arnold-Givental) conjecture on the intersection of Lagrangian submanifolds \cite{mcd98}, which was solved for this case in \cite{bir04, cho04}. More precisely, in section \ref{sec:unit} we show:
\begin{customTheorem}{2}
For every unitary matrix $U\in U(n)$ there exist two diagonal unitary matrices $L,R\in U(n)$ such that $A:=LUR$ satisfies $\sum_j A_{ji} =\sum_j A_{ij} =1$ for all $i=1,\ldots n$.
\end{customTheorem}
For a given unitary $U\in U(n)$ the triple $(L,R,A)$ is certainly not unique, since multiplying $L$ by a global phase and $R$ by its inverse does not change $LAR$. Hence, it makes sense to consider the decomposition $U=e^{i\varphi}L^{\prime}AR^{\prime}$, where $L^{\prime},R^{\prime}$ are unitary diagonal such that $L^{\prime}_{11}=R^{\prime}_{11}=1$ and $\varphi\in[0,2\pi)$. In particular, for $U(2)$, a simple complete solution was given in \cite{vos14a} from which one can see that for every non-diagonal matrix, there are only two different $A$ such that $e^{i\varphi}LAR=U$. For $n>2$ the picture is less clear and the reformulation in terms of symplectic topology appears to give further insight into the freedom of the decomposition.

In addition to the Sinkhorn-type normal form above, in section \ref{sec:derived} we give several reformulations that might be interesting for applications, for instance regarding the decomposition of general $2n-$port linear optics devices into canonical multiports and phase shifters.

\section{Sinkhorn-type normal form} \label{sec:unit}
In order to prove the decomposition theorem, we reformulate the problem of rescaling a unitary matrix into a problem in symplectic topology.  For the reader's convenience, necessary results including elementary calculations and definitions are included in \ref{sec:sympprel}. We only repeat the most important definitions for our reformulation. Recall that the complex projective space $\mathbb{C}P^n$ consists of all equivalence classes of $\mathbb{C}^{n+1}\backslash\{0\}$ w.r.t. $x\sim y\Leftrightarrow x=\lambda y$ with $\lambda\in\mathbb{C}\backslash\{0\}$.
\begin{dfn} \label{dfn:clifftor}
 The \emph{Clifford Torus} is the $n$-dimensional torus embedded in $\mathbb{C}P^n$, i.e. the set of points
\begin{align}
	T^n:=\{[w_0,\ldots, w_n]\in\mathbb{C}P^{n}\big||w_0|=|w_1|=\ldots=|w_n|\}.
\end{align}
\end{dfn}
This torus, as shown in the appendix in proposition \ref{prop:cliff}, is a Lagrangian submanifold of the symplectic manifold $\mathbb{C}P^n$. We obtain the following connection to our normal form:
\begin{lem} \label{lem:reform}
For any unitary $U\in U(n)$, there exist diagonal unitaries $L$ and $R$ such that $A:=LUR$ has row and column sums equal to one if and only if the Clifford torus $T^{n-1}\subset \mathbb{C}P^{n-1}$ fulfills $T^{n-1}\cap UT^{n-1}\neq \emptyset$.
\end{lem}
\begin{proof}
Let $U\in U(n)$ be arbitrary but fixed. We first consider the usual torus $\mathbb{T}^{n}\subset \mathbb{C}^{n}$, i.e. the set of all vectors for which each component has modulus one:
\begin{align*}
	\mathbb{T}^n:=\{(e^{i\phi_1},\ldots,e^{i\phi_n})\subset \mathbb{C}^n\,|\,\phi_j\in\mathbb{R}\}
\end{align*}
Let us first show that the existence of a normal form is equivalent to $\mathbb{T}^n\cap U\mathbb{T}^n\neq \emptyset$. For one direction, let $\varphi\in\mathbb{T}^n$ such that $U\varphi\in\mathbb{T}^n$, i.e. $\varphi\in\mathbb{T}^n\cap U\mathbb{T}^n$. Define the two diagonal matrices $R^{-1}:=\operatorname{diag}(\varphi_1,\ldots,\varphi_n)\in U(n)$ and  $L^{-1}:=\operatorname{diag}((U\varphi)_i^{-1})=\operatorname{diag}((\overline{U\varphi})_i)\in U(n)$. With $A:=L^{-1}UR^{-1}$ and $e:=(1,\ldots,1)^{T}$ we obtain:
\begin{align*}
	Ae=L^{-1}U\varphi=e
\end{align*}
Likewise, since $\overline{A}e=Ae$ and $A$ is unitary, we obtain
\begin{align*}
	A^Te&=A^T\overline{A}e=e.
\end{align*}
so that columns and rows of $A$ sum up to one.

For the other direction, suppose $U=LAR$ is a decomposition as proposed. Then $\varphi:=R^{-1}e\in\mathbb{T}^n$ and
\begin{align*}
	U\varphi=LAR\varphi=LAe=Le\in\mathbb{T}^n
\end{align*}
hence $U\varphi\in\mathbb{T}^n\cap U\mathbb{T}^n$.

The next step is to reformulate the problem using the Clifford torus. Clearly, $T^{n-1}\cap UT^{n-1}\neq \emptyset$ iff $(\lambda \mathbb{T}^n)\cap U\mathbb{T}^n\neq \emptyset$ for some $\lambda \in \mathbb{C}\setminus \{0\}$. Since $U$ is norm preserving, any intersection requires $|\lambda|=1$ so that
\begin{align*}
	T^{n-1}\cap UT^{n-1}\neq \emptyset \quad \Leftrightarrow \quad \mathbb{T}^n\cap U\mathbb{T}^n\neq \emptyset.\end{align*}
\end{proof}

One of the main conjectures in symplectic topology, the Arnold or Arnold-Givental conjecture, states that a Lagrangian submanifold and its image under a Hamiltonian isotopy intersect at least as often as the sum of the $\mathbb{Z}_2$-Betti-numbers. For $T^n$, this sum is not zero, thus, using proposition \ref{prop:unitham}, Arnold's conjecture states in particular that $T^n$ should intersect with $UT^n$ at least once. While the Arnold conjecture is wrong in all generality and most cases are unknown, there is a positive result to the weaker question whether the torus intersects with its displaced version (c.f. \cite{bir04,cho04}). In order to formulate this result, we need the following:
\begin{dfn}
Let $(\mathcal{M},\omega)$ be a closed symplectic manifold with Hamiltonian symplectomorphisms $\mathrm{Ham}(\mathcal{M})$. A Lagrangian submanifold $\mathcal{L}\subset\mathcal{M}$ is called \emph{displaceable} by a Hamiltonian diffeomorphism, if there exists a $\psi\in\mathrm{Ham}(\mathcal{M})$ such that
\begin{align*}
	\mathcal{L}\cap\psi\mathcal{L}=\emptyset.
\end{align*}
\end{dfn}

The definition is slightly different from the one in \cite{bir04}, where the authors only consider nonempty open sets such that the restriction of $\omega$ to these sets is exact. However, they prove that the torus $T^n$ is displaceable in the above definition, if and only if there exists an open neighborhood $\mathcal{V}\supset T^n$ such that $\omega|_{\mathcal{V}}$ is exact and $\mathcal{V}$ is displaceable. With this we can state the final and crucial ingredient in the proof of the normal form:
\begin{thm}[\cite{bir04} theorem 1.3] \label{thm:thm13}
The Clifford torus $T^n\subset\mathbb{C}P^n$ cannot be displaced from itself by a Hamiltonian isotopy.
\end{thm}

Because every unitary matrix defines a Hamiltonian isotopy (see proposition \ref{prop:unitham} in the appendix), the theorem tells us in particular $T^n\cap UT^n\neq \emptyset$ for all unitaries $U\in U(n)$ so that together with lemma \ref{lem:reform} this proves the sought normal form:
\begin{thm} \label{thm:unitarynormal}
For every unitary matrix $U\in U(n)$ there exist two diagonal unitary matrices $L,R\in U(n)$ such that $A:=LUR$ fulfills $\sum_j A_{ji} =\sum_j A_{ij} =1$ for all $i=1,\ldots n$.
\end{thm}

\section{Equivalent normal forms for unitary matrices} \label{sec:derived}
To obtain equivalent normal forms, consider the $n\times n$ dimensional complex matrix $F_n$ with entries $(F_n)_{kl}:=\frac{1}{\sqrt{n}} \operatorname{exp}(\frac{2\pi i}{n} kl)$ with $k,l\in\{0,\ldots,n-1\}$, which is known as the \emph{discrete Fourier transformation}. It is easy to see that $F_n^{-1}=F^{\dagger}$, hence $F_n\in U(n)$. If we denote the standard basis of $\mathbb{C}^n$ by $\{e_i\}_{i=0}^{n-1}$ and $e:=(1,\ldots,1)^T$, then
\begin{align*}
	F_ne_0=F_n^{\dagger}e_0=\frac{e}{\sqrt{n}}.
\end{align*}
Now let $A\in U(n)$ be such that $Ae=A^Te=e$. Then
$
	F_n^{\dagger}AF_ne_0=e_0
$
and similarly, $(F_n^{\dagger}AF_n)^{T}e_0=F_nA^TF_n^{\dagger}e_0=e_0$, which shows that
\begin{align*}
	F_n^{\dagger}AF_n=\begin{pmatrix}{} 1 & 0_{n-1}^T \\ 0_{n-1} & \tilde{U} \end{pmatrix}
\end{align*}
where $0_{n-1}:= 0\in\mathbb{C}^{n-1}$ and $\tilde{U}\in U(n-1)$. Thus, given a unitary $U\in U(n)$, we know that there exists a decomposition
\begin{align}
	U=LF_n\begin{pmatrix}{} 1 & 0_{n-1}^T \\ 0_{n-1} & \tilde{U} \end{pmatrix}F_n^{\dagger}R
\end{align}
with $\tilde{U}\in U(n-1)$ and diagonal $L,R\in U(n)$. We can now iterate the procedure by applying it to the $(n-1)\times(n-1)$-dimensional submatrix $\tilde{U}$ and obtain the corollary:
\begin{cor} \label{cor:optics}
Let $U\in U(n)$, then there exist diagonal unitaries $D_1,\ldots,D_n$ and $\tilde{D}_1,\ldots,\tilde{D}_{n-1}$ and a $\varphi\in[0,2\pi)$ such that the first $i-1$ entries in each $D_i,\tilde{D}_i$ are equal to one and
\begin{align}
\begin{split}
	U&=D_1F_nD_2(\mathbbm{1}_1\oplus F_{n-1})D_3(\mathbbm{1}_2\oplus F_{n-2})\cdots \\
	&~~ D_{n-1}(\mathbbm{1}_{n-2}\oplus F_{2})D_n(\mathbbm{1}_{n-2}\oplus F_2^{\dagger})\tilde{D}_{n-1}\cdots (\mathbbm{1}_1\oplus F_{n-1}^{\dagger})\tilde{D}_2F_n^{\dagger}\tilde{D}_1 e^{i\varphi}.
\end{split}
\end{align}
\end{cor}
\begin{figure}[!t]
  \centering

   \includegraphics[width=0.8\columnwidth]{multiport.pdf}
  \caption{In quantum optics, passive transformations on $n$ modes are in one-to-one correspondence with $n\times n$ unitaries. Each unitary $U$ admits a decomposition into $2(n-1)$ canonical multiports (which are independent of $U$ and described by discrete Fourier transformations [hatched]) surrounded by $2n-1$ layers of single-mode phase shifters [grey]. Here, this is exemplified for $n=4$.}\label{multiport}
\end{figure}
In other words any unitary can be decomposed into diagonal unitaries and discrete Fourier transformations in this way. From the theorem, the first $k-1$ entries of the diagonal matrices $D_k,\tilde{D}_k$ are immediately known to be one. However one can achieve a better parameterisation by realizing that one can fix the first $k$ entries of $D_k,\tilde{D}_k$ to one for $k\leq n-1$, while absorbing all phases of the $k$-th entries of $D_k$ and $\tilde{D}_k$ into a diagonal unitary that replaces $D_n$ (this is immediately clear from a graphical representation as in Figure \ref{multiport}).

This decomposition has an immediate application in quantum optics, where any $n\times n$ unitary corresponds to a passive transformation on $n$ modes or a $2n-$multiport. In this scenario a diagonal unitary corresponds to a set of phase shifters, which are applied to the modes individually and the discrete Fourier transformation is known as canonical $2n$-multiport \cite{mat95}, which may be implemented by a symmetric fibre coupler. The structure of the corresponding decomposition is graphically depicted in Figure \ref{multiport}.

Another version of the normal form is found by using that $D$ is a diagonal matrix iff $FDF^{\dagger}$ is a \emph{circulant matrix}, i.e. $(FDF^{\dagger})_{i,j}=:\alpha_{i-j}\in\mathbb{C}$. Since the diagonal matrices form a group, so do the circulant matrices and we denote the group of $n\times n$ circulant matrices by $\mathrm{Circ}(n)$. Then:
\begin{cor}
Let $U\in U(n)$, then there exist $C_1,C_2\in\mathrm{Circ}(n)$ and $\tilde{U}\in U(n-1)$ such that
\begin{align}
	U=C_1\operatorname{diag}(1,\tilde{U})C_2.
\end{align}
\end{cor}
Let us finally discuss the question of uniqueness of these decompositions and to this end come back to the original normal form
\begin{align}
	U=e^{i\varphi}D_1AD_2 \label{eqn:nform},
\end{align}
where $D_1,D_2$ are unitary diagonal with $(D_i)_{11}=1$ and $A$ has row and column sums equal to 1. Counting parameters, using that the matrices $A$ are isomorphic to $U(n-1)$ as proven above, we have:
\begin{align*}
	1+(n-1)+(n-1)^2+(n-1)=n^2
\end{align*}
parameters (c.f. \cite{vos14a}). Hence, the number of parameters matches exactly the dimension of $U(n)$. Given a unitary $U=e^{i\varphi}D_1AD_2$ as above, this means that it might be reasonable to expect only a discrete set of different decompositions or at least a discrete set of $A$ that $U$ can be scaled to. The exact number of different $A$ can easily be seen to be two for the case $n=2$ (c.f. \cite{vos14a}), but already for $n=3$ and $n=4$, there is only a conjectured bound (6 and 20, c.f. \cite{shc13}).

In \cite{cho04} it is proven that if $T^n$ and $UT^n$ intersect transversally, their number of distinct intersection points must be at least $2^n$, which follows from general results in Floer-homology theory when applied to Lagrangian intersection theory. Since transversality is a generic property for intersections, one might therefore conjecture that for a generic unitary $U\in U(n)$ \cite{cho04} implies a lower bound $2^{n-1}$ on the number of different normal forms. However, it is not true that we always have a discrete number of decompositions or (in contrast to the $2\times 2$ case) at least a discrete number of $A$ such that $A$ has row and column-sums equal to one and $e^{i\varphi}LAR=U$. A counterexample is given by the Fourier transform in $4\times 4$ dimensions, where we have for any $\varphi\in[0,2\pi)$:\footnote{We thank the anonymous referee for providing this counterexample.}

\begin{align}
	\begin{split} \frac{1}{2}
		\begin{pmatrix}{} 1 &  1 &  1 &  1 \\
			1 &  i & -1 & -i \\
			1 & -1 &  1 & -1 \\
			1 & -i & -1 &  i
		\end{pmatrix}
		= \begin{pmatrix}{} 1 & 0 & 0 & 0 \\
			0 & e^{i\varphi} & 0 & 0 \\
			0 & 0 & 1 & 0 \\
			0 & 0 & 0 & -e^{-i\varphi} \\
		\end{pmatrix}\cdot \\ \frac{1}{2}
		\begin{pmatrix}{} 1 &  -ie^{i\varphi} &  1 &  ie^{i\varphi} \\
			e^{-i\varphi} &  1 & -e^{-i\varphi} & 1 \\
			1 & ie^{i\varphi} &  1 & -ie^{i\varphi} \\
			-e^{-i\varphi} & 1 & e^{i\varphi} &  1
		\end{pmatrix} \cdot
		\begin{pmatrix}{} 1 & 0 & 0 & 0 \\
			0 & ie^{-i\varphi} & 0 & 0 \\
			0 & 0 & 1 & 0 \\
			0 & 0 & 0 & -ie^{i\varphi}
		\end{pmatrix}
	\end{split}
\end{align}

After completion of this document, we learned that part of this section, in particular corollary \ref{cor:optics} were independently found in \cite{vos14b}.

\section{Conclusion}
We have studied a variant of a Sinkhorn type normal form for unitary matrices. Its existence was conjectured in \cite{vos14a} and we give a nonconstructive proof. This means in particular that the question, whether the algorithm presented in \cite{vos14a} always converges for any set of starting conditions, remains open. Also, it would be nice to have an elementary proof of the fact that for any unitary matrix $U$ we have $T^n\cap UT^n\neq \emptyset$. The decomposition is in not unique: We provided an example where, contrary to the $2\times 2$-case, there is a one-parameter set of $A$ as well as $L$ and $R$, such that $LAR=U$. We suggested an argument that the number of different decompositions, if it is discrete, might grow exponentially. However this lower bound relies on a lower bound on Lagrangian intersections which holds only for transversal intersections.

\subsection*{Acknowledgements}
We thank Michael Keyl for many helpful comments on the parts involving symplectic topology. M. Idel is supported by the Studienstiftung des deutschen Volkes. M. Wolf acknowledges support from the CHIST-ERA/BMBF project CQC.

\bibliographystyle{alpha}

Mathematical Physics (math-ph); Quantum Physics (quant-ph)