Tutorials › Linear Algebra › Testing Orthogonality with Inner Products

Orthogonal Sets and Gram-Schmidt · Tutorial 627 of 1000

Testing Orthogonality with Inner Products

Use inner products to test pairwise orthogonality, with careful checks for zero vectors and complex coordinates.

Intermediate 10 min read

What You'll Learn

  • Test every distinct pair in a finite list using its inner product.
  • Distinguish pairwise zero inner products from the nonzero-vector requirement for an orthogonal list.
  • Apply the coordinate formula for inner products in real spaces.
  • Use complex conjugation in the correct slot when testing vectors in \(\mathbb{C}^n\).
  • Identify common errors involving omitted pairs, zero vectors, and complex inner products.

What an Orthogonality Test Checks

To decide whether a list of vectors is orthogonal, the central calculation is an inner product for each pair of distinct entries. In a real coordinate space, these are dot products; in a complex coordinate space, the calculation must include complex conjugation. Checking only a convenient pair, or checking that some products vanish, is not enough: every distinct pair must pass the test.

Throughout, vectors in \(\mathbb{R}^n\) and \(\mathbb{C}^n\) are columns. In a real inner product space, the inner product is real-valued and symmetric. In a complex inner product space, we use the convention that the inner product is linear in its first slot and conjugate-linear in its second, so \(\langle \mathbf{u},\mathbf{v}\rangle=\overline{\langle \mathbf{v},\mathbf{u}\rangle}\). A vector is nonzero if it is not \(\mathbf{0}\).

Definition: A list \((\mathbf{v}_1,\dots,\mathbf{v}_p)\) in an inner product space is orthogonal if every vector in the list is nonzero and \(\langle \mathbf{v}_i,\mathbf{v}_j\rangle=0\) whenever \(i\ne j\). Such a list is orthonormal if it is orthogonal and every vector has norm \(1\). Two vectors are orthogonal when their inner product is zero.

The nonzero-vector condition is part of the definition of an orthogonal list. It is separate from the requirement that distinct pairs have inner product zero. For a list with one entry, there are no distinct pairs to test, but the entry must still be nonzero. For an empty list, both requirements hold vacuously. In computations, it is useful to check nonzeroness explicitly rather than assume it follows from the pair tests.

A Pair-by-Pair Testing Rule

Suppose a list has \(p\) entries. There are \(p(p-1)/2\) unordered pairs of distinct positions to check. For each one, compute the inner product and compare it with zero. If even one product is nonzero, the list is not orthogonal. If all are zero, also check that every vector is nonzero; only then is the list orthogonal.

Theorem: Let \((\mathbf{v}_1,\dots,\mathbf{v}_p)\) be a finite list in a real or complex inner product space. The list is orthogonal if and only if every \(\mathbf{v}_i\ne\mathbf{0}\) and \(\langle\mathbf{v}_i,\mathbf{v}_j\rangle=0\) for all indices \(i<j\).

Proof. If the list is orthogonal, its definition gives that every entry is nonzero and that the inner product vanishes for every pair of distinct indices. In particular, it vanishes whenever \(i<j\). Conversely, suppose every entry is nonzero and the inner product vanishes whenever \(i<j\). For distinct indices \(i\) and \(j\), either \(i<j\) or \(j<i\). In the first case, the assumed condition gives \(\langle\mathbf{v}_i,\mathbf{v}_j\rangle=0\). In the second case, it gives \(\langle\mathbf{v}_j,\mathbf{v}_i\rangle=0\). Conjugate symmetry in a complex space, or symmetry in a real space, then gives \(\langle\mathbf{v}_i,\mathbf{v}_j\rangle=0\) as well. Thus every distinct pair is orthogonal, and together with nonzeroness this is precisely the definition of an orthogonal list. \(\square\)

This result justifies checking each unordered pair once rather than computing both orders. It does not allow us to skip pairs: zero products for a selection of pairs do not establish that the entire list is orthogonal.

Worked Example: A Pairwise Orthogonal List in \(\mathbb{R}^3\)

