For a linear operator on an inner product space with an orthonormal basis , its matrix elements are , using the convention that the inner product is linear in its second argument. For a finite-dimensional space, the expansion explains why these numbers represent the linear operator in that basis. In quantum mechanics, the expression is also called a matrix element between the two states; it need not be diagonal or an expectation value.
New to topics? Read the docs here!