# Inner product

scalar product, dot product, $\def\vect#1{\mathbf{#1}}\def\modulus#1{\left|#1\right|}(\vect a,\vect b)$ of two non-zero vectors $\vect a$ and $\vect b$

The product of their lengths and the cosine of the angle $\phi$ between them: $(\vect a,\vect b)=\modulus{\vect a}\modulus{\vect b}\cos\phi.$ $\phi$ is taken to be that angle between the vectors not exceeding $\pi$. When $\vect a$ or $\vect b$ is zero, the inner product is taken to be zero. The inner product $(\vect a,\vect a)=\vect a^2=\modulus{\vect a}^2$ is called the scalar square of the vector $\vect a$ (see Vector algebra).

The inner product of two $n$-dimensional vectors $\vect a=(a_1,\dotsc,a_n)$ and $\vect b=(b_1,\dotsc,b_n)$ over the real numbers is given by $(\vect a,\vect b)=a_1b_1+\dotsb+a_nb_n.$ In the complex case it is given by $(\vect a,\vect b)=a_1\bar b_1+\dotsb+a_n\bar b_n$ An infinite-dimensional vector space admitting an inner product and complete with respect to it is called a Hilbert space.

More generally, an inner product on a real vector space is a symmetric bilinear form $f$ which is positive definite, i.e., $f(x,x)>0$ for all $x\neq 0$. A (unitary) inner product on a complex vector space is likewise defined as a Hermitian (i.e., with $f(y,x)=\overline{f(x,y)}$) sesquilinear form, with complex conjugation as automorphism, which is positive definite. In finite-dimensional spaces one can always find an orthonormal basis in which $f$ takes the standard form $f(x,y)=\sum_{i=1}^n x_iy_i$, respectively $\sum_{i=1}^n x_i\bar y_i$.