On one hand, the dipole moment is define as $$\vec{\mu} = q\vec{r},$$ where q is the charge and $\vec{r}$ is a position vector.
On the other hand, I know the transition dipole operator of a two level system can be expressed as $$ \vec{\mu} = \mu_{ge}|g\rangle \langle e| + \mu_{eg}|e\rangle \langle g|. $$
The interaction term between a two level system and the external electric field is usually written as $$ H_{\mathrm{int}} = -\vec{\mu}\cdot \vec{E}(t), $$ where $\vec{\mu}$ is the dipole moment operator and $\vec{E}(t)$ is the time-dependent electric field.
I want to know three exponents of $\vec{\mu}$ and their commutation relations, e.g., $\vec{\mu}_x=?$ and $[\vec{\mu}_x,\vec{\mu}_y]=?$.
But I don't know how to relate $\vec{\mu}=\mu_0\vec{r}$ with $\vec{\mu} = \mu_{ge}|g\rangle \langle e| + \mu_{eg}|e\rangle \langle g|$ .