Test the list \(\big((1,1,0)^{\top},(1,-1,0)^{\top},(0,0,3)^{\top}\big)\) for orthogonality.

Call the three vectors \(\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3\), in their listed order. Since there are three entries, we check the pairs \((1,2)\), \((1,3)\), and \((2,3)\). In \(\mathbb{R}^3\), the inner product is the sum of products of corresponding coordinates:

$$ \begin{aligned} \langle\mathbf{v}_1,\mathbf{v}_2\rangle &=1(1)+1(-1)+0(0)=1-1+0=0,\\ \langle\mathbf{v}_1,\mathbf{v}_3\rangle &=1(0)+1(0)+0(3)=0,\\ \langle\mathbf{v}_2,\mathbf{v}_3\rangle &=1(0)+(-1)(0)+0(3)=0. \end{aligned} $$

All three distinct-pair inner products are zero. Each vector is nonzero: the first two have nonzero first coordinates, and the third has third coordinate \(3\). Therefore the list is orthogonal.

Check: the computed products cover all \(3(3-1)/2=3\) unordered pairs, and the nonzero check covers all three entries. Both conditions in the definition are satisfied.

Checking Inner Products in Complex Coordinates

For vectors \(\mathbf{u}=(u_1,\dots,u_n)^{\top}\) and \(\mathbf{v}=(v_1,\dots,v_n)^{\top}\) in \(\mathbb{C}^n\), the standard inner product with our convention is

$$ \langle\mathbf{u},\mathbf{v}\rangle =\sum_{k=1}^{n}u_k\overline{v_k}. $$

The conjugate applies to the entries of the second vector. This matters even if the goal is only to test whether the result is zero. Complex conjugation can change the sign of an imaginary part, and it is part of the definition of the inner product, not an optional adjustment.

Theorem: In a complex inner product space, if \(\langle\mathbf{u},\mathbf{v}\rangle=0\), then \(\langle\mathbf{v},\mathbf{u}\rangle=0\). Thus either order gives the same answer to an orthogonality test.

Proof. Conjugate symmetry gives \(\langle\mathbf{v},\mathbf{u}\rangle=\overline{\langle\mathbf{u},\mathbf{v}\rangle}\). If \(\langle\mathbf{u},\mathbf{v}\rangle=0\), its complex conjugate is \(\overline{0}=0\). Therefore \(\langle\mathbf{v},\mathbf{u}\rangle=0\). \(\square\)

Worked Example: An Orthogonal Pair in \(\mathbb{C}^2\)

Test \(\mathbf{u}=(1,i)^{\top}\) and \(\mathbf{v}=(i,1)^{\top}\) for orthogonality. Here \(i^2=-1\), so \(\overline{i}=-i\). Using conjugation in the second slot gives

$$ \begin{aligned} \langle\mathbf{u},\mathbf{v}\rangle &=1\overline{i}+i\overline{1}\\ &=1(-i)+i(1)\\ &=-i+i\\ &=0. \end{aligned} $$

Both vectors are nonzero, since each has an entry equal to \(1\). Therefore the two-entry list \((\mathbf{u},\mathbf{v})\) is orthogonal.

Check: Reversing the order gives \(\langle\mathbf{v},\mathbf{u}\rangle=i\overline{1}+1\overline{i}=i-i=0\), as conjugate symmetry requires.

Worked Example: One Failed Pair in a Real List

Test \(\mathbf{a}=(1,2,-1)^{\top}\), \(\mathbf{b}=(2,-1,0)^{\top}\), and \(\mathbf{c}=(1,0,1)^{\top}\) in \(\mathbb{R}^3\). Compute all three products so the conclusion does not depend on an untested pair:

$$ \begin{aligned} \langle\mathbf{a},\mathbf{b}\rangle &=1(2)+2(-1)+(-1)(0)=2-2+0=0,\\ \langle\mathbf{a},\mathbf{c}\rangle &=1(1)+2(0)+(-1)(1)=1+0-1=0,\\ \langle\mathbf{b},\mathbf{c}\rangle &=2(1)+(-1)(0)+0(1)=2. \end{aligned} $$

The first two pairs are orthogonal, but \(\langle\mathbf{b},\mathbf{c}\rangle=2\ne0\). Consequently the list is not orthogonal. Each vector is nonzero, but that does not repair the failed pair test.

Check: there are exactly three unordered pairs, and the third has a nonzero inner product. One failed pair is sufficient to rule out orthogonality.

Zero Vectors and Lists with Repeated Entries

A zero vector has inner product zero with every vector, including itself. Therefore pairs involving \(\mathbf{0}\) always have inner product zero. However, this fact says nothing about pairs made up of the other entries. A list containing \(\mathbf{0}\) passes the distinct-pair test only if every other distinct pair also has inner product zero; regardless, the list is not an orthogonal list under the nonzero-vector convention.

For example, consider \(\big(\mathbf{0},(1,0)^{\top},(1,1)^{\top}\big)\) in \(\mathbb{R}^2\). The products involving \(\mathbf{0}\) vanish, but the product of the other two vectors is

$$ \langle(1,0)^{\top},(1,1)^{\top}\rangle =1(1)+0(1)=1\ne0. $$

So this list fails the distinct-pair test as well as the nonzero-vector requirement. By contrast, \(\big(\mathbf{0},(1,0)^{\top},(0,1)^{\top}\big)\) passes the distinct-pair test: the product of the two nonzero entries is \(1(0)+0(1)=0\), and the products involving \(\mathbf{0}\) are zero. Even so, it is not an orthogonal list because it contains \(\mathbf{0}\).

Repeated entries also require care. If a nonzero vector \(\mathbf{v}\) appears twice in a list, those two positions form a distinct pair, and their inner product is \(\langle\mathbf{v},\mathbf{v}\rangle=\|\mathbf{v}\|^2>0\). Thus a repeated nonzero entry makes the list fail the pair test. The test concerns positions in the list, not merely different vector values.

Common Mistakes and Corrections

Mistake: omitting the conjugate in a complex inner product. For the vectors in the complex example, an incorrect calculation would be \(1(i)+i(1)=2i\), leading to the false conclusion that the vectors are not orthogonal. That calculation uses \(\sum_k u_kv_k\), not the inner product in our convention. The correct calculation is \(1\overline{i}+i\overline{1}=-i+i=0\), so the vectors are orthogonal.

Mistake: assuming zero-vector pairs settle the whole list. For \(\big(\mathbf{0},(1,0)^{\top},(1,1)^{\top}\big)\), it would be wrong to say that the list passes the pair test just because the two pairs involving \(\mathbf{0}\) have zero product. The remaining pair has inner product \(1\), so the list does not pass. Even in a list where every distinct-pair product vanishes, the presence of \(\mathbf{0}\) still disqualifies it from being orthogonal under the stated definition.

A reliable procedure is therefore: identify every pair of distinct positions, compute each inner product using the correct real or complex formula, and then check that each entry is nonzero. This separates the arithmetic test from the definition’s nonzero-vector condition.

Check Your Understanding

For each list, calculate the required inner products and state whether the list is orthogonal. Remember to check nonzeroness as well.

  1. Test \(\big((1,0,1)^{\top},(1,1,0)^{\top},(1,-1,-1)^{\top}\big)\) in \(\mathbb{R}^3\).
  2. In \(\mathbb{C}^2\), compute \(\langle(1,i)^{\top},(1,1)^{\top}\rangle\) using the stated convention. Are the vectors orthogonal?
  3. Does \(\big(\mathbf{0},(1,0)^{\top},(0,1)^{\top}\big)\) pass the distinct-pair test? Is it an orthogonal list? Explain both answers.
  4. How many unordered distinct pairs must be tested in a list of \(5\) vectors?
  5. Explain why checking \(\langle\mathbf{v}_1,\mathbf{v}_2\rangle=0\) alone cannot establish orthogonality of a list with four entries.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon