  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 (CPD) 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 specific SOP with
related forms, namely the Tucker format and the matrix product operator often
used in conjunction with matrix product states. We benchmark the method on the
electronic dynamics of an excited water molecule, trans-polyenes, and the
charge migration in glycine upon inner-valence ionization. The quantum dynamics
are performed with the multilayer multi-configuration time-dependent Hartree
method in second quantization representation (MCTDH-SQR). Other methods based
on tree-tensor Ans\"atze may profit from this general approach.
