& \\ & & & \ddots & \\ & & & & 1\end{pmatrix},\ \ \  D = \begin{pmatrix}1 & & & & \\ & 0 & & & \\ & & 0 & & \\ & & & \ddots & \\ & & & & 0\end{pmatrix}.\end{aligned}$$

\[def:ghp\] Given graphs $G$ and $H$, the *hierarchical product* $P = G{\mathbin{\Pi}}H$ is the graph on vertices $V_P = V_G\times V_H$ and edges $E_P \subseteq V_P\times V_P$ specified by the adjacency matrix $$A_P = A_G \otimes D_H + {\mathbbm{1}}_G \otimes A_H \label{eq:ghp_adj},$$ or, equivalently, by the algebraic Laplacian $$L_P = L_G \otimes D_H + {\mathbbm{1}}_G \otimes L_H .$$ We will often use the shorthand $A_P = A_G{\mathbin{\Pi}}A_H$ and $L_P = L_G{\mathbin{\Pi}}L_H$.

If $G$ and $H$ are graphs, then $G {\mathbin{\Pi}}H$ may be thought of as one copy of $G$ with ${\ensuremath{\left| G \right|}}$ copies of $H$, each attached to a different vertex of $G$ (see Fig. \[fig:hp\]). Thus, $G{\mathbin{\Pi}}H$ is a graph which has ${\ensuremath{\left| G \right|}}$ *modules* of ${\ensuremath{\left| H \right|}}$ nodes each. The modules’ internal connectivity is described by $H$, and the modules are connected to one another in a manner described by $G$. The hierarchical product formalism therefore naturally produces modular 