Solution (source code)

= Solution

For a fixed original term, define $F_d(h_Z)=\int w(t)e^{itH_d}h_Ze^{-itH_d}dt$. The shell increment is exactly $A^{(Z,d)}=F_d(h_Z)-F_{d-1}(h_Z)$. Hence the <telescoping local-shell decomposition> gives
$$
\sum_{d=1}^DA^{(Z,d)}=F_D(h_Z)-F_0(h_Z).
$$
Use the printed endpoint convention $H_0=h_Z$ and $H_D=H$. The first endpoint is $F_0(h_Z)=h_Z\int w=h_Z$, because $h_Z$ commutes with its own evolution, and the second is the operator chosen in part (b). Thus
$$
\boxed{A^{(Z)}=h_Z+\sum_{d=1}^DA^{(Z,d)}.}
$$
There is a distance-convention issue in the endpoint assertion. The usual minimum distance between supports is zero for overlapping distinct interactions, so a literal $H_0=\sum_{Y:d(Z,Y)=0}h_Y$ need not equal $h_Z$ or commute with it. To realize the stated $H_0=h_Z$, index the neighborhoods by distance between interaction terms: the central term has shell zero, and other terms begin in positive shells. For example, for distinct terms use one plus their support <interaction distance>. With the ordinary overlapping-support convention left unchanged, the exact formula instead begins with $F_0(h_Z)$, not necessarily with $h_Z$. The telescoping identity itself is valid in either convention.