]> gitweb.michael.orlitzky.com - mjotex.git/commitdiff
mjo-linear_algebra.tex: add the no-argument form of \trace
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 6 Sep 2025 23:34:11 +0000 (19:34 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 6 Sep 2025 23:34:11 +0000 (19:34 -0400)
examples.tex
mjo-linear_algebra.tex

index e9b409d57b9d876fdaa4b869fdb8615de27eebac..0e6191ddf0ff02764277b370d7d55da40978c091 100644 (file)
     matrices $A$ and $B$ is $\kp{A}{B}$. The adjoint of the operator
     $L$ is $\adjoint{L}$, or if it's a matrix, then its transpose is
     $\transpose{L}$. Its trace is $\trace{L}$, and its spectrum---the
-    set of its eigenvalues---is $\spectrum{L}$. Another
-    matrix-specific concept is the Moore-Penrose pseudoinverse of $L$,
-    denoted by $\pseudoinverse{L}$. Finally, the rank of a matrix $L$
-    is $\rank{L}$. As far as matrix spaces go, we have the $n$-by-$n$
+    set of its eigenvalues---is $\spectrum{L}$. The trace can be used
+    as a standalone operator as well, by providing an empty argument
+    list, as in $\trace{} : V \to \Rn[1]$. Another matrix-specific
+    concept is the Moore-Penrose pseudoinverse of $L$, denoted by
+    $\pseudoinverse{L}$. Finally, the rank of a matrix $L$ is
+    $\rank{L}$. As far as matrix spaces go, we have the $n$-by-$n$
     real-symmetric and complex-Hermitian matrices $\Sn$ and $\Hn$
     respectively; however $\Sn[1]$ and $\Hn[1]$ do not automatically
     simplify because the ``$n$'' does not indicate the arity of a
index 2b43317ef0c3945255b9b6107d563fdd99d13453..04dc7a2201e10c7b0f1a5c9630fdb138ab960880 100644 (file)
 % sole argument.
 \newcommand*{\pseudoinverse}[1]{ #1^{+} }
 
-% The trace of an operator.
-\newcommand*{\trace}[1]{ \operatorname{trace}\of{{#1}} }
+% The trace of its sole argument, an operator. Provide an empty
+% argument list to get the trace operator itself.
+\newcommand*{\trace}[1]{%
+  \operatorname{trace}%
+  \if\relax\detokenize{#1}\relax\else%
+    \of{#1}%
+  \fi%
+}
 
 % The diagonal matrix whose only nonzero entries are on the diagonal
 % and are given by our argument. The argument should therefore be a