# How to visualise an anisometric (aka weighted Euclidan) space?

Let's say $S$ is a $2$-dimensional vector space over the field of the real numbers with a weighted inner product $$\langle x, y \rangle = x^\top Q y ,$$ where $Q$ is a positive-definite matrix. I want to "visualise" this space, so I can make sense of it.

When $Q$ is diagonal, $S$ is simply a version of $\mathbb{R}^2$ stretched along the Cartesian axes. This is easy to understand, so from now on assume $Q$ is not diagonal.

When $Q$ is not diagonal, it gets complicated, because two vectors that are perpendicular in $\mathbb{R}^2$, such as the standard basis vectors $e_1$ and $e_2$, are not perpendicular in the non-diagonal metric $Q$. In short, I have no idea how to make a mental picture of these vectors, or any other vector, in $S$.

One idea I have is to represent a vector $x$ in $\mathbb{R}^2$ along with a transformation $Tx$ which has the length and direction of $x$ in $S$, so I can see the difference between the two. Therefore, to find $T$, I think the first condition should be $$\begin{split} \lVert Tx \rVert &= \sqrt{x^\top Q x} \\ \lVert Tx \rVert^2 &= x^\top Q x \\ (Tx)^\top Tx &= x^\top Q x \\ x^\top T^\top Tx &= x^\top Q x \implies T^\top T = Q \end{split}$$ But then I don't know how to continue. In particular, I don't know how to find the direction of $Tx$. Where does it point to? To me it seems that the problem is undetermined, and maybe the whole idea is misguided.

• is $Q$ symmetric? Symmetric matrices can be orthogonally diagonalized Aug 7 '16 at 23:02
• @WillJagy Yes, it's symmetric. $Q$ has to be positive definite, otherwise the norm $\lVert x \rVert = \sqrt{\langle x, x \rangle} = \sqrt{x^\top Q x }$ would be undefined for some $x$. Aug 7 '16 at 23:17

-For simplicity, take the induced norm of the weighted inner product which is a quadratic function.

Let $$Q_s$$ and $$Q_{as}$$ be the symmetric and skewsymmetric part of Q, respectively. Then,

$$x^TQx=x^T(Q_s+Q_{as})x=x^TQ_sx$$

due to the fact that $$x^TQ_{as}x=x^TQ^T_{as}x=-x^TQ_{as}x\implies x^TQ_{as}x=0$$

What remains is the symmetric matrix that can be diagonalzed by the set of its eigen-vectors.

-Regarding your idea to find a transformation that preserves the magnitude and direction, this map is the identity only. And it is not helpful to change anything.

Instead of this you can search about a unitary transformation because it preserves the inner product value $$i.e$$. if U is unitary, then $$=$$.

In order to find a unitary transformation $$U$$ such that $$U^{-1}QU=D$$, Q must be normal matrix, where $$D$$ is diagonal.

A matrix $$Q$$ is said to be normal if $$Q^TQ=QQ^T$$.

A matrix $$U$$ is said to be unitary if $$U^T=U^{-1}$$

Regards,

Following up on Bilal's answer, the goal is to find a matrix $T$ such that $$\text{d}_Q(Tx, Ty) = \text{d}(x, y)$$ where $d_Q$ is the "Q" distance function and $d$ is the standard (i.e. Euclidean) distance function. (The original statement of the problem was wrong.)

So, we have $$\begin{split} (Tx-Ty)^\top Q (Tx-Ty) &= (x-y)^\top (x-y) \\ (x-y)^\top T^\top Q T (x-y) &= (x-y)^\top (x-y) \\ \end{split}$$ implying that $T^\top Q T = I$. Then it's clear that $T=Q^{-1/2}$. Since $Q$ is positive definite and thus orthogonally diagonalizable, we can find an orthogonal matrix $U$ and a diagonal matrix $S$ such that $Q=USU^\top$, and then we have $T=US^{-1/2}U^\top$.

For example, if $$Q= \begin{bmatrix} 2 & -1 \\ -1 & 3/2 \end{bmatrix} \quad\text{then}\quad T= \begin{bmatrix} .819 & .281 \\ .281 & .960 \end{bmatrix} .$$ Now we can represent graphically a series of vectors $x_1, x_2,\dots$ and $Tx_1,Tx_2,\dots$ whose lengths in the Euclidean metric and in the metric $Q$ respectively coincide (and so do the respective inner products). In the plot below we can see some lines in black. These lines are 1 unit of distance apart and form an orthogonal grid in the metric $Q$. For comparison see the same orthogonal grid in the Euclidean metric in light grey.