From e5d2cf2e1129b54516407a394d5d8f1eead3b10c Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 6 Sep 2025 19:34:11 -0400 Subject: [PATCH] mjo-linear_algebra.tex: add the no-argument form of \trace --- examples.tex | 10 ++++++---- mjo-linear_algebra.tex | 10 ++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/examples.tex b/examples.tex index e9b409d..0e6191d 100644 --- a/examples.tex +++ b/examples.tex @@ -203,10 +203,12 @@ 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 diff --git a/mjo-linear_algebra.tex b/mjo-linear_algebra.tex index 2b43317..04dc7a2 100644 --- a/mjo-linear_algebra.tex +++ b/mjo-linear_algebra.tex @@ -53,8 +53,14 @@ % 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 -- 2.49.0