I would like to write an equation over binary trees. Here is the code I have so far: `
\[
\begin{array}{lcr}
\sum(-1)^{p+qr}
\begin{tikzpicture}[scale = 0.8]
\node[circle] at (1,-1) {$\gamma_q$};
\node[circle] at (1,-2.5) {$f_k$};
\draw[thick] (0.5,0) -- (1,-0.7);
\draw[thick] (1,0) -- (1,-0.7);
\draw[thick] (1.5,0) -- (1,-0.7);
\draw[thick] (0,-1.3) -- (1,-2.2);
\draw[thick] (0.5,-1.3) -- (1,-2.2);
\draw[thick] (1,-1.3) -- (1,-2.2);
\draw[thick] (1.5,-1.3) -- (1,-2.2);
\draw[thick] (2,-1.3) -- (1,-2.2);
\draw[thick] (1,-2.75) -- (1,-3.4);
\end{tikzpicture}
&
-\sum(-1)^{\varepsilon}
&
\begin{tikzpicture}[scale = 0.8]
\node[circle] at (0,-1) {$f_{j_1}$};
\node[circle] at (1.35,-1) {$f_{j_i}$};
\node[circle] at (2.55,-1) {$f_{j_k}$};
\node[circle] at (1,-2.5) {$\rho_k$};
\node[circle] at (0.6,-1) {$\ldots$};
\node[circle] at (2.0,-1) {$\dots$};
\draw[thick] (-0.6,0) -- (0,-0.7);
\draw[thick] (-0.2,0) -- (0,-0.7);
\draw[thick] (0.25,0) -- (0,-0.7);
\draw[thick] (1.0,0) -- (1.35,-0.7);
\draw[thick] (1.4,0) -- (1.35,-0.7);
\draw[thick] (2.9,0) -- (2.4,-0.7);
\draw[thick] (2,0) -- (2.4,-0.7);
\draw[thick] (1.8,0) -- (2.4,-0.7);
\draw[thick] (3.1,0) -- (2.4,-0.7);
\draw[thick] (0,-1.3) -- (1,-2.2);
\draw[thick] (0.5,-1.3) -- (1,-2.2);
\draw[thick] (1,-1.3) -- (1,-2.2);
\draw[thick] (1.5,-1.3) -- (1,-2.2);
\draw[thick] (2.2,-1.3) -- (1,-2.2);
\draw[thick] (1,-2.75) -- (1,-3.4);
\end{tikzpicture}
\end{array}
\]
` While the trees in the diagram are correct (although probably poor from a coding point of view), the positioning of the summation signs is problematic: I would like them to appear at about the midpoint of each tree.
Is there a way to write equations in TikZ, or is there some other way to improve the placement of the summation symbols?


\raiseboxes. – Jasper Habicht Jan 16 '18 at 19:53forest, but that's just the trees. – cfr Jan 17 '18 at 02:12