We propose an approach to represent the second-quantized electronic Hamiltonian in a compact sum-of-products (SOP) form. The approach is based on the canonical polyadic decomposition of the original Hamiltonian projected onto the sub-Fock spaces formed by groups of spin-orbitals. The algorithm for obtaining the canonical polyadic form starts from an exact sum-of-products, which is then optimally compactified using an alternating least squares procedure. We discuss the relation of this …