Optimizing computational kernels in quantum chemistry