To make the notation simpler, let us label the entries of \(W\) as follows:
\begin{equation*}
W=\begin{bmatrix}a & c\\ c & b\end{bmatrix}.
\end{equation*}
So, the \(\det(W)\geq0\) if and only if \(ab\geq c^2\text{.}\) Now, let us define two more matrices as follows:
\begin{equation*}
W_0=\begin{bmatrix}a^2 & ac & ac & c^2\\ ac & ab & c^2 & bc\\ ac & c^2 & ab & bc \\ c^2 & bc & bc & b^2\end{bmatrix},
\end{equation*}
\begin{equation*}
W_1=\begin{bmatrix}a^2 & ac & ac & c^2\\ ac & c^2 & ab & bc\\ ac & ab & c^2 & bc \\ c^2 & bc & bc & b^2\end{bmatrix},
\end{equation*}
where we view the rows/columns of \(W_0\) and \(W_1\) as being indexed by the elements of \(\{1,2\}^2\) in the lexicographic order: \((1,1),(1,2),(2,1),(2,2)\text{.}\) E.g., \(W_0(1,2,1,2)\) is the entry on the 2nd row and 2nd column in \(W_0\text{,}\) which is \(ab\text{,}\) whereas \(W_1(1,2,1,2)=c^2\text{.}\) Now, we claim that, for any \(\ell:E(G)\to\{0,1\}\text{,}\)
\begin{equation*}
\hom(L(G,\ell),W) = \sum_{f:V(G)\to\{1,2\}^2}\left(\prod_{uv\in E(G)}W_{\ell(uv)}(f(u),f(v))\right).
\end{equation*}
Let us explain why this equation is true. Recall that \(V(L)=V(G)\times\{0,1\}\text{.}\) For any function \(g:V(L)\to\{1,2\}\) there is a corresponding function \(f_g:V(G)\to\{1,2\}^2\) obtained by setting \(f_g(v)=(g(v,0),g(v,1))\text{.}\) The correspondence between \(g\) and \(f_g\) is a bijection. The homomorphism density of \(L\) in \(W\) is the sum over all \(g:V(L)\to\{1,2\}\) of the product over all edges of \(g\) of the entry of \(W\) on the row and column corresponding to the images of the endpoints of the edge under \(g\text{.}\) Recall that the edges of \(L\) are of the form \((u,0)(v,0)\) and \((u,1)(v,1)\) where \(uv\in E(G)\) and \(\ell(uv)=0\) and \((u,0)(v,1)\) and \((u,1)(v,0)\) where \(uv\in E(G)\) and \(\ell(uv)=1\text{.}\) So, for each \(uv\in E(G)\text{,}\) the product of the two edges of \(L\) corresponding to \(uv\) depend on the values of \(f_g(u)\) and \(f_g(v)\) and \(\ell(uv)\) in the way described by the matrices \(W_0\) and \(W_1\) (this is worth checking to convince yourself!). So, the above equation for \(\hom(L(G,\ell),W)\) holds (unless I’ve messed something up).
So, now let’s see how to use this to complete the proof. Let’s assume \(\det(W)\geq 0\) or, in other words, \(ab\geq c^2\text{.}\) The proof for non-positive determinant is pretty much the same. Let us take a function \(\ell:E(G)\to\{0,1\}\) and \(f:V(G)\to\{1,2\}^2\) and think about the term of the above sum corresponding to \(f\text{.}\) How does it change if we replace \(\ell\) with the function that maps every edge to zero? Well, the matrices \(W_0\) and \(W_1\) are equal for all of their entries except for the \(2\times2\) submatrix in the middle. So, the only edges whose “contribution” to the term corresponding to \(f\) change are those edges \(uv\) with \(\ell(uv)=1\) and \(f(u),f(v)\in\{(1,2),(2,1)\}\text{.}\) Call these edges “special.” Since we are assuming \(ab\geq c^2\text{,}\) for any special edge \(uv\text{,}\) if \(f(u)=f(v)\) then changing \(\ell\) to the all zero function increases the contribution of that edge from \(c^2\) to \(ab\) and, if \(f(u)\neq f(v)\text{,}\) then it decreases it from \(ab\) to \(c^2\text{.}\) Suppose that we colour an edge \(uv\) of \(G\) blue if it is special and \(f(u)=f(v)\) and red if it is special and \(f(u)\neq f(v)\text{.}\) Note that the red edges must form a bipartite graph, but that there is no such restriction on the blue edges. It feels like it should be possible to exploit this, but I can’t figure out how to do it!!! So, this proof is incomplete...