Given a relation $R$ on a set $S$, when is there an injection $f:S\hookrightarrow \text{End}(V)$ for some vector space $V$ such that for all $x$ and $y$ in $S$, we have $x\,R\,y$ iff $[f(x),f(y)]=0$? The case where $V$ is a Hilbert space and we demand that the image of $f$ be hermitian matrices is of particular interest.
Since $[M,M]=0$ and $[M,N]=-[N,M]$, we need at the very least that $R$ is reflexive and symmetric. However, I believe these are not sufficient. Indeed, if we consider the set $S=\{a,b,c,d\}$, and the relation which is the reflexive/symmetric completion of:
$$\{(a,b),(b,c),(c,d),(d,a)\},$$
then I believe that to not be representable as commutation (not for good reasons, I just couldn't find an example after trying obvious things).
I tried solving this problem by restricting to the hermitian case and saying that matrices commute when their eigenspaces are compatible, but I couldn't extract a simple condition on $R$ from this.
Motivation: In quantum mechanics, observables are simultaneously measurable if they commute. I am interested in the restrictions this places on the "simultaneously measurable" relation. Symmetric and reflexive are very natural properties for this relation to have on physical grounds, but I am wondering if there are other restrictions.