inner_product

probnum.utils.linalg.inner_product(v, w, A=None)[source]

Inner product \(\langle v, w \rangle_A := v^T A w\).

For n-d arrays the function computes the inner product over the last axis of the two arrays v and w.

Parameters
Returns

Inner product(s) of v and w.

Return type

inprod

Notes

Note that the broadcasting behavior of inner_product() differs from numpy.inner(). Rather it follows the broadcasting rules of numpy.matmul() in that n-d arrays are treated as stacks of vectors.