Let $z$ be a 7th root of 1, $z \neq 1$, find the value of $z+z^{2}+z^{4}$.

Translate the text above into English, please keep the original text's line breaks and format, and output the translation result directly.
Let $u=z+z^{2}+z^{4}, v=z^{3}+z^{5}+z^{6}$. Given $z^{7}=1, z \neq 1$. We have
$$
1+z+z^{2}+z^{3}+z^{4}+z^{5}+z^{6}=\frac{1-z^{7}}{1-z}=0,
$$

so $u+v=-1$.
Also, $\left(z+z^{2}+z^{4}\right)\left(z^{3}+z^{5}+z^{6}\right)=z^{4}+z^{6}+1+z^{5}+1+z+1+z^{2}+z^{3}=2$, i.e., $uv=2$. Therefore, $u, v$ are the roots of the equation $x^{2}+x+2=0$. Thus, $u=\frac{-1 \pm \sqrt{7} \mathrm{i}}{2}$, which means the value of $z+z^{2}+z^{4}$ is $\frac{-1 \pm \sqrt{7} i}{2}$.