\section{POWER Matrix Power Operator}

\subsection{Usage}

The power operator for scalars and square matrices.  This operator is really a 
combination of two operators, both of which have the same general syntax:
\begin{verbatim}
  y = a ^ b
\end{verbatim}
The exact action taken by this operator, and the size and type of the output, 
depends on which of the two configurations of \verb|a| and \verb|b| is present:
\begin{enumerate}
\item  \verb|a| is a scalar, \verb|b| is a square matrix

\item  \verb|a| is a square matrix, \verb|b| is a scalar

\end{enumerate}
\subsection{Function Internals}

In the first case that \verb|a| is a scalar, and \verb|b| is a square matrix, the matrix power is defined in terms of the eigenvalue decomposition of \verb|b|.  Let \verb|b| have the following eigen-decomposition (problems arise with non-symmetric matrices \verb|b|, so let us assume that \verb|b| is symmetric):
\[
  b = E \begin{bmatrix} \lambda_1 & 0          & \cdots  & 0 \\
                              0   & \lambda_2  &  \ddots & \vdots \\
                              \vdots & \ddots & \ddots & 0 \\
                              0   & \hdots & 0 & \lambda_n \end{bmatrix}
      E^{-1}
\]
Then \verb|a| raised to the power \verb|b| is defined as
\[
  a^{b} = E \begin{bmatrix} a^{\lambda_1} & 0          & \cdots  & 0 \\
                              0   & a^{\lambda_2}  &  \ddots & \vdots \\
                              \vdots & \ddots & \ddots & 0 \\
                              0   & \hdots & 0 & a^{\lambda_n} \end{bmatrix}
      E^{-1}
\]
Similarly, if \verb|a| is a square matrix, then \verb|a| has the following eigen-decomposition (again, suppose \verb|a| is symmetric):
\[
  a = E \begin{bmatrix} \lambda_1 & 0          & \cdots  & 0 \\
                              0   & \lambda_2  &  \ddots & \vdots \\
                              \vdots & \ddots & \ddots & 0 \\
                              0   & \hdots & 0 & \lambda_n \end{bmatrix}
      E^{-1}
\]
Then \verb|a| raised to the power \verb|b| is defined as
\[
  a^{b} = E \begin{bmatrix} \lambda_1^b & 0          & \cdots  & 0 \\
                              0   & \lambda_2^b  &  \ddots & \vdots \\
                              \vdots & \ddots & \ddots & 0 \\
                              0   & \hdots & 0 & \lambda_n^b \end{bmatrix}
      E^{-1}
\]
\subsection{Examples}

We first define a simple \verb|2 x 2| symmetric matrix
\begin{verbatim}
--> A = 1.5
A = 
  <double>  - size: [1 1]
 1.5  
--> B = [1,.2;.2,1]
B = 
  <double>  - size: [2 2]
 
Columns 1 to 2
 1.0  0.2  
 0.2  1.0  

\end{verbatim}
First, we raise \verb|B| to the (scalar power) \verb|A|:
\begin{verbatim}
--> C = B^A
C = 
  <double>  - size: [2 2]
 
Columns 1 to 2
 1.01503794540616554  0.29949619260623284  
 0.29949619260623300  1.01503794540616576  

\end{verbatim}
Next, we raise \verb|A| to the matrix power \verb|B|:
\begin{verbatim}
--> C = A^B
C = 
  <double>  - size: [2 2]
 
Columns 1 to 2
 1.50493476200956966  0.12177289478697811  
 0.12177289478697809  1.50493476200956966  

\end{verbatim}
