  Conceiving a molecule as composed of smaller molecular fragments, or
subunits, is one of the pillars of the chemical and physical sciences, and
leads to productive methods in quantum chemistry. Using a fragmentation scheme,
efficient algorithms can be proposed to address problems in the description of
chemical bond formation and breaking. We present a formally exact
time-dependent density-functional theory for the electronic dynamics of
molecular fragments with variable number of electrons. This new formalism is an
extension of previous work [Phys. Rev. Lett. {\bf 111}, 023001 (2013)]. We also
introduce a stable density-inversion method that is applicable to
time-dependent and ground-state density-functional theory, and their
extensions, including those discussed in this work.
