  We evaluate the neutron electric dipole moment $\vert \vec{d}_N\vert$ using
lattice QCD techniques. The gauge configurations analyzed are produced by the
European Twisted Mass Collaboration using $N_f{=}2{+}1{+}1$ twisted mass
fermions at one value of the lattice spacing of $a \simeq 0.082 \ {\rm fm}$ and
a light quark mass corresponding to $m_{\pi} \simeq 373 \ {\rm MeV}$. Our
approach to extract the neutron electric dipole moment is based on the
calculation of the $CP$-odd electromagnetic form factor $F_3(Q^2)$ for small
values of the vacuum angle $\theta$ in the limit of zero Euclidean momentum
transfer $Q^2$. The limit $Q^2 \to 0$ is realized either by adopting a
parameterization of the momentum dependence of $F_3(Q^2)$ and performing a fit,
or by employing new position space methods, which involve the elimination of
the kinematical momentum factor in front of $F_3(Q^2)$. The computation in the
presence of a $CP$-violating term requires the evaluation of the topological
charge ${\cal Q}$. This is computed by applying the cooling technique and the
gradient flow with three different actions, namely the Wilson, the Symanzik
tree-level improved and the Iwasaki action. We demonstrate that cooling and
gradient flow give equivalent results for the neutron electric dipole moment.
Our analysis yields a value of $\vert \vec{d}_N\vert=0.045(6)(1)\ \bar{\theta}
\ e \cdot {\rm fm}$ for the ensemble with $m_\pi=373$ MeV considered.
