0

In GAP, I would like to check if a vector $v$ has a non-vanishing overlap with a given subspace $U$.

Consider a linear subspace $U \subset V$ and its complement $U^\perp$ with respect to a non-degenerate inner product. Thus one has $U + U^\perp = V$. Given a vector $v \in V$, one can then always write it as $v = v_U + v_{U^\perp}$ with $v_U \in U$ and $v_{U^\perp} \in U^\perp$. Using GAP, I would like to determine if $v_{U} \neq 0$. (For my case, I mostly care about $V=\mathbb{R}^n$ with the euclidean inner product or $V=\mathbb{C}$ with the hermitian inner product.)

This is the case if $v^T \Pi_U v > 0$ holds, where $\Pi_U$ is the orthogonal projection operator onto the subspace $U$ and $v^T$ the transpose of $v$. However, I could not find a method in the documentation with which this projection operator is easily constructed.

Have I overlooked something; are there easier ways to check if a vector has "support" on some given subspace?

  • Maybe you could be a little more precise. what do you mean by "support" or "non-vanishing overlap". Also, the orthogonal projection is with respect to what subspace, or are you in $\mathbb R^n$ where you have a natural inner product? – David Jaramillo Oct 08 '19 at 17:38
  • Thanks for the comment, I tried to clarify the question above. – Felix Huber Oct 08 '19 at 19:27
  • 2
    Is your space a row space over a field? If so, you would compute a basis for $U^\perp$ (Which is basically a nullspace), extend it to a basis of the whole space, the base change matrix will give you the projection. There isn’t a ready command for it but NullspaceMat, TriangulizedMat and RankMat will make such functionality easy to build. – ahulpke Oct 09 '19 at 15:50
  • Thanks, I will try this. – Felix Huber Oct 09 '19 at 16:26

1 Answers1

1

This answers the question of how to determine if a vector has support on a given subspace $U$. It does not answer how to construct an orthogonal projection operator onto $U$.

The simple answer is that is suffices to know a basis that spans $U$. In particular, the basis is not required to be orthonormal.

Let $\{a_i\}_{i=1}^K$ be such (non-orthonormalized) basis. The following operator is positive definite and has support on the whole of $U$

$$M_U = \sum_i^K a_i a_i^T\,.$$

(for complex vector spaces, replace the transpose $a_i^T$ by the complex conjugate transpose $a_i^\dagger$).

It is straightforward to see (diagonalize $M$) that $v$ has support on subspace $U$ if and only if

$$v^T M_U v > 0\,.$$