Inner Product

Definition

The inner product (dot product, scalar product) of two vectors is the matrix product of a row vector with a column vector, yielding a scalar.

Intuition

Geometrically, where is the angle between the two vectors. It measures how much one vector “projects onto” the other. When the inner product is zero, the vectors point in completely perpendicular directions; when it equals the product of their norms, they are perfectly aligned.

Formal Description

For column vectors :

  • If for nonzero , the vectors are orthogonal.
  • The norm (Euclidean length) of a vector: .
  • A vector with is normalised.
  • A set of vectors that are mutually orthogonal and each normalised is called orthonormal.
  • The inner product is commutative: .

Applications

  • Computing similarity between vectors (e.g. cosine similarity in NLP and recommendation systems).
  • Defining the Euclidean norm and distance for optimisation and nearest-neighbour search.
  • Checking orthogonality; forming orthonormal bases via Gram–Schmidt.

Trade-offs

  • The standard inner product assumes the Euclidean metric; in weighted or non-Euclidean spaces a different inner product (e.g. for positive-definite ) may be more appropriate.
  • For complex vectors, the inner product is (conjugate transpose), not ; confusing the two breaks conjugate symmetry and positive-definiteness.
  • The inner product collapses two vectors to a single number, discarding directional information — use the outer product when the full rank-1 interaction matrix is needed.