1 %
2 % Standard operations from linear algebra.
3 %
4 \ifx\havemjolinearalgebra\undefined
5 \def\havemjolinearalgebra{1}
8 \ifx\lvert\undefined
9 \usepackage{amsmath} % \lvert, \rVert, etc. and \operatorname.
10 \fi
12 \ifx\ocircle\undefined
13 \usepackage{wasysym}
14 \fi
16 \ifx\clipbox\undefined
17 % Part of the adjustbox package; needed to clip the \perp sign.
18 \usepackage{trimclip}
19 \fi
21 \input{mjo-common} % for \of, at least
23 % Absolute value (modulus) of a scalar.
24 \newcommand*{\abs}{\left\lvert{#1}\right\rvert}
26 % Norm of a vector.
27 \newcommand*{\norm}{\left\lVert{#1}\right\rVert}
29 % The inner product between its two arguments.
30 \newcommand*{\ip}{\left\langle{#1},{#2}\right\rangle}
32 % The tensor product of its two arguments.
33 \newcommand*{\tp}{ {#1}\otimes{#2} }
35 % The Kronecker product of its two arguments. The usual notation for
36 % this is the same as the tensor product notation used for \tp, but
37 % that leads to confusion because the two definitions may not agree.
38 \newcommand*{\kp}{ {#1}\odot{#2} }
40 % The adjoint of a linear operator.
43 % The transpose'' of a linear operator; namely, the adjoint, but
44 % specialized to real matrices.
45 \newcommand*{\transpose}{ #1^{T} }
47 % The Moore-Penrose (or any other, I guess) pseudo-inverse of its
48 % sole argument.
49 \newcommand*{\pseudoinverse}{ #1^{+} }
51 % The trace of an operator.
52 \newcommand*{\trace}{ \operatorname{trace}\of{{#1}} }
54 % The diagonal matrix whose only nonzero entries are on the diagonal
55 % and are given by our argument. The argument should therefore be a
56 % vector or tuple of entries, by convention going from the top-left to
57 % the bottom-right of the matrix.
58 \newcommand*{\diag}{\operatorname{diag}\of{{#1}}}
60 % The "rank" of its argument, which is context-dependent. It can mean
61 % any or all of,
62 %
63 % * the rank of a matrix,
64 % * the rank of a power-associative algebra (particularly an EJA),
65 % * the rank of an element in a Euclidean Jordan algebra.
66 %
67 \newcommand*{\rank}{ \operatorname{rank}\of{{#1}} }
70 % The span of'' operator. The name \span is already taken.
71 \newcommand*{\spanof}{ \operatorname{span}\of{{#1}} }
73 % The co-dimension of'' operator.
74 \newcommand*{\codim}{ \operatorname{codim} }
76 % The orthogonal projection of its second argument onto the first.
77 \newcommand*{\proj} { \operatorname{proj}\of{#1, #2} }
79 % The set of all eigenvalues of its argument, which should be either a
80 % matrix or a linear operator. The sigma notation was chosen instead
81 % of lambda so that lambda can be reserved to denote the ordered tuple
82 % (largest to smallest) of eigenvalues.
83 \newcommand*{\spectrum}{\sigma\of{{#1}}}
84 \ifdefined\newglossaryentry
85 \newglossaryentry{spectrum}{
86 name={\ensuremath{\spectrum{L}}},
87 description={the set of all eigenvalues of $L$},
88 sort=s
89 }
90 \fi
92 % The reduced row-echelon form of its argument, a matrix.
93 \newcommand*{\rref}{\operatorname{rref}\of{#1}}
94 \ifdefined\newglossaryentry
95 \newglossaryentry{rref}{
96 name={\ensuremath{\rref{A}}},
97 description={the reduced row-echelon form of $A$},
98 sort=r
99 }
100 \fi
102 % The Automorphism group of'' operator.
103 \newcommand*{\Aut}{ \operatorname{Aut}\of{{#1}} }
105 % The Lie algebra of'' operator.
106 \newcommand*{\Lie}{ \operatorname{Lie}\of{{#1}} }
108 % The write a matrix as a big vector'' operator.
109 \newcommand*{\vectorize}{ \operatorname{vec}\of{{#1}} }
111 % The write a big vector as a matrix'' operator.
112 \newcommand*{\matricize}{ \operatorname{mat}\of{{#1}} }
114 % An inline column vector, with parentheses and a transpose operator.
115 \newcommand*{\colvec}{ \transpose{\left({#1}\right)} }
117 % Bounded linear operators on some space. The required argument is the
118 % domain of those operators, and the optional argument is the
119 % codomain. If the optional argument is omitted, the required argument
120 % is used for both.
121 \newcommand*{\boundedops}[]{
122 \mathcal{B}\of{ {#2}
123 \if\relax\detokenize{#1}\relax
124 {}%
125 \else
126 {,{#1}}%
127 \fi
128 }
129 }
132 %
133 % Orthogonal direct sum.
134 %
135 % First declare my perp in a circle'' operator, which is meant to be
136 % like an \obot or an \operp except has the correct weight circle. It's
137 % achieved by overlaying an \ocircle with a \perp, but only after we
138 % clip off the top half of the \perp sign and shift it up.
139 \DeclareMathOperator{\oplusperp}{\mathbin{
140 \ooalign{
141 $\ocircle$\cr
142 \raisebox{0.625\height}{$\clipbox{0pt 0pt 0pt 0.5\height}{$\perp$}$}\cr
143 }
144 }}
146 % Now declare an orthogonal direct sum in terms of \oplusperp.
147 \newcommand*{\directsumperp}{ {#1}\oplusperp{#2} }
150 % The space of real symmetric n-by-n matrices. Does not reduce to
151 % merely "S" when n=1 since S^{n} does not mean an n-fold cartesian
152 % product of S^{1}.
153 \newcommand*{\Sn}[n]{ \mathcal{S}^{#1} }
154 \ifdefined\newglossaryentry
155 \newglossaryentry{Sn}{
156 name={\ensuremath{\Sn}},
157 description={the set of $n$-by-$n$ real symmetric matrices},
158 sort=Sn
159 }
160 \fi
162 % The space of complex Hermitian n-by-n matrices. Does not reduce to
163 % merely "H" when n=1 since H^{n} does not mean an n-fold cartesian
164 % product of H^{1}. The field may also be given rather than assumed
165 % to be complex; for example \Hn\of{\mathbb{O}} might denote the
166 % 3-by-3 Hermitian matrices with octonion entries.
167 \newcommand*{\Hn}[n]{ \mathcal{H}^{#1} }
168 \ifdefined\newglossaryentry
169 \newglossaryentry{Hn}{
170 name={\ensuremath{\Hn}},
171 description={the set of $n$-by-$n$ complex Hermitian matrices},
172 sort=Hn
173 }
174 \fi
177 \fi