Inner product and orthonormal basis