Spectral reciprocity and matrix representations of unbounded operators