%Symmetrize and antisymmetrize; occupation-number basis.  Normalizations.

%% ================================================================
\newpage
\section{Linear algebra}
\label{appx:la}

%% ----------------------------------------------------------------
\subsection{Convention for complex inner products}
\label{sec:physics_ip}

Recall that in complex vector spaces $V$ we must conjugate one argument in
order to get positive definiteness\index{positive definite} of the
\plainidx{inner product}.  (The complex inner product is said to be
\bfidx{sesquilinear} rather than \bfidx{bilinear}.) That is, for $c \in \C$ and
$\xi, \psi \in V$, we have either the \bfidx{physicists' convention}
$$
	\inner{c\xi}{\psi} = c^* \inner{\xi}{\psi}
	\qqand
	\inner{\xi}{c\psi} = c \inner{\xi}{\psi}
$$
or the \bfidx{mathematicians' convention}
$$
	\inner{c\xi}{\psi} = c \inner{\xi}{\psi}
	\qqand
	\inner{\xi}{c\psi} = c^* \inner{\xi}{\psi}.
$$
For this paper we use the physicists' convention.

\begin{defn}
\label{defn:norm}
Recall that the \bfidx{norm} of a vector is
$$
	\|\psi\| = \inner{\psi}{\psi}^{1/2}
$$
which is to say
$$
	\|\psi\|^2 = \inner{\psi}{\psi}.
$$
\end{defn}

What, tangibly, is an inner product?  It can take various forms, as long as it
satisfies the inner-product axioms (positive-definiteness, conjugate-symmetry,
and sesquilinearity).  Two important examples are:
\begin{itemize}

\item For an $L^2$ space $\msH$ with measure $d\mu$ we write
$$
	\langle f, g \rangle = \int_\msH \overline{f} \, g \; d\mu.
$$
In particular, for $\msH = [0,L]$ with periodic boundary conditions and
Lebesgue measure,
$$
	\langle f, g \rangle = \frac{1}{L} \int_0^L \overline{f}\,g\;dx.
$$
The $1/L$ scale factor is not required to make an inner product (any non-zero
scale factor would do).  With the $1/L$, though, the functions $\{e^{i2\pi
kx/L}\}_{k \in \Z}$ form an orthonormal set.

\item For $\C^N$, with
$$
	\vecu = \colvecthree{u_1}{\vdots}{u_N}
	\qqand
	\vecv = \colvecthree{v_1}{\vdots}{v_N},
$$
we use
$$
	\langle \vecu, \vecv \rangle = \sum_{j=1}^N \overline{u_j} v_j.
$$

\end{itemize}

%% ----------------------------------------------------------------
\subsection{Matrix notation}
\label{sec:mx_notation}

One may think of a \bfidx{column vector} and a \bfidx{row vector} in
$\C^N$ as an $N \times 1$ matrix and a $1 \times N$ matrix, respectively:
$$
	\psi = \colvecthree{c_1}{\vdots}{c_N}
	\qqand
	\psi^* = \colvecthree{c_1}{\cdots}{c_N}
$$
In fact, this point of view makes Dirac notation (below) clear and intuitive.

%% ----------------------------------------------------------------
\subsection{Bra-ket notation}

Notation\index{Dirac notation} due to Paul Dirac, and firmly entrenched in the
physics community, is as follows.  Let $\{\phi_1, \ldots, \phi_N\}$ be a basis
for an $N$-dimensional complex vector space $V$.  Then vectors $\psi$ are
sometimes written
$$
	\ket{\psi}.
$$
The basis vectors
$$
	\phi_1, \phi_2, \ldots, \phi_N
$$
are sometimes written simply as the \bfidx{ket}
$$
	\ket{1}, \ket{2}, \ldots, \ket{N}.
$$
For example, in $\C^2$ the standard basis is
$$
	\ket{1} = \colvectwo{1}{0}, \quad
	\ket{2} = \colvectwo{0}{1}.
$$
Of course, if the basis vectors are numbered
$$
	\ket{0}, \ket{1}, \ldots, \ket{N-1}.
$$
then we would instead have (with $N=2$)
$$
	\ket{0} = \colvectwo{1}{0}, \quad
	\ket{1} = \colvectwo{0}{1}.
$$

Since the dot product $\inner{\xi}{\psi}$ may be written written with
respect to an orthonormal basis as the matrix product
$$
	\xi^* \psi,
$$
e.g.
$$
	\colvecthree{a_1}{\vdots}{a_N}
	\cdot
	\colvecthree{b_1}{\vdots}{b_N}
	=
	\rowvecthree{a_1^*}{\ldots}{a_N^*}
	\colvecthree{b_1}{\vdots}{b_N}
	= \sum_{j=1}^N a_j^* b_j,
$$
we write the \plainidx{conjugate transpose} row vector, or \bfidx{bra}, as
$$
	\bra{\psi} \quad = \quad \ket{\psi}^*.
$$
Then the inner product
$$
	\inner{\xi}{\psi}
$$
is written by putting the bra and ket together as a \bfidx{bra-ket},
or bracket:
$$
	\braket{\xi}{\psi}
$$

Now let's put a matrix in the picture.  Let $M \in \C^{N,N}$ be
$$
	M = \prmatrix{
		m_{11} & \cdots & m_{1N} \\
		\vdots &        & \vdots  \\
		m_{N1} & \cdots & m_{NN} \\
	}.
$$
Then $M\psi$ is another vector, with entries
$$
	(M \psi)_i = \sum_{j=1}^N m_{ij} b_j,
$$
so
\begin{align*}
	\braket{\xi}{M\psi}
		&= \sum_{i=1}^N \overline{a_i} (M\psi)_i
		= \sum_{i,j=1}^N m_{ij} \overline{a_i} b_j.
\end{align*}
Likewise,
$$
	(M \xi)_j = \sum_{i=1}^N m_{ji} a_i,
$$
so
\begin{align*}
	\braket{M \xi}{\psi}
		&= \sum_{j=1}^N \overline{(M \xi)_j} b_j
		= \sum_{i,j=1}^N
		\overline{m_{ji}} \, \overline{a_i} \, b_j.
\end{align*}
In the particular case $M=M^*$, i.e. $m_{ij} = \overline{m_{ji}}$, then
$$
	\braket{\xi}{M\psi} = \braket{M\xi}{\psi}
$$
and we write that complex number as
$$
	\braCket{\xi}{M}{\psi}.
$$

%% ----------------------------------------------------------------
\subsection{Outer products}

\begin{defn}
\label{defn:outer_product}
If
$$
	\xi = \sum_{i=1}^N a_i \phi_i
	\qqand
	\psi = \sum_{j=1}^N b_j \phi_j
$$
are elements\footnote{One can do this for $\C^M$ and $\C^N$, although we won't
need that for this paper.} of $\C^N$, written as a linear combination of a
basis $\{\phi_1, \ldots, \phi_N\}$, then the \bfidx{outer product} of $\xi$
and $\psi$ with itself, written
$$
	\ket{\xi}\bra{\psi},
$$
is the $N \times N$ matrix with elements
$$
	a_i b_j^*.
$$
\end{defn}

\beginex
If
$$
	\psi = \colvecthree{1}{0}{0}
$$
then
$$
	\ket{\psi}\bra{\psi} = \pcmatrix{1&0&0\\0&0&0\\0&0&0}.
$$
\mendex

The intuition is that an outer product is a \emphidx{deferred inner product
operator}.  For example, let $\xi,\phi,\psi \in \C^2$.  Then we may write
the vector $\ket\xi \braket\phi\psi$ as the product of three matrices.
By associativity of matrix multiplication, we can do the product
$\braket\phi\psi$ first:
$$
	\ket\xi [\braket\phi\psi] =
	\colvecthree{\xi_1}{\vdots}{\xi_N}
	\left[
	\rowvecthree{\phi_1^*}{\cdots}{\phi_N^*}
	\colvecthree{\psi_1}{\vdots}{\psi_N}
	\right].
$$
On the other hand, we could do the product $\ket\xi\bra\phi$ first:
$$
	[\,\ket\xi \bra\phi\,] \ket\psi =
	\left[
	\colvecthree{\xi_1}{\vdots}{\xi_N}
	\rowvecthree{\phi_1^*}{\cdots}{\phi_N^*}
	\right]
	\colvecthree{\psi_1}{\vdots}{\psi_N}.
$$
This is why we conjugate the second operand's coefficients in the definition
of the outer product.

%% ----------------------------------------------------------------
\subsection{Self-adjoint operators}
\label{sec:self_adj}

Let $A$ be an \plainidx{operator}, i.e. \plainidx{linear transformation}, from
a complex vector space $V$ to itself\footnote{In fact, the adjoint is defined
for $A:V \to W$ to be an operator $A^*:W \to V$, but we won't need that here.}.
There are two ways to think of adjoint and self-adjoint operators:  the first
is coordinate-free and the second is coordinate-dependent.

%% ----------------------------------------------------------------
\subsubsection{Coordinate-free definition}

The \bfidx{adjoint} of $A$ is the unique operator $A^*$ such that for all
$\xi,\psi \in V$,
$$
	\inner{    \xi}{A \psi} =
	\inner{A^* \xi}{  \psi}.
$$
(It can be shown that the adjoint exists and is unique; we'll construct it
below.)
The operator $A$ is called \bfidx{self-adjoint} if $A=A^*$, i.e. for all
$\xi,\psi \in V$,
$$
	\inner{  \xi}{A \psi} =
	\inner{A \xi}{  \psi}.
$$
Using Dirac's bra-ket notation, we can write either
$$
	\inner{  \xi}{A \psi}
	\qqor
	\inner{A \xi}{  \psi}
$$
when $A$ is self-adjoint.  Since it doesn't matter, the convention is to
put the operator in the middle:
$$
	\braCket{\xi}{A}{\psi}.
$$

%% ----------------------------------------------------------------
\subsubsection{Coordinate-dependent construction}

The rule of thumb for computing adjoints is, as I heard at an AMS/MAA talk
recently, ``The adjoint of $A$ is whatever you have to do to $A$ to get it onto
the other side of the inner product.''  Let's do that.  I spent some scratch
paper playing around with summation symbols --- but then I realized it's easy
as long as we think of row vectors, matrices, and column vectors all as
matrices.  That is,
$$
	\inner{\xi}{A \psi} = \xi^* A \psi.
$$
For example, with $N=2$, we have
$$
	\rowvectwo{\xi_1^*}{\xi_2^*}
	\pcmatrix{A_{11} & A_{12} \\ A_{21} & A_{22}}
	\colvectwo{\psi_1}{\psi_2}.
$$
We know that for matrices $B$ and $C$, $(BC)^* = C^* B^*$.  So here we have
$$
	\inner{\xi}{A \psi}
	= \xi^* A \psi
	= (A^* \xi)^* \psi
	= \inner{A^* \xi}{\psi}.
$$
That is, the adjoint of the matrix $A$ is just its \bfidx{conjugate transpose}.
For example,
$$
	\prmatrix{1 & 2i \\ 3i & 4}^* =
	\prmatrix{1 & -3i \\ -2i & 4}.
$$
Then, when you are looking at coordinates, you can tell $A$ is self-adjoint if
it is \bfidx{Hermitian}, i.e. equal to its own conjugate transpose.
For example,
$$
	\prmatrix{1 & 2i \\ -2i & 3}^* =
	\prmatrix{1 & 2i \\ -2i & 3}
$$
so this matrix is self-adjoint.

We will see in section \ref{sec:spectral_theorem} that a self-adjoint operator
has an orthonormal eigenbasis.

%% ----------------------------------------------------------------
\subsection{Unitary operators}
\label{sec:unitary}

\begin{defn}
\label{defn:unitary}
An operator $A: V \to V$ is said to be \bfidx{unitary} if it is
norm-preserving, i.e. for all $\psi \in V$,
$$
	\|A\psi\| = \|\psi\|.
$$
In terms of definition \ref{defn:norm}, this means
that for all $\psi \in V$,
$$
	\inner{A\psi}{A\psi} = \inner{\psi}{\psi}.
$$	
\end{defn}

\begin{rem}
\label{rem:AA_unitary}
An alternate characterization of unitarity is
$$
	A^*A = I,
$$
which is to say
$$
	A^{-1} = A^*.
$$
\end{rem}

%% ----------------------------------------------------------------
\subsection{Matrix exponentials; Hermitian and unitary matrices}
\label{sec:mx_esp_hmn_unitary}

\begin{defn}
\label{defn:mx_exp}
The \bfidx{exponential}\index{matrix exponential} of $A:V \to V$
is defined to be
$$
	e^A = \sum_{k=0}^\infty \frac{A^k}{k!}
$$
where $A^0$ is the identity matrix.
\end{defn}
It can be shown that for finite-dimensional $V$, this sum converges for
all $A$.

\begin{rem}
\label{rem:mx_exp_diag}
Note in particular that if $A$ is diagonal, with entries
$$
	A = \pcmatrix{
		d_1 &        & & 0   \\
		    & \ddots & &     \\
		0   &        & & d_N
	},
$$
then $e^A$ is also diagonal with
$$
	e^A = \pcmatrix{
		e^{d_1} &        & & 0   \\
		    & \ddots & &     \\
		0   &        & & e^{d_N}
	}.
$$
In particular,
$$
	e^0 = I.
$$
\end{rem}

\begin{prop}
Exponential commutes with conjugate transpose.  That is,
$$
	(e^A)^* = e^{A^*}.
$$
\begin{proof}
Using formal manipulation of symbols, this can be justified by moving
the conjugate transpose through the power series term by term.
\end{proof}
\end{prop}

\begin{prop}
\label{prop:mx_exp_inv}
For $A:V \to V$,
$$
	e^{-A} = (e^A)^{-1}.
$$
\begin{proof}
This can also be proved using the power-series expansion.
\end{proof}
\end{prop}

\begin{prop}
\label{prop:exp_hmn_unitary}
If $A$ is Hermitian, then $e^{iA}$ is unitary.
\begin{proof}
Suppose $A$ is Hermitian.  Again using formal manipulation of symbols, and
using the characterization in remark \ref{rem:AA_unitary} as well as
proposition \ref{prop:mx_exp_inv},
$$
	(e^{iA})^* = e^{(iA)^*}
	= e^{-iA^*}
	= e^{-iA}
	= (e^{iA})^{-1}.
$$
\end{proof}
\end{prop}

%$$
%	U(t)^* = U(t)^{-1}.
%$$
%Using formal manipulation of symbols [xxx OK in the fin-dim
%case where we needn't worry about unboundedness of $H$]:
%$$
%	U^* = (e^{-iHt/\hbar})^*
%	= e^{(-iHt/\hbar)^*}
%	= e^{+iH^*t/\hbar}
%	= e^{+iHt/\hbar}
%	= e^{-i H\cdot(-t)/\hbar}
%	= (e^{-i Ht/\hbar})^{-1}
%$$
%where we think of backward evolution undoing forward evolution.
%So
%$$
%	U(t)^*U(t) = I
%$$
%which is to say that $U$ is unitary.

%% ----------------------------------------------------------------
\subsection{The finite-dimensional spectral theorem}
\label{sec:spectral_theorem}

\begin{thm}[The finite-dimensional spectral theorem]
Let\index{finite-dimensional spectral theorem}\index{spectral theorem}
$V$ be a finite-dimensional complex vector space, and let $A:V \to V$ be a
Hermitian operator.  Then
\begin{itemize}
\item[(i)]   The eigenvalues of $A$ are all real, and
\item[(ii)]  the eigenvectors of $A$ form an orthonormal basis for $V$.
\end{itemize}
\begin{proof}
(Proofs follow \cite{bib:wik} and appendix of \cite{bib:griffiths}.)

\textbf{Part (i).}
Suppose $A\phi = \lambda \phi$.  Then
\begin{align*}
	\inner{\phi}{A \phi} &= \inner{\phi}{\lambda \phi}
		= \lambda \inner{\phi}{\phi}.
\end{align*}
But since $A$ is Hermitian, we also have
\begin{align*}
	\inner{\phi}{A \phi} &= \inner{A \phi}{\phi}
	= \inner{\lambda \phi}{\phi} = \lambda^* \inner{\phi}{\phi}.
\end{align*}
Eigenvectors are never zero, and only the zero vector has norm zero, so in
$$
	\lambda\inner{\phi}{\phi} = \lambda^*\inner{\phi}{\phi}
$$
we can divide by $\inner{\phi}{\phi}$ to conclude
$$
	\lambda=\lambda^*,
$$
which is to say that $\lambda$ is real.

\textbf{Part (ii).}
This has two subparts:  that the eigenvectors of $A$ span $V$, and that
they are orthogonal.  (Normality can be obtained by scaling the eigenvectors to
have norm 1.)  Both subparts are sketched at once in \cite{bib:wik}, but a
little abstractly.  I'll show this (completing the sketch) but I'll also
include Griffith's very concrete proof of orthogonality.

Taking as given that any operator on a complex vector space has at least one
eigenvector (this follows from the fundamental theorem of algebra applied to
the \plainidx{characteristic polynomial} $\det(A-\lambda I)$), let $\phi_1$ be
an eigenvector of $A$ with eigenvalue $\lambda_1$.  Let $V_1$ be the
\plainidx{eigenspace} of $\phi_1$, i.e. the span of $\{\phi_1\}$, and consider
the \plainidx{perpendicular space} (or \plainidx{orthogonal complement})
$$
	V_1^\perp = \{\psi \in V: \inner{\phi_1}{\psi} = 0\}.
$$
We claim that $V_1^\perp$ is an invariant subspace of $A$.  To prove this
claim, we need to show that if $\psi\in V_1^\perp$, then $A\psi \in V_1^\perp$.
Let $\psi\in V_1^\perp$, i.e. $\inner{\phi_1}{\psi} = 0$.  Then
$$
	\inner{\phi_1}{A\psi}
	= \inner{A\phi_1}{\psi}
	= \lambda_1 \inner{\phi_1}{\psi}
	= 0.
$$
Now inductively apply this argument to $V_1^\perp$.

%has at least one eigenvector. Now if A is Hermitian with eigenvector e1, we can
%consider the space K = span{e1}^\perp, the orthogonal complement of e1 . By
%Hermiticity, K is an invariant subspace of A. Applying the same argument to K
%shows that A has an eigenvector e2 . K. Finite induction then finishes the
%proof.

Here's Griffith's bit on orthogonality:  Suppose we have two eigenvectors
$\phi$ and $\psi$, with distinct eigenvalues $\lambda\ne\mu$, respectively.
Then
\begin{align*}
	\inner{\phi}{A\psi}
	= \inner{\phi}{\mu\psi}
	= \mu\inner{\phi}{\psi}.
\end{align*}
But since $A$ is Hermitian, and recalling that $\lambda$ and $\mu$ are
both real by part (i), we also have
\begin{align*}
	\inner{\phi}{A\psi}
	= \inner{A\phi}{\psi}
	= \inner{\lambda\phi}{\psi}
	= \lambda\inner{\phi}{\psi}.
\end{align*}
These two things are equal so we have
\begin{align*}
	\lambda\inner{\phi}{\psi} &= \mu\inner{\phi}{\psi} \\
	(\lambda-\mu)\inner{\phi}{\psi} &= 0.
\end{align*}
Since $\lambda\ne\mu$, the first factor is non-zero, and so the second factor
must be zero.  This means that
$$
	\phi \perp \psi.
$$

Note that this applies only for $\lambda\ne\mu$.  In the \plainidx{degenerate}
case, i.e. when an eigenvalue appears with multiplicity, we need to use
Gram-Schmidt to obtain an orthonormal basis for that eigenspace.
\end{proof}
\end{thm}

%xxx alternatively:  cite and follow Lax.  Expand vector $\vecx$ and $A\vecx$ in
%terms of eigenbasis.  Sum up.

% Wik article on spectral theorem (snippet):

% Let u = <v1>perp.
% then <u,v1>=0
% Claim invt:
% <Au,v1>=
% <u,Av1>=
% <u,lambda v1>=
% lambda <u,v1>=
% 0.
% Induct.

%\begin{prop}
%A Hermitian matrix has real eigenvalues and an orthonormal basis.
%\begin{proof}
%xxx cite and follow \cite{bib:lax}.  Expand vector $\vecx$ and $A\vecx$ in
%terms of eigenbasis.  Sum up.
%\end{proof}
%\end{prop}
