# notation to avoid repetition in matrix expressions (e.g xx' and x'Ax)

Is there a notation to express expressions such as

$x^{T}Ax$, $xx^{T}$, $X^TAX$

with only one instance of $x$, or $X$ appearing in each case? This is to reduce repetition, which becomes more severe when in place of $x$ or $X$ is a longer expression.

For $x^{T}Ax$, I have seen $||x||_{A}^2$, which I like, despite possibly being misleading in the cases where it is not a norm (if $A$ is not positive definite).

## 3 Answers

There are quadratic forms:

For a matrix $A$ and a real vector $x$, the expression $x^TAx$ can be written with the help of the scalar product as $(x,Ax)$.

Thus, for any given real matrix $T$ we can define a function $t$ $$t: \mathbb R^n \rightarrow \mathbb R\\ x \mapsto (x,Tx)=:t[x].$$

We call $t$ a quadratic form. This can be generalized to complex spaces (just take the appropriate scalar product). And it's worth noting that not every quadratic form corresponds with a positive definite matrix. $x\mapsto\|x\|^2$ corresponds to the identity operator.

This notation is used, for example in Kato: Perturbation Theory for Linear Operators.

Forms are usually assumed to be scalar-valued, so $X^TAX$ does not fit into this framework.

• Thank you for the answer, however I don't think it is what I am looking for. This notation is not "inline". I am trying to write, for example, $(x+y)^TA(x+y)$ without so much repetition. If I'm going to introduce a new name, I might as well do $t = x+y$ and $t^{T}At$.
– Gus
Mar 22, 2017 at 22:19
• How about this: At some point you define the notation $q_A[x]:=x^TAx$. Then you can write your term as $q_A[x+y]$ ($q$ for quadratic). Insert any other matrix $B$ and a vector $z$ for $q_B[z]$. Mar 22, 2017 at 22:23

To reduce repetition, you should denote reused operations as operators, e.g. $$\mathcal{A}(X) := X^TAX$$ or $$\mathcal{X}A := X^TAX$$ and then use $\mathcal{A}(X)$ or $\mathcal{X}A$ everywhere. Note that I didn't use braces in the second case, because since $\mathcal{X}$ is a linear operator (over matrices), it is common to write it like a multiplier.

Also, for $xx^T$ you could use (not quite common) tensor notation: $$xx^T = x\otimes x = x^{\otimes2}$$

$xx^T$ is a tricky one since we don't want to confuse it with $x^Tx$

Generally a good idea is to write matrices with capital letters and vectors with lowercase.

Another idea I'm being taught that is especially useful when writing on paper or when using scalars, vectors and matrices together is to underline vectors once and matrices twice.

So like $\underline{\underline{A}} \in \mathbb{R}^{nxn}$ and $\underline x \in \mathbb{R}^n$.

Back to your original question.

If you have $x \in \mathbb{R}^n$ and $A \in \mathbb{R}^{nxn}$ you might want to define the following notation:

1.) $x^2:=x^Tx$ since this is a scalar now.

2.) $X:=xx^T$ since this is a matrix now.

3.) $x^A:=x^TAx$ this can't be confused easily since vector to the power of matrix doesn't make sense normally.

And for your last one $X^TAX$ I'd recommend to follow #3 and to define $X^A:=X^TAX$ here we need to care about number #2. But we want to avoid to use x and X at the same time if they have nothing in common. On the other hand if you want to write $(xx^T)^TAxx^T = xx^TAxx^T =: X^A$ this notation would be useful.