Given a simple graph $G=(V, E)$ and a matrix, $C$, describing a property for each pair of nodes, e.g., the adjacency matrix, or the matrix describing the number of common triangles of two nodes. Is it possible to describe the vector $$\mathbf{x} = \Big(\sum_{x \sim y, \, x\sim z, \, y \sim z} C_{y,z} \text{ for } x \in V\Big)$$ in terms of matrix equations using the adjacency matrix?
I know, for example, that the number of shared triangles between each pair of nodes can be described as $A^2 \odot A$. Hence, if the matrix $C = (c)_{i,j\in V}$ is constant, the above vector can be expressed as $$\mathbf{x} = \frac{c}{2}(A^2 \odot A) \mathbf{1} \, .$$ However, I fail to see if this can be generalized to an arbitrary symmetric matrix $C$.
Edit: It has been mentioned that if $C$ is a constant, $\mathbf{x}$ can also be expressed via the diagonal of $A^3$, i.e. $$\mathbf{x} = c \cdot\operatorname{diag}\big(A^3\big) \, .$$
$$ \sum_{x \sim y, \, x\sim z, \, y \sim z} C_{y,z} = \sum_{y,z} A_{x,y} A_{y,z}C_{y,z}A_{z,x} = (A(A\odot C)A)_{x,x} $$ so $$ \mathbf{x} = diag(A(A\odot C)A ) = ((A(A\odot C)) \odot A) \mathbf{1} $